Skip to content

Research / REGEX-BORROW-01: Lean-Move regexp field paths, algorithmic checker and real C# ownership gap (kill-first) #468

Backlog

Description

@PhysShell

Classification

RESEARCH / P3 / REUSE-FIRST / KILL-FIRST / SOURCE-PINNED / READ-ONLY PREFLIGHT / NOT ADOPTED / NO PRODUCTION IMPLEMENTATION AUTHORIZED (2026-11-24).

Primary source: Tracking Borrows with Regular Expressions, OOPSLA 2026 · ilyasergey/lean-move · metatheory.md · OOPSLA 2026 evaluated artifact branch · Zenodo DOI · Research Page.

Distinct hypothesis

Does regex-path reachability / Brzozowski derivatives + emptiness give a measurable, genuine C# field-sensitive borrow/alias precision gain that existing Own.NET identity, field summaries and #438 SPDS field-stack reachability do not already provide, without breaking soundness/completeness and without adopting a Move verifier or new proof platform? Start from one independently verified Own.NET false positive/negative. If none, KILL.

Verified upstream architecture

  • MoveLight = deliberately simplified Move ANF-like language, not C# or full deployed Move: metatheory maps language, small-step operational semantics, relational type system, algorithmic decidable checker and formal proof.
  • Regex paths summarize unbounded borrow paths, derivatives implement edge transfer, regex emptiness detects forbidden reference reachability. Structural path analysis, not independent proof of actual C# aliasing through external calls/reflection/dynamic invocation or arbitrary GC.
  • Lean relational/algorithmic checker correspondences: type_soundness, check_fun_dec_sound, progress/preservation; 8 preventable errors ruled out from 13 modeled error categories with explicit assumptions; 5 acceptable errors remain (incl. out-of-fuel, abort, vector/variant errors). Not universal no-error or termination theorem.
  • Scope excludes generics, Move global storage, advanced abilities and arbitrary unmodeled calls; 87 test files and 31 concrete kernel-checked safety certificates per authors' artifact guide.
  • Crucial gap: artifact Rust↔Lean correspondence explicitly says Lean checks supplied block environments while actual Sui Rust checker infers them via CFG/fixpoint; the full Rust implementation is not proven equivalent to Lean. Pinned Sui commit ab36f2fea373075f42ffb158aaf37b66e4b68fc6.
  • Cost: paper's production regex checker is on average ~2.2× slower than the old graph-based one (~30µs/function on 2.9M functions, Apple M1 Max per upstream Section 6), though it may be more expressive. Do not advertise speedup or apply numbers to C#.
  • Artifact branch supplies ARTIFACT.md reviewer checklist, STATUS.md requested badges and metatheory.md; we did not independently build it. Clean proof is sorry/project-axiom free but uses standard Lean propext, Classical.choice, Quot.sound. Assumptions are stated in theorem.

Existing owners: no duplicates

Gate 0 — kill first, read-only

  1. Pin actual Own.NET SHA, Roslyn→OwnIR schema and production Rust ownership transfers; select one independently reviewed FP/FN caused by field-path depth/alias graph imprecision, not missing source lowering or invalid test oracle.
  2. Draw the semantic correspondence for that C# case: reference identity, field path alphabet, stores/loads, alias may/must, object identity vs Move reference restrictions, unknown callees, exceptions, callbacks, ref/out, arrays and dynamic dispatch. If unable to represent essentials faithfully, KILL, do not claim safety.
  3. Compare A: existing Own.NET + baseline, B: cheapest bounded-field/context query from Research: SPDS field-stack reachability for ownership aliasing (bounded spike) #438, C: theoretical regex path approach (simple source-agnostic model only) for the same minimal target. Budget time/memory; source/target semantics and unknowns must stay distinct.
  4. Negative mutants: missed alias after loop, false disjointness from branch join, stale path after field overwrite or resource release, escaped/reference-through-call paths, infeasible graph path promoted to realized witness, incomplete/timeout reported SAFE.
  5. Report precision vs true C# source behavior, p95/time/memory, algorithmic complexity/expressibility, actual extra coverage, and whether proof would be about source semantics or a toy model. If no distinct advantage, report ALREADY COVERED / KILL.

Conditional pilot (only after separate GO)

At most one test-only path-transfer prototype using fixtures and independent oracle from #438/#433. Reuse current Rust/OwnIR and reference tests rather than vendoring production Sui or a Lean VM. Do not change analyzer diagnostics/CI/dependencies in this issue.

Decision: REFERENCE ONLY / ALREADY COVERED / NARROW DESIGN / KILL. No blanket C# ownership theorem or release claim.

Cross-project

OOPSLA publication and evidence guide · Sergey overview · Velvet/Vermilion trust seams.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions