Skip to content

proof: expose helper IR mapping-write slot-safety seam#2132

Merged
Th0rgal merged 4 commits into
mainfrom
paloma/parallel-codex-fragment-2081
Jul 11, 2026
Merged

proof: expose helper IR mapping-write slot-safety seam#2132
Th0rgal merged 4 commits into
mainfrom
paloma/parallel-codex-fragment-2081

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Exposes compile_preserves_semantics_except_mapping_writes_and_helper_ir_globalSlotSafety, a helper-IR mapping-write whole-contract seam using the existing global slot-safety hypotheses.
  • Adds the theorem to PrintAxioms.lean and records both mapping-write helper-IR variants in the Layer 2 boundary catalog.

Base

Validation

  • lean-slot lake env lean Compiler/Proofs/IRGeneration/Contract.lean
    • Spark offload refused this sibling worktree path with HTTP 403, then lean-slot fell back to local validation and passed.
  • python3 scripts/generate_layer2_boundary_catalog.py --check
  • python3 scripts/generate_print_axioms.py --check
  • python3 scripts/lean_lint.py --only axioms
  • git diff --check

Notes

  • Adds no sorry, admit, or project-level axiom.

Note

Low Risk
Lean proof and catalog/axiom inventory updates only; no runtime compiler behavior or trusted axioms added.

Overview
Adds compile_preserves_semantics_except_mapping_writes_and_helper_ir_globalSlotSafety, a whole-contract Tier 2 wrapper that matches the existing mapping-write semantics theorem but uses SupportedStmtListMappingWriteSlotSafety (global slot safety) and concludes over interpretIRWithInternals when a conservative-extension equality to interpretIR is assumed.

The proof is a thin simpa over compile_preserves_semantics_except_mapping_writes, parallel to the per-statement ..._and_helper_ir variant that still uses per-function StmtMappingWriteSlotSafe obligations.

PrintAxioms.lean lists the new theorem (public count 3888→3889). The Layer 2 boundary catalog generator and artifacts/layer2_boundary_catalog.json now name both mapping-write helper-IR theorem variants for tooling and reviewers.

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

@vercel

vercel Bot commented Jul 9, 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, Comment Jul 11, 2026 1:56am

Request Review

@cursor

cursor Bot commented Jul 9, 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_54329f69-ac41-447d-af02-96160069b791)

@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

Status: success · 0 finding(s) · 4 files · 124039 tokens · 20 tool calls

No comments generated. Looks good to me.

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

@Th0rgal

Th0rgal commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@cursor

cursor Bot commented Jul 10, 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_2e9f6f59-d03d-48c4-acd0-6d2ac3152c4a)

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview first-pass review

Status: scout_triage · Mode: large-lean-hotspots · 4 finding(s) · 3 files · 0 tokens · 0 tool calls

Large Lean diff routed to bounded packet review: 3 Lean file(s), 129 changed supported line(s). Scout model ranked 4/6 packet(s) for stronger review. Scout triage success; strong packet review required. Full-file OCR was not attempted.

⚠️ Large Lean scout mode covers ranked packets/checklists only; it is not a full-file OCR review and must not be read as LGTM.
✅ Posted 4 inline comment(s).
⚠️ 1 OCR warning(s) reported.

Warnings

  • coverage : Large Lean scout mode covers ranked hotspots only. Codex/human review must cover skipped hunks and proof obligations; OCR strong packet review is not wired yet.

OCR pilot metrics

  • Routing: large-lean-hotspots (router-v8)
  • Changed files: 5 supported / 5 total; Lean 3, trust docs 0, workflow/scripts 2, contracts 0, docs 0
  • Changed lines: 129 supported; thresholds large Lean >=3 files or >800 lines
  • OCR: status scout_triage; comments 4; files 3; tokens 0; tool calls 0; warnings 1; duration 31s
  • Largest changed files: Compiler/Proofs/IRGeneration/Function.lean (+0/-78), Compiler/Proofs/IRGeneration/Contract.lean (+36/-0), scripts/generate_layer2_boundary_catalog.py (+8/-0), PrintAxioms.lean (+2/-3), artifacts/layer2_boundary_catalog.json (+2/-0)

Packet coverage

  • Packet review: enabled; selected 4/8 packet(s)
  • Scout: configured; status success; model reviewer_scout
  • Strong review: required; status blocked_packet_input
  • Residual risk: Triaged top 4 scout-ranked packet(s); remaining changed hunks/files require Codex or human proof review, and selected packets still need strong reviewer analysis.
  • Strong packet-review blocker: OpenCodeReview 1.7.5 supports --from/--to full diff ranges, but this workflow does not have a safe packet/window input bridge for Lean hunks yet.
  • Covered packets:
    • Compiler/Proofs/IRGeneration/Contract.lean:2589 score 65 — public declaration/signature changed; ask: Walk the proof body of this new theorem and confirm: (a) no sorry/admit/root.Classical.*, (b) no external axioms introduced, (c) every additional premise (hnoConflict, hsafety, htxNormalized, hcalldataSizeFits, helper-ir globalSlotSafety) is actually discharged for interpretIRWithInternals, and (d) it is logically equivalent (or strictly stronger) to the union of compile_preserves_semantics_except_mapping_writes_stmtSafety + compile_preserves_semantics_except_mapping_writes_and_helper_ir that
    • Compiler/Proofs/IRGeneration/Function.lean:3489 score 65 — public declaration/signature changed; ask: Grep the repo for any remaining reference to stmtList_setStructMember2Single_compiledLegacyCompatible outside the deleted block (including in Contract.lean, IRGenerationHelpers, CallSites, TranslateCoroutines, etc.); confirm none remain. Also confirm the new Theorem in Contract.lean (pkt-1) genuinely subsumes this statement for the setStructMember2 singleton case, especially regarding LegacyCompatibleExternalStmtList.
    • Compiler/Proofs/IRGeneration/Function.lean:3355 score 32 — hotspot path/churn; ask: Verify that no surviving public statement in Compiler/Proofs/IRGeneration silently required compileSetStructMember2_legacyCompatible (search for compileSetStructMember2 in surrounding goals / @[ext] / structure fields); confirm that the helper-ir-aware code path in Contract.lean (pkt-1) does not implicitly inherit a missing LegacyCompatibleExternalStmtList proof for setStructMember2.
    • PrintAxioms.lean:1916 score 12 — hotspot path/churn; ask: Re-run the PrintAxioms style audit specifically on the new theorem name (and its compile_preserves_semantics_except_mapping_writes_and_helper_ir_globalSlotSafety proof in Contract.lean) to independently confirm zero axioms/sorry/constants. Cross-reference that the two entries removed in pkt-4 (compileSetStructMember2_legacyCompatible, stmtList_setStructMember2Single_compiledLegacyCompatible) actually disappear from the compiled catalog.

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

⚠️ Inline publication failed, so OCR findings are summarized here instead.

Inline findings that could not be posted

  • Compiler/Proofs/IRGeneration/Contract.lean:2624 — Large Lean packet selected for stronger review: public declaration/signature changed; 36 changed line(s) near Compiler/Proofs/IRGeneration/Contract.lean:2589.
  • Compiler/Proofs/IRGeneration/Function.lean:3489 — Large Lean packet selected for stronger review: public declaration/signature changed; 28 changed line(s) near Compiler/Proofs/IRGeneration/Function.lean:3489.
  • Compiler/Proofs/IRGeneration/Function.lean:3355 — Large Lean packet selected for stronger review: hotspot path/churn; 50 changed line(s) near Compiler/Proofs/IRGeneration/Function.lean:3355.
  • PrintAxioms.lean:1916 — Large Lean packet selected for stronger review: hotspot path/churn; 1 changed line(s) near PrintAxioms.lean:1916.
Unprocessable Entity: "Path could not be resolved and Path could not be resolved"

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 181d20364f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Th0rgal

Th0rgal commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@cursor

cursor Bot commented Jul 10, 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_83c6d31e-66ed-47a6-a8aa-046e37c63d49)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: fc5e41446a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@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

Status: success · Mode: medium-lean · 0 finding(s) · 4 files · 175482 tokens · 25 tool calls

No comments generated. Looks good to me.

OCR pilot metrics

  • Routing: medium-lean (router-v8)
  • Changed files: 4 supported / 4 total; Lean 2, trust docs 0, workflow/scripts 2, contracts 0, docs 0
  • Changed lines: 49 supported; thresholds large Lean >=3 files or >800 lines
  • OCR: status success; comments 0; files 4; tokens 175482; tool calls 25; warnings 0; duration 272s
  • Largest changed files: Compiler/Proofs/IRGeneration/Contract.lean (+36/-0), scripts/generate_layer2_boundary_catalog.py (+8/-0), PrintAxioms.lean (+2/-1), artifacts/layer2_boundary_catalog.json (+2/-0)

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

@Th0rgal

Th0rgal commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: fc5e41446a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

Copy link
Copy Markdown
Contributor
\n### CI Failure Hints\n\nFailed jobs: `checks`\n\nCopy-paste local triage:\n```bash\nmake check\nlake build\nFOUNDRY_PROFILE=difftest forge test -vv\n```

@Th0rgal

Th0rgal commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

@codex review

@cursor

cursor Bot commented Jul 11, 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_4b59e1e2-7e98-4dfd-afba-acb5c617c610)

@Th0rgal

Th0rgal commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: fc860c4647

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@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

Status: success · Mode: medium-lean · 0 finding(s) · 4 files · 146004 tokens · 23 tool calls

No comments generated. Looks good to me.

OCR pilot metrics

  • Routing: medium-lean (router-v8)
  • Changed files: 4 supported / 4 total; Lean 2, trust docs 0, workflow/scripts 2, contracts 0, docs 0
  • Changed lines: 49 supported; thresholds large Lean >=3 files or >800 lines
  • OCR: status success; comments 0; files 4; tokens 146004; tool calls 23; warnings 0; duration 303s
  • Largest changed files: Compiler/Proofs/IRGeneration/Contract.lean (+36/-0), scripts/generate_layer2_boundary_catalog.py (+8/-0), PrintAxioms.lean (+2/-1), artifacts/layer2_boundary_catalog.json (+2/-0)

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

@Th0rgal
Th0rgal merged commit fc6dbf4 into main Jul 11, 2026
22 checks passed
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