Skip to content

proof(ir): nonreentrant guard prologue semantics (lane 2.2 step 2) - #2262

Merged
Th0rgal merged 1 commit into
mainfrom
feat/2087-guard-ir-lemmas
Aug 12, 2026
Merged

proof(ir): nonreentrant guard prologue semantics (lane 2.2 step 2)#2262
Th0rgal merged 1 commit into
mainfrom
feat/2087-guard-ir-lemmas

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Aug 12, 2026

Copy link
Copy Markdown
Member

Machine-checks the compiled side of the guard begun in #2261: the exact prologue if eq(tload(slot),1) { revert } ; tstore(slot,1) and the spliced release tstore(slot,0) are evaluated under the IR-generation interpreter (execIRStmts/execIRStmt), proving locked-entry revert (state untouched), free-entry acquire (nothing else changed), release reset with extensional acquire/release round-trip, decision agreement with NonReentrantGuard.guarded on reachable binary lock values, and the emitted-shape pin nonReentrantGuardPrologue_eq.

Remaining for the full noNonReentrant lift (documented in TRUST_ASSUMPTIONS.md): threading through attachNonReentrantGuard/compileGuardedFunctionSpec and compile_preserves_semantics — blocked mainly by spliceLockRelease/yulFrameHalts being partial def.

Validation: full lake build (2468 jobs) OK, make check all passed, PrintAxioms regenerated, no sorry/admit/new axiom.


Note

Low Risk
Additive Lean proofs and trust-doc updates only; no compiler or runtime behavior changes, and no new axioms or sorry.

Overview
Adds the first machine-checked IR-side brick for the nonreentrant guard: the exact prologue/release Yul statements are now evaluated under execIRStmts/execIRStmt.

NonReentrantGuardIR pins the emitted prologue shape and proves locked entry reverts with state untouched, free entry acquires the lock only, the spliced release resets it (acquire/release round-trips transient storage), and Yul eq(lock,1) agrees with the source model's lock ≠ 0 on binary lock values.

Updates TRUST_ASSUMPTIONS.md accordingly: statement-level IR facts are proved; threading through attachNonReentrantGuard / compile_preserves_semantics and lifting noNonReentrant remain trusted. Registers the six new theorems in PrintAxioms (+6 public, 0 sorry).

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

…eter (lane 2.2 step 2)

Prove the exact statements emitted by nonReentrantGuardPrologue and the
spliced lock release under execIRStmts/execIRStmt:
- locked entry (tload = 1) reverts with the state untouched;
- free entry acquires the lock and changes nothing else;
- the release resets the slot; acquire+release round-trips the
  transient store extensionally;
- the Yul decision eq(lock,1) agrees with the source model's lock != 0
  on reachable binary lock values (guard_decision_agrees);
- nonReentrantGuardPrologue_eq pins the emitted shape.

TRUST_ASSUMPTIONS.md updated; PrintAxioms regenerated.
@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 1:08pm

Request Review

@Th0rgal
Th0rgal merged commit 4c0ba92 into main Aug 12, 2026
4 of 5 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_fbf9575e-c22e-4104-b145-2ff2753b8440)

@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