Skip to content

Research: Bloomberg Crane OwnershipIR and post-lowering move/borrow validators (kill-first) #465

Open

Description

@PhysShell

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.

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

  1. src/ownership_ir/region.mli: region-level last-use analysis, move/copy/borrow decisions, order-of-evaluation, captures, recursion frames, reuse tokens.
  2. src/ownership_ir/move_check.mli: independent validation of moved-read, stale-reference and argument convention after C++ IR lowering (CRANE_CHECK_IR).
  3. 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.
  4. Generated typed AST C++ and reuse example as concrete checks of emitted behavior.
  5. Design principles: explicit pragmatic trust, compiler/extractor correctness via empirical differential/static testing.

Overlap / preflight gate

Bounded experiment (read-only by default)

Deliverables / acceptance

  • One pinned Crane mechanism | source/tests | Own.NET counterpart | demonstrated gap? | cheapest counterexample | verdict evidence 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

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions