Skip to content

proof: bridge mappingPackedWord source reads (parallel/experimental)#2127

Open
Th0rgal wants to merge 1 commit into
paloma/issue-2080-whole-contract-retarget-phase30from
paloma/parallel-claude-fragment-2081
Open

proof: bridge mappingPackedWord source reads (parallel/experimental)#2127
Th0rgal wants to merge 1 commit into
paloma/issue-2080-whole-contract-retarget-phase30from
paloma/parallel-claude-fragment-2081

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Jul 9, 2026

Copy link
Copy Markdown
Member

Parallel / experimental fragment slice

Do not merge into the #2080 review stack gate. This is an independent, parallel proof-fragment expansion opened off the current stack tip (paloma/issue-2080-whole-contract-retarget-phase30, currently under review as #2126). It is intended to advance the proven fragment without blocking or reordering the #2122#2124#2126 drain.

Summary

Widens the native-safe source-expression read grammar (BridgedSourceExpr) to cover packed mapping-word reads (Expr.mappingPackedWord). These lower to and(shr(lit offset, mappingSlotRead), lit mask) — the exact bridged shape already proven for packed struct-member reads (structMember) and packed storage reads.

  • New constructor BridgedSourceExpr.mappingPackedWord.
  • New case in compileExpr_bridgedSource, discharged with the pre-existing compileMappingSlotRead_bridged and bridgedExpr_packed_read lemmas (no new supporting lemmas needed).
  • New case in compileRequireFailCond_bridgedSource via the default (non-comparison) path.
  • Doc sync in the module header and inductive docstring (mappingPackedWord moved from out-of-scope to in-scope).

What this is NOT

This does not flip the state-surface gate: mappingPackedWord remains marked unsupported in exprTouchesUnsupportedStateSurface. This PR only widens the read-bridge grammar — a building block toward later removing mappingPackedWord from that gate. No existing theorem is weakened; no check is disabled.

Validation (lean-slot / DGX Spark offload)

  • lake build Compiler.Proofs.YulGeneration.Backends.EvmYulLeanSourceExprClosure → green (exit 0).
  • lake build PrintAxioms → green (exit 0), full elaboration, sorryAx count 0.
  • #print axioms compileExpr_bridgedSource[propext, Quot.sound]
  • #print axioms compileRequireFailCond_bridgedSource[propext, Quot.sound]

No new sorry / admit / axiom / native_decide. Diff is +36 / -4, single file.


Note

Low Risk
Single-file Lean proof extension reusing established packed-read lemmas; no compiler behavior, auth, or gate changes.

Overview
Extends the BridgedSourceExpr read grammar so Expr.mappingPackedWord is in scope, with module docs updated to list it alongside other mappingSlot bridges instead of treating packed mapping reads as unsupported in this fragment.

compileExpr_bridgedSource gains a case that follows the packed structMember pattern: compile the key, run compileMappingSlotRead, then wrap the slot word with bridgedExpr_packed_read using existing compileMappingSlotRead_bridged lemmas (no new helper theorems). compileRequireFailCond_bridgedSource adds the matching constructor and routes it through the default iszero(cond) path.

This is proof-only widening of the bridged compile closure; it does not change exprTouchesUnsupportedStateSurface or relax runtime/state-surface gates.

Reviewed by Cursor Bugbot for commit abbf8d5. 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 9, 2026 9:50am

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_6b58932e-f287-4bea-8866-68ac2ae26ea2)

@github-actions

github-actions Bot commented Jul 9, 2026

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 9, 2026

Copy link
Copy Markdown
Member Author

Review status: merge blocked only on still-running CI (runner queue)

Reviewed the diff (single commit 5c7d97d, EvmYulLeanSourceExprClosure.lean +36/−4): widens BridgedSourceExpr with mappingPackedWord plus matching cases in compileExpr_bridgedSource and compileRequireFailCond_bridgedSource. Stack relationship verified: base = paloma/issue-2080-whole-contract-retarget-phase30 (head of #2126), no unrelated stack changes. No new sorry/admit/axiom/native_decide. No unresolved review threads (Bugbot skipped: usage limit).

Local validation (warm cache, at PR head 5c7d97d):

  • lake build Compiler.Proofs.YulGeneration.Backends.EvmYulLeanSourceExprClosure
  • python3 scripts/lean_lint.py --only lean_hygiene ✅ (0 sorry / 0 native_decide)
  • python3 scripts/check_compiler_boundaries.py

CI: original checks failure was an infra SIGTERM (exit 143) mid-make check; re-run passed. In run 29003411005, 15/17 jobs are green (incl. checks, builds, compiler-audits/regressions, foundry-patched/multi-seed/gas-calibration) and probe (EVMYulLean fork conformance) is green. Remaining blocker: foundry (2) and foundry (3) are still queued awaiting runner capacity.

Will merge once those two shards complete green under the standing merge policy.

Widen the native-safe source-expression read grammar to cover packed
mapping-word reads (`Expr.mappingPackedWord`). These lower to
`and(shr(lit offset, mappingSlotRead), lit mask)`, exactly the shape
already discharged for packed struct-member and packed storage reads.

- Add `BridgedSourceExpr.mappingPackedWord` constructor.
- Prove the corresponding case in `compileExpr_bridgedSource` using the
  existing `compileMappingSlotRead_bridged` and `bridgedExpr_packed_read`
  lemmas.
- Handle the constructor in `compileRequireFailCond_bridgedSource` via the
  default (non-comparison) path.
- Sync module/inductive docs (mappingPackedWord now in scope).

No gate flip: `mappingPackedWord` remains on the state-surface gate; this
is a building block toward removing it. Both theorems depend only on
[propext, Quot.sound]; no new sorry/admit/axiom.
@Th0rgal Th0rgal force-pushed the paloma/parallel-claude-fragment-2081 branch from 5c7d97d to abbf8d5 Compare July 9, 2026 09:50
@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_03ef24dc-6530-484e-82b2-27cbbe097e59)

@Th0rgal

Th0rgal commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/ocr review

@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: skipped · 0 finding(s) · files unknown · 0 tool calls

No supported files changed.

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

@Th0rgal

Th0rgal commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/ocr review

@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) · 1 files · 191243 tokens · 15 tool calls

No comments generated. Looks good to me.

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

@Th0rgal

Th0rgal commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/ocr review

@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) · 1 files · 239521 tokens · 16 tool calls

No comments generated. Looks good to me.

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

@Th0rgal

Th0rgal commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/ocr review

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

⚠️ OpenCodeReview failed to produce valid JSON.

No stderr captured.

@Th0rgal

Th0rgal commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/ocr review

@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: small-lean · 0 finding(s) · 1 files · 560563 tokens · 28 tool calls

No comments generated. Looks good to me.

OCR pilot metrics

  • Routing: small-lean (router-v3)
  • Changed files: 1 supported / 1 total; Lean 1, trust docs 0, workflow/scripts 0, contracts 0, docs 0
  • Changed lines: 40 supported; thresholds large Lean >=3 files or >800 lines
  • OCR: status success; comments 0; files 1; tokens 560563; tool calls 28; warnings 0; duration 465s
  • Largest changed files: Compiler/Proofs/YulGeneration/Backends/EvmYulLeanSourceExprClosure.lean (+36/-4)

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

@Th0rgal

Th0rgal commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/ocr review

@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: small-lean · 0 finding(s) · 1 files · 192286 tokens · 20 tool calls

No comments generated. Looks good to me.

OCR pilot metrics

  • Routing: small-lean (router-v4)
  • Changed files: 1 supported / 1 total; Lean 1, trust docs 0, workflow/scripts 0, contracts 0, docs 0
  • Changed lines: 40 supported; thresholds large Lean >=3 files or >800 lines
  • OCR: status success; comments 0; files 1; tokens 192286; tool calls 20; warnings 0; duration 195s
  • Largest changed files: Compiler/Proofs/YulGeneration/Backends/EvmYulLeanSourceExprClosure.lean (+36/-4)

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

@Th0rgal

Th0rgal commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

/ocr review

@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: small-lean · 0 finding(s) · 1 files · 137565 tokens · 12 tool calls

No comments generated. Looks good to me.

OCR pilot metrics

  • Routing: small-lean (router-v8)
  • Changed files: 1 supported / 1 total; Lean 1, trust docs 0, workflow/scripts 0, contracts 0, docs 0
  • Changed lines: 40 supported; thresholds large Lean >=3 files or >800 lines
  • OCR: status success; comments 0; files 1; tokens 137565; tool calls 12; warnings 0; duration 196s
  • Largest changed files: Compiler/Proofs/YulGeneration/Backends/EvmYulLeanSourceExprClosure.lean (+36/-4)

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