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
PhysShell commentedon Nov 28, 2026
2026-11-28 — borrIR and low-level ownership semantics (additional prior art)
RESEARCH / REUSE-FIRST / KILL-FIRST / NOT ADOPTED / NO IMPLEMENTATION AUTHORIZED. This is a donor for the existing post-lowering validator investigation, not a separate solver or an OwnIR rewrite.
77c25d347bd7f13414310a39e5caf153478d9917; commit not pinned), WASM playground. MIT per README. Author describes project as LLM-generated. Rust engine checks raw LLVM IR: CFG, pointer-root provenance through GEP/bitcast/phi/select, backward SSA liveness, forward fixed-point ownership analysis, function-local contracts, diagnostics and DOT export. README reports E0001–E0008 (move/free, alias conflicts, readonly writes, stack escape, mutation during borrow, leak, branch merge) and W0001 for lost provenance.noalias/readonlyare not Rust borrow semantics; check contract assumptions, unknown calls, integer round-trips, memory/field aliases and control-flow joins. A green checker is not proof of total memory safety, race freedom or semantic correctness.Bounded extension of #465, not a competing investigation: compare at most three mechanisms against current OwnIR and #441/#430/#444/#464/#468: (1) provenance through alias/phi/select vs resource identity; (2) last-use support and merge conflicts vs current transfer/join, especially one-branch disposal or ownership escape; (3) explicit lowered contracts and independent checker diagnostics vs existing method summaries and validator. Start with one existing C# IDisposable fixture, matching safe/unsafe controls, independently adjudicated expected behavior and unknown contract case. Distinguish GC lifetime from resource obligations, and explicit ownership from inferred effects. Reuse existing evidence table, pin source HEADs before execution. If no real uncovered invariant or nonduplicate counterexample: ALREADY COVERED / DEFER / KILL. No runtime or code changes. Source inspection only; no tests or upstream execution performed.