Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # PrintAxioms.lean
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 828830e. Configure here.
| | some bits => | ||
| execForEachSetBitLoop varName | ||
| (fun loopState => execStmtListWithEvents fields events loopState body) | ||
| 256 state bits |
There was a problem hiding this comment.
Empty bitmap loop var unset
Medium Severity
Stmt.forEachSetBit lowering initializes the loop variable to literal zero before the loop, but execStmt enters execForEachSetBitLoop on the incoming state without binding that name. When the bitmap evaluates to zero, the loop never runs and the variable keeps any prior binding instead of zero, unlike Stmt.forEach and unlike emitted Yul.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 828830e. Configure here.
| \n### CI Failure Hints\n\nFailed jobs: `build`\n\nCopy-paste local triage:\n```bash\nmake check\nlake build\nFOUNDRY_PROFILE=difftest forge test -vv\n``` |


Summary
clz/msbexpression sugar backed by a new IR opcode (0x1e) with Yul loweringStmt.forEachSetBitplus macro syntax for iterating set bits of a word via MSB/CLZ-driven loop loweringexecForEachSetBitLoop_succrecurrence and agreement lemmasPropertyBitmapIteratorSmoke.t.solproperty test coverageCloses #1996
Test plan
lake build Verity Contracts Compiler PrintAxioms— Build completed successfullyscripts/refresh_verification_artifacts.sh— [refresh] PASSmake check— All checks passedNote
Medium Risk
Fork-dependent Yul (Osaka CLZ vs fallback) affects codegen correctness on wrong targets; large touch surface across compiler validation and proof modules increases regression risk despite smoke tests.
Overview
Introduces
Stmt.forEachSetBitand macroforEachSetBitto walk set bits in a word (MSB→LSB), withclz/msbexpression sugar (Osakaverbatim_1i_1o0x1e) and stdlibclz/msbhelpers.Statement compilation is refactored to
compileStmtWithFork/compileStmtListWithForkwith atargetForkargument threaded fromcompile, constructors, internals, and externals (fixingcompileValidatedCoreto pass fork through). Osaka+ lowersforEachSetBitvia CLZ and a captured bit mask for safe body clears; pre-Osaka uses a descending index scan loop—covered byBitmapIteratorForkSmoke.execForEachSetBitLoopsemantics and denote agreement lemmas are added; validation, usage analysis, trust surface, CEI, and IR-generation proofs are extended for the new stmt. Smoke contractBitmapIteratorSmokeandPropertyBitmapIteratorSmoke.t.solstub tests are included.Reviewed by Cursor Bugbot for commit 828830e. Bugbot is set up for automated code reviews on this repo. Configure here.