Repository navigation
Research: Heros-inspired IFDS/IDE feasibility for interprocedural ownership facts (bounded spike) #434
Description
Classification
- Type: bounded research / solver expressibility and differential-validation spike
- Priority: P2 / backlog; no production solver implementation by default
- Area: OwnIR → existing interprocedural ownership/MOS summaries → fact propagation → diagnostics and completeness
- Prior art: soot-oss/heros, an established Java IFDS/IDE solver framework (not a .NET analyzer or a ready-to-use Own.NET dependency).
- Related / distinct: Research: SootUp-inspired OwnIR/ICFG semantic-fidelity and incomplete-call audit (bounded spike) #430 (SootUp: Roslyn→OwnIR/ICFG semantic fidelity and incomplete-call boundaries), Research: WALA-inspired demand-driven alias precision for ownership diagnostics (bounded spike) #429 (WALA: alias/context precision), Canonical first-party call facts: preserve interprocedural calls instead of collapsing them into frontend release/use/escape guesses #382 (canonical first-party call facts), Research: semantic mutation testing harness for Own.NET analyzer coverage (bounded pilot) #405 (semantic mutation tests), Research: COVA-inspired targeted path-condition oracle for ownership soundness (bounded spike) #431 (targeted path-condition oracle), Research: evaluate Bifrost for C# code intelligence, agent navigation, and evidence contracts #426 (completeness/evidence contract), P-022 diagnostics: normalized AnalysisTrace and first-divergence minimizer for Python↔Rust shadow mode #269 (first divergence), Heap-effect summaries for external code (BCL / annotations) so calls like logging can be proven harmless inside a protocol region #394/Research: OpenTaint-style contract tests and engine-gap triage for method-effect models #425 (external-effect model testing), Research: semantic subgroup analysis for Own.NET diagnostic quality (bounded pilot) #427 (semantic subgroup evaluation).
- Default decision: do not port Heros, add Java runtime, replace OwnIR/Python/Rust cores, introduce generic IFDS/IDE infrastructure, or change production verdicts.
Why investigate?
Own.NET already has flow-sensitive resource states, method/effect summaries, Roslyn→OwnIR and Python/Rust core implementations. Heros is interesting for its algorithmic boundaries:
- IFDS handles interprocedural, context-sensitive propagation of finite distributive sets of facts via normal/call/return/call-to-return flow functions.
- IDE extends this with edge functions over a value lattice.
IDESolveruses path edges, end summaries and reusable jump functions;JumpFunctionsprovides indexed lookup.- Heros includes field-sensitive and bidirectional variants, but their existence does not establish complete C# aliasing or correct disposal/exception semantics.
A useful Own.NET question is not “could we implement a more sophisticated solver?”, but:
Do existing, independently verified ownership failures specifically arise from missing context-sensitive propagation or summary reuse, and are those cases faithfully representable as IFDS/IDE without weakening the conservative correctness contract?
S5 previously stopped with STOP-SOUNDNESS and showed no established incremental utility over C01 on the evaluated real programs. Complexity alone is not a product outcome.
Research questions
- Which of the existing
acquire/release/use/escape, event+=/-=, ownership-transfer, loan/permission, and method-summary facts genuinely fit a finite distributive IFDS formulation? Which require correlated facts, richer typestate/IDE values, may/must separation, or cannot be faithfully encoded within a bounded domain? - If a concrete interprocedural diagnostic error remains after Research: SootUp-inspired OwnIR/ICFG semantic-fidelity and incomplete-call audit (bounded spike) #430's source→OwnIR fidelity checks, is the first divergence in call/return propagation or summary computation, rather than missing call facts (Canonical first-party call facts: preserve interprocedural calls instead of collapsing them into frontend release/use/escape guesses #382), alias precision (Research: WALA-inspired demand-driven alias precision for ownership diagnostics (bounded spike) #429), method models (Heap-effect summaries for external code (BCL / annotations) so calls like logging can be proven harmless inside a protocol region #394/Research: OpenTaint-style contract tests and engine-gap triage for method-effect models #425), path feasibility (Research: COVA-inspired targeted path-condition oracle for ownership soundness (bounded spike) #431), or an invalid oracle?
- Can an independent, tiny offline tabulation reference catch a transfer/summary defect or explain a confirmed missed finding without silently turning unknown/incomplete into safe? How much does it cost?
Bounded plan
0. Pin sources, inspect existing engine, preregister cases
- Pin an Own.NET commit, Python/Rust analysis modes, extractor flags, commands, runtime and existing regression/oracle artifacts.
- Pin a Heros tag/commit and inspect actual implementation:
InterproceduralCFG,FlowFunctions,IDESolver,JumpFunctions, field-sensitive analysis. Distinguish IFDS from IDE and both from frontend/call-graph/alias responsibilities. - Reuse ~8–12 reviewed existing positive/negative cases and small real-OSS counterexamples. Preregister source-level expected semantics before observing new solver output. Include at least one bona fide missed misuse or documented FP attributable plausibly to interprocedural propagation.
- Check Research: SootUp-inspired OwnIR/ICFG semantic-fidelity and incomplete-call audit (bounded spike) #430 / Canonical first-party call facts: preserve interprocedural calls instead of collapsing them into frontend release/use/escape guesses #382 first: if the required call edge or receiver/argument/resource identity never reached OwnIR, STOP this solver spike and link the upstream representation gap. A solver cannot recover omitted semantics.
1. Formal expressibility audit (paper first, no code)
Write down the actual abstract domain and transfer semantics for 1–2 narrow resource protocols (e.g. disposable resource state, or event subscription with release):
- Fact identity and zero fact, normal/call/return/call-to-return transfers; direct vs unresolved/virtual calls, recursion, return into caller and explicit source/receiver mapping.
- Check the IFDS requirement
f(A ∪ B) = f(A) ∪ f(B)on representative counterexamples, not just trivialGen/Killexamples. Do not assume a mutually dependent ownership predicate is distributive merely by encoding it as a string. Explicitly account for correlation loss and any finite-domain explosion when using product facts. - If IDE is warranted, define a finite value domain, edge-function composition/join and the correctness of its lattice operations. Otherwise prefer the simpler IFDS case.
- Document may/must and unknown semantics, alias/resource-identity requirements, bounded access paths, loops and join points. Test the difference between “witness exists” and “all feasible exits release.”
- Enumerate unsupported C# constructs (particularly
using/await using,try/finallyand exceptional control flow, dynamic/virtual dispatch, opaque external effects, async/cancellation), explicitly distinguishing a missing model from a solver bug. - Produce an expressibility matrix:
faithful IFDS,possible IDE/composite-fact trade-off,requires upstream facts/models,out of scope/unknown. “Not currently expressible” is an acceptable result.
2. Conditional minimal differential experiment
Only if phase 1 identifies an eligible, independently reproducible gap and a faithful small fact domain:
- Build a test-only isolated reference using existing OwnIR facts/minimized ICFG, rather than touching production Rust/Python diagnostic authority. A simple hand-audited tabulation solver is preferred; do not port or depend on Heros.
- Exercise direct calls, a wrapper/helper chain, recursion or mutual recursion, multiple callers, call-to-return bypass, distinct instances and must/may aliases, a branch join, and an exceptional cleanup path where faithfully represented.
- Check path edges, return-context restoration, summary reuse,
gen/kill, zero fact, join/edge-function laws, termination and deterministic outputs. Do not claim exception semantics based only on a CFG API with return sites. - Reuse Research: semantic mutation testing harness for Own.NET analyzer coverage (bounded pilot) #405's semantic mutants/metamorphic tests; use P-022 diagnostics: normalized AnalysisTrace and first-divergence minimizer for Python↔Rust shadow mode #269's first-divergence instrumentation where available. Do not build another full mutation harness, an alias-analysis framework, an SMT solver or an evidence schema.
3. Soundness and adversarial controls
- Unresolved/opaque calls, missing callee body, incomplete CFG/ICFG, recursion/context/state budget exhaustion, timeout, unsupported C# lowering or failed analysis are never proof of safety. Preserve separate
UNKNOWN/INCOMPLETE/UNSUPPORTEDas appropriate within existing evidence conventions (Research: evaluate Bifrost for C# code intelligence, agent navigation, and evidence contracts #426). - Force an omitted call edge and a truncated worklist. Confirm the prototype does not return a complete negative/safe result.
- Prevent both spurious “must release” claims from joined
maypaths and false negatives from incorrectly killing facts at calls/returns. - Independently adjudicate each putative TP/FP against executable/source-level C# semantics where practical, not against the reference solver's own output.
- Keep previously confirmed positive controls and Python/Rust parity intact. No auto-suppression and no promoted confidence from prototype agreement.
4. Costs and decision
- Compare per case: source-level oracle, current Own.NET result/evidence, prototype result, first demonstrated divergence, TP/FP/FN/unknown/completeness, worklist iterations, facts/path edges, summaries, elapsed time and peak memory (only if code is run).
- Include at least one small pinned real-OSS slice if an eligible gap exists. No synthetic aggregate precision/recall marketing from a tiny curated corpus.
- State what specifically is better: new independently confirmed bug, removed verified FP, repaired unjustified safe verdict, improved evidence, or merely an alternative implementation of existing behavior.
- End with STOP / RESEARCH ONLY / FOLLOW-UP CANDIDATE. Open a separate production implementation issue only if a validated product-relevant gain outweighs cost and passes adversarial/negative controls.
Acceptance criteria
- Pinned Heros source-backed note with IFDS/IDE algorithm boundaries, relevant classes, and Java vs .NET limitations.
- Explicit disjointness/overlap map with Research: SootUp-inspired OwnIR/ICFG semantic-fidelity and incomplete-call audit (bounded spike) #430, Research: WALA-inspired demand-driven alias precision for ownership diagnostics (bounded spike) #429, Canonical first-party call facts: preserve interprocedural calls instead of collapsing them into frontend release/use/escape guesses #382, Research: semantic mutation testing harness for Own.NET analyzer coverage (bounded pilot) #405, Research: COVA-inspired targeted path-condition oracle for ownership soundness (bounded spike) #431, Research: evaluate Bifrost for C# code intelligence, agent navigation, and evidence contracts #426; no duplicate infrastructure.
- Small reviewed C# case inventory with source-level oracle, baseline, OwnIR and first-divergence evidence or documented early STOP if no eligible gap survives.
- A formal expressibility/distributivity table with counterexamples and honest may/must/unknown/exception limitations.
- Conditional tiny differential prototype only if justified, with exact reproducible commands and baseline-versus-reference output.
- Adversarial tests for missing calls, cut-off traversal, summary/join/context handling; no unsupported safety claims.
- Per-case practical utility and cost, and a final explicit GO/NO-GO disposition.
Non-goals / guardrails
No Java/Heros dependency in Own.NET, no SootUp/Jimple port, no new C# frontend, no generic IFDS/IDE or whole-program points-to platform, no wholesale ownership lattice rewrite, no reopening frozen lifecycle scope (#304), no changes to production diagnostics or default CI. Any implementation work must be independently justified by a real semantic failure, not elegance.
References
- Heros repository
- Heros
IDESolver - Heros
JumpFunctions - Heros
FlowFunctions - Related design-context work: Research: SootUp-inspired OwnIR/ICFG semantic-fidelity and incomplete-call audit (bounded spike) #430 and Research: WALA-inspired demand-driven alias precision for ownership diagnostics (bounded spike) #429
Desired outcome: a falsifiable answer about whether IFDS/IDE fixes an actual Own.NET interprocedural correctness gap. If it finds no additional real bug or precision/soundness defect, STOP; a more sophisticated solver is not itself progress.
Activity