Skip to content

proof(ir): attachNonReentrantGuard correctness (lane 2.2 semantic closure) - #2297

Merged
Th0rgal merged 1 commit into
mainfrom
proof/2087-attach-correct
Aug 12, 2026
Merged

proof(ir): attachNonReentrantGuard correctness (lane 2.2 semantic closure)#2297
Th0rgal merged 1 commit into
mainfrom
proof/2087-attach-correct

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Aug 12, 2026

Copy link
Copy Markdown
Member

The transformation-level correctness statement: attachNonReentrantGuard_exec composes the output-shape pin (#2275) with the full guarded-function composition (#2296) — for any annotated function with the standard genParamLoads ++ body compiled shape, the transformed body provably executes as guarded: bind, check, acquire, run, release. This closes the semantic content of the noNonReentrant lift; what remains is integration plumbing (consuming this from the whole-contract preservation theorems), which is additive engineering with no new proof obstacles.

Validation: full lake build OK, make check all passed, no sorry/admit/new axiom.


Note

Low Risk
Proof-only change in Lean formal verification; no runtime compiler or contract behavior is modified.

Overview
Adds attachNonReentrantGuard_exec, a formal correctness theorem for the post-compilation non-reentrant guard transform: when attachNonReentrantGuard succeeds on a function whose IR body is genParamLoads ++ bodyStmts, executing the guarded body matches the intended guarded semantics (bind params, revert if lock held, else acquire lock, run body, release on success).

The proof is a thin composition: attachNonReentrantGuard_some_shape pins the transformed body shape, then execIRStmts_guardedFunction_fallthrough supplies the execution equivalence. The theorem is registered in PrintAxioms.lean (theorem count 6249 → 6250).

Reviewed by Cursor Bugbot for commit 641ad7e. Bugbot is set up for automated code reviews on this repo. Configure here.

attachNonReentrantGuard_exec: for an annotated function whose compiled
body has the standard loads-then-body shape, the transformed function's
body executes exactly as the guarded composition — locked entry reverts
after binding, free entry runs the body from the acquired bound state
with successful outcomes released. Composes the shape pin (#2275) with
the full function composition (#2296); the semantic content of the
noNonReentrant lift is now complete, leaving only the whole-contract
integration plumbing.
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
verity Ready Ready Preview Aug 12, 2026 4:57pm

Request Review

@Th0rgal
Th0rgal merged commit 9a6715b into main Aug 12, 2026
1 of 2 checks passed
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_6feade1a-7e0f-4e86-a77e-e00c02890c99)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenCodeReview first-pass review

OCR did not run — this diff has no OCR-supported files. Not a review outcome.

No changed files matched OCR include rules.

OCR pilot metrics & packet coverage

OCR pilot metrics

  • Routing: no-supported (router-v10)
  • Changed files: 0 supported / 0 total; Lean 0, trust docs 0, workflow/scripts 0, contracts 0, docs 0
  • Changed lines: 0 supported; thresholds large Lean >=3 files or >800 lines
  • OCR: status no-supported; comments 0; files 0; tokens 0; tool calls 0; warnings 0; duration 0s

Pilot mode: advisory only. Codex Review remains the merge gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant