Skip to content

Research: IKOS-inspired abstract-state soundness oracle and operator audit (bounded spike) #433

Open

Description

@PhysShell

Classification

Motivation

S5 ended at STOP-SOUNDNESS, and the evaluated real-project cases did not show meaningful product advantage over C01. More sophisticated warnings are not useful if an internal transfer, join, loop approximation, or incomplete-input path silently loses a feasible ownership state and then reports safety.

IKOS is interesting not as a ready-to-use .NET ownership analyzer, but for several inspectable engineering patterns:

  1. Abstract-state semantics separated from checkers. Domain operators and fixpoint machinery need explicit, independently testable contracts.
  2. Soundness checker (-a=sound) flags operations that may invalidate the analyzer's assumptions rather than treating every completed scan as a proof.
  3. Widening/narrowing and partitioning make the precision-vs-cost tradeoff explicit; maintaining separate outcomes can avoid premature information loss.
  4. Result taxonomy: IKOS distinguishes safe/error/unreachable/warning, with warning also covering insufficient information. Its classifications do not magically establish soundness outside stated assumptions.

Relevant IKOS documentation:

Default decision: do not port IKOS, LLVM IR, numerical domains, APRON, or its engine; Own.NET already has ownership state, CFG/worklist/fixpoint facilities. The first task is to audit whether existing mechanisms preserve their intended semantics.

Research question

Can a small, independent concrete-state oracle and algebraic property tests expose a verified unsoundness defect in Own.NET's abstract-state operations or prevent misleading SAFE/absence claims under incomplete analysis, without building another analyzer?

Keep these distinct:

  • Unsoundness: a concretely reachable state/bug is excluded by the abstract result, or an incomplete analysis is treated as complete.
  • Imprecision: the abstract result contains extra (possibly infeasible) states; this can cause warnings, but is not itself unsound.
  • Oracle limitation: the tiny reference semantics cannot model the relevant C# construct. Report UNMODELED, not PASS.

Bounded work plan

0. Inventory before implementing

1. Independent tiny-state oracle (test-only)

Define a small, reviewable reference machine (separate from production analysis helpers) with finitely many resource identities and path states. Begin with:

  • acquire/new obligation; use; release/Dispose; double release/use-after-release;
  • alias vs distinct resource identity; transfer/consume vs borrow;
  • conditional branch, early return, and cleanup on normal vs exceptional exit where the pinned lowering faithfully exposes it;
  • opaque call / unmodeled effect and an explicitly exhausted analysis budget.

For small loop-free or deliberately bounded programs, enumerate concrete successor states and compare with the abstract output at selected program points:

  • Every modeled reachable concrete successor must be represented by (i.e., belong to the concretization of) the abstract state.
  • Transfer: abstraction of concrete post-states is covered by abstract transfer of the pre-state.
  • Join: each input's concretization is included in the joined state's concretization; join should be monotone/idempotent where the selected domain promises that law.
  • Bottom/top and ordering properties are tested only when the implementation exposes corresponding semantics.
  • For loops, a bounded explorer is not a proof about unbounded executions; test only sound local invariants of any actual approximation/widening operator, or mark loops out of scope.

Crucially, the oracle must not call Own.NET's transfer/join functions to compute the expected result. Hand-review its semantics against source-level C# behavior. Enumerating bounded executions can find counterexamples but cannot establish global analyzer soundness.

2. Adversarial soundness and completion cases

Include a small matrix of reviewed positive and negative tests:

  • branch merge with cleanup on one path only;
  • guarded Dispose plus early return or thrown exception;
  • two aliases to one resource vs two distinct resource instances;
  • consuming callee vs borrowed callee; unknown/virtual/unresolved target;
  • missing/unsupported OwnIR fact or call effect, partial CFG/call frontier, interrupted/budget-exceeded analysis;
  • path partitioning by return value only if an existing mechanism can represent it.

Safety invariant: an UNKNOWN, unsupported effect, skipped path, incomplete CFG, timeout, or budget cutoff must not silently become a proven SAFE or a complete absence claim. Evaluate this against existing result semantics: do not redefine all clean diagnostics as a global proof obligation without first documenting current contracts.

Capture first divergence (concrete states → lowered facts → transfer/join/fixpoint → checker/result), not just a mismatch count.

3. Mutation-test the analyzer operations (distinct from #405)

If feasible, deliberately inject a few test-only broken variants:

  • join drops an incoming path;
  • release is applied to the wrong alias/identity;
  • unknown effect is treated as no-op;
  • exceptional/early-return edge is discarded;
  • actual loop approximation fails to over-approximate.

The oracle/property suite should fail on each applicable, valid mutant. Record mutants not generated or not applicable. This is operator-level fault injection, not #405's mutations to user C# source.

4. Optional partitioning micro-comparison, only after an observed gap

On 2–4 reviewed cases, compare current state merging with a test-only limited partition keyed by a return outcome or relevant guard, if current abstractions can support it cheaply. Record changed classifications, any lost states, time/memory growth, and whether this genuinely fixes an adjudicated problem.

Do not generalize from a synthetic precision win to real-project utility; no default production partitioning.

Deliverables / acceptance criteria

  • Pinned IKOS source/documentation note, explicitly separating transferable patterns from LLVM/C++-specific implementation and assumptions.
  • Inventory of actual Own.NET domain operators, convergence behavior, completeness contract and gaps; no invented widening/partitioning capabilities.
  • Independently reviewed, minimal concrete semantics and small deterministic oracle corpus, with assumptions documented.
  • Per-case trace showing concrete reachable states vs abstract coverage; PASS / UNSOUND-COUNTEREXAMPLE / INCOMPLETE / UNMODELED / INFRA-ERROR kept distinct.
  • At least 3 applicable injected operator faults demonstrably caught, or an explicit explanation of why such injection is not viable; do not inflate a score with inapplicable mutants.
  • At least one adversarial case verifying that unsupported/unknown/incomplete work is not represented as a proven safe result.
  • Reproduction instructions, pinned revision/commands, tiny fixtures, machine-readable results and a short human audit report.
  • End with CONFIRMED UNSOUNDNESS → narrow fix issue, RESEARCH-ONLY (useful checks but no new bug), or STOP (overlap, inadequate oracle, or unjustified cost). No broad soundness claim based on finite tests.

Stop and safety gates

Stop after the bounded corpus and a handful of operator mutations. Do not add a new solver, numerical domain, global abstract interpreter, always-on CI mutation stage, or rewrite of diagnostics in this ticket.

Any proposed production SAFE upgrade or warning suppression must be reviewed in its own issue, with a documented semantic model and adversarial tests. A bounded reference oracle is evidence about its modeled subset only. IKOS itself has stated analysis assumptions; importing its vocabulary without equivalent contracts would recreate the same soundness problem.

IKOS uses the NASA Open Source Agreement 1.3 (NOSA): study ideas/docs initially, do not copy code without a separate license review.

Activity

  1. PhysShell commented on Nov 21, 2026

    @PhysShell
    OwnerAuthor

    Additional primary evidence: eBPF multi-domain emptiness

    Detecting Empty Abstractions and Pruning Dead Paths, 17 Nov 2026, preprint; full evaluation. The verifier's individually valid interval/bit domains could have an empty joint concretization. Checking emptiness before reduction/exploration prevented five historical invariant violations; 5,563 kernel/Cilium configurations showed unchanged verdicts and 1.48% average overhead. tnum_step has Lean/Z3 verification and is reported upstream; this is not proof of the entire verifier or evidence that arbitrary domain products admit O(1) checks.

    Extend the existing operator audit, reusing #450's semantic vocabulary:

    • Inventory whether Own.NET has an explicit unreachable bottom, versus unknown/top and incomplete results.
    • Construct tiny concrete-state controls where path constraints jointly have no solution, despite individually nonempty domain components. Check bottom propagation before transfer, reduction and joins.
    • Compare against feasible paths that contain ownership violations. Disposed + subsequent use is a real diagnostic, not bottom. DI lifetime mismatch likewise must not be pruned as impossible. Only an empty concrete path-state intersection justifies pruning.
    • Test missing facts and budget exhaustion remain unknown/incomplete; compare positive preservation, false positives and visited states on pinned existing fixtures.

    Stop if current normalization already covers the cases. Do not introduce a numerical domain or general SMT engine merely to imitate eBPF. Related new interval/exit obligation research: #464.

  2. PhysShell commented on Nov 23, 2026

    @PhysShell
    OwnerAuthor

    2026-11-23 — InvalML / Boolean-algebraic types as possible independent semantic comparison

    Research / INVALIDATION-TYPES-01 #466 · Full research Page · InvalML · MLstruct · SEBAS.

    REFERENCE / REUSE-FIRST / KILL-FIRST / NOT ADOPTED. InvalML's experimental permanent/temporary invalidation type-and-effect inference may provide a different description of invalidated aliases/regions; MLstruct supplies structural Boolean type inference; SEBAS supplies a subtyping algorithm, not an automatic ownership oracle.

    Boundary for #433: its existing source-reviewed concrete-state oracle and mutation/seam inventory remain authoritative. #466 may borrow that same frozen corpus to assess if an InvalML-like constraint captures an observed Own.NET risk; it must not create another oracle, conflate type soundness with Rust implementation fidelity, or treat unknown/unsupported effects as safety. For any claimed gain, require first divergent named transfer/join at pinned revision and a deliberate wrong-invalidation/wrong-alias mutant that old baseline misses.

    No new Scala dependency, typed frontend, schema, proof stack or production verdict permitted without separate GO. If no incremental counterexample, DUPLICATE / PARK.

  3. PhysShell commented on Nov 24, 2026

    @PhysShell
    OwnerAuthor

    2026-11-24 — Lean-Move proof architecture as oracle adequacy reference (not another analyzer)

    Lean-Move Page · metatheory · artifact guide. Transferable architecture: a small step semantics with an explicit enum of 13 runtime errors; preconditions stated in SoundnessAssumptions; algorithmic checker proven sound with respect to a separately defined relational judgement; type_soundness eliminates 8 preventable error constructors under assumptions, not all errors. 31 concrete examples discharge decidable premises (avoid vacuous proof) and independently exercise real execution via bounded #guard.

    #433 already owns an independent concrete-state oracle for OwnIR transfers/joins. The LeanMove lesson is to keep proof inputs/assumptions, concrete-model limitations, non-vacuous witnesses and implementation mapping visible. A formal theorem about a toy transfer does not verify Roslyn→OwnIR or current Rust production code. Prefer existing oracle; no second checker or mandatory Lean harness. Negative mutants and UNKNOWN on unsupported semantics remain required.

  4. PhysShell commented on Nov 27, 2026

    @PhysShell
    OwnerAuthor

    Gillian CSE à la carte: explicit composition contracts as an audit reference

    Compositional Symbolic Execution à la Carte, 23 Nov 2026, extended POPL 2027 paper; full text, §§6–7; Docker/reproduction artifact. Shared research note.

    Memory models, predicates and bi-abduction are built from combinators with Rocq-backed contracts. Gillian case studies include Collections-C, Buckets.js and AWS Encryption SDK. AWS C verification took 113s versus 112s for the monolithic model; comparison also exposed an unsoundness in the old JavaScript model. Formal behavioral equivalence covers demonstrator models, while real-language comparisons are empirical. The approach has been evaluated in one framework; applicability to Infer-Pulse is explicitly unresolved.

    Conditional audit, reusing this issue's oracle

    Inventory the actual interfaces between resource identity, ownership/lifetime/borrow state and API-effect summaries. Document what each component consumes, produces, assumes and must preserve; in particular identity preservation, obligation conservation, unknown effects, join consistency and exceptional cleanup. This is an interface-contract audit first.

    Only if it reveals a concrete coupling bug or duplicated semantics, compare the existing model against one small test-only decomposition for a reviewed IDisposable wrapper. Reuse existing fixtures; measure per-case equivalence, first divergences, unknown/incomplete behavior, code duplication and runtime. Use controlled broken compositions (lost obligation, wrong resource identity, unknown treated as no-op) to check the oracle can reject them.

    Gate: demonstrated correctness or maintainability gain at acceptable cost → separate minimal implementation issue. Otherwise STOP with the interface map. No Gillian/OCaml dependency, new bi-abduction engine, general combinator framework, full solver rewrite, or transfer of the paper's proof to unverified C# semantics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions