Repository navigation
Description
Classification
P3 / bounded research / REUSE-FIRST / KILL-FIRST / READ-ONLY / NOT ADOPTED. No production code, dependency, IR rewrite, CI change, or automatic diagnostic policy change is authorized by this issue.
- Upstream: bloomberg/crane (pinned fa5becc63281, checked 2026-11-22).
- Full research Page.
- Related, not replaced: Research: independent formal cross-check and Rust-level soundness verification (Rocq / Verus / Aeneas / Isabelle) #451 (formal cross-check), Research: Cilica-style analysis invalidation and pass verification for OwnIR (bounded spike) #456 (pass/invariant verification), Research: Wa wire IR / ARC lowering for explicit ownership events in OwnIR #441 (explicit ownership events), Research: evaluate LLZK dataflow lattices, SourceRef and IR validators #444 (IR validators), Research: SootUp-inspired OwnIR/ICFG semantic-fidelity and incomplete-call audit (bounded spike) #430 (Roslyn→OwnIR semantic fidelity), Research: semantic mutation testing harness for Own.NET analyzer coverage (bounded pilot) #405 (mutation/testing).
Narrow research question
Can one existing Own.NET ownership or lifetime diagnostic become more reliable or easier to audit by borrowing a small, testable mechanism from Crane's ownership planning + independently checked lowering contracts, without transplanting Rocq/C++ ownership semantics into C#?
Crane extracts verified Rocq programs into C++ but its extractor is not formally verified: source theorem, extraction equivalence, final C++ behavior and external effect implementations have distinct trust boundaries. It is an architecture donor, not a production-proven ownership checker for C#.
Specific upstream mechanisms to inspect
src/ownership_ir/region.mli: region-level last-use analysis, move/copy/borrow decisions, order-of-evaluation, captures, recursion frames, reuse tokens.src/ownership_ir/move_check.mli: independent validation of moved-read, stale-reference and argument convention after C++ IR lowering (CRANE_CHECK_IR).src/cpp_passes/pipeline.ml: explicit representation obligations and traced pre-/post-materialization passes;src/control_to_cpp/loopify.ml: recursion-to-loop/frame lowering.- Generated typed AST C++ and reuse example as concrete checks of emitted behavior.
- Design principles: explicit pragmatic trust, compiler/extractor correctness via empirical differential/static testing.
Overlap / preflight gate
- Pin Own.NET HEAD; inspect current Roslyn→OwnIR lowering, Rust transfer/join, evidence model, validators, and test harness; do not assume missing capabilities based on older context.
- First read Research: independent formal cross-check and Rust-level soundness verification (Rocq / Verus / Aeneas / Isabelle) #451, Research: Cilica-style analysis invalidation and pass verification for OwnIR (bounded spike) #456, Research: Wa wire IR / ARC lowering for explicit ownership events in OwnIR #441, Research: evaluate LLZK dataflow lattices, SourceRef and IR validators #444, Research: SootUp-inspired OwnIR/ICFG semantic-fidelity and incomplete-call audit (bounded spike) #430 and Research: semantic mutation testing harness for Own.NET analyzer coverage (bounded pilot) #405. If each valuable Crane mechanism is already covered by a current issue or code, report ALREADY COVERED and close this issue with references rather than creating a competing investigation.
- Keep distinctions explicit: C++ object movement and ARC/reference counting are not equivalent to C# GC, IDisposable disposal, borrow lifetimes, exceptional cleanup, or async state machines.
Bounded experiment (read-only by default)
- Make a compact map of at most 3 upstream mechanisms:
Crane source/test → Own.NET current equivalent → plausible uncovered invariant → impact on a named diagnostic. - Choose one real, existing Own.NET high-value diagnostic/fixture with a plausible gap; compare existing baseline to one tiny conceptual post-lowering invariant or a last-use/borrow decision check.
- Use positive + negative controls. The negative case must actually break the putative invariant, not merely be another accepted path. Include branch/alias/reassign/closure/exception cases only insofar as the chosen diagnostic already models them.
- Distinguish evidence of correct IR lowering from evidence of sound resource analysis and from production guarantee. Unmodeled behavior remains UNKNOWN, never SAFE.
- Record implementation complexity, runtime/test overhead and duplicates with existing Research: independent formal cross-check and Rust-level soundness verification (Rocq / Verus / Aeneas / Isabelle) #451/Research: Cilica-style analysis invalidation and pass verification for OwnIR (bounded spike) #456/Research: Wa wire IR / ARC lowering for explicit ownership events in OwnIR #441; do not run a new proof stack, compile Crane into Own.NET, or ship diagnostics.
Deliverables / acceptance
- One pinned
Crane mechanism | source/tests | Own.NET counterpart | demonstrated gap? | cheapest counterexample | verdictevidence table. - A reproducible counterexample or a documented NO-GAP result, with matching positive control.
- Verdict BORROW SMALL IDEA / DEFER / REJECT / DUPLICATE. No follow-up code without a separate issue anchored in a failing test and measurable benefit.
Non-goals: formal verification of all Own.NET, new Rocq-to-C++ toolchain, C++/Rust ownership semantic equivalence, rewriting OwnIR or claiming that CRANE_CHECK_IR formally proves compiler correctness.
Activity