Repository navigation
Conversation
There was a problem hiding this comment.
Reviewed the MIP-7 EXTENSION (0xAE) decode against the traits system, the compiler/interpreter decode paths, and the stated MIP-7 semantics.
What was checked:
- Traits:
mip_7_active()is correctly added to theTraitsconcept and to bothEvmTraits(alwaysfalse) andMonadTraits(Rev >= MONAD_NEXT); the opcode table entry is gated withwhen(...)and the interpreter entry withavail(...), so0xAEstays invalid everywhere beforeMONAD_NEXT. No explicit-instantiation macros are involved (header templates only), and the trait instantiation CI check passes. - Decode consistency: compiler and interpreter agree for every reachable case — trailing
0xAEhalts exceptionally in both (scan_extensionbounds check;instr_ptr + 1 < code() + size()in the interpreter, which is correct against the unpadded size), and an unassigned selector is invalid without being consumed, so0xAE 0x5Bkeeps itsJUMPDESTin both the compiler's block scan and the interpreter's unchangedfind_jumpdests. The compile-time guard keepingJUMPDEST/PUSHnselectors unassigned is exactly what keeps the two jumpdest analyses equivalent once selectors are assigned. - C++ correctness: the
Instructionconstructor argument order matches,index()'s assert and the formatter are updated,MONAD_ABORT()in the x86 emitter'sExtensioncase is[[noreturn]]and unreachable while the selector table is empty, and the interpreter dispatch preserves must-tail discipline (MONAD_VM_MUST_TAILwith the table lookup done before the call). - Tests: the typed test matrix includes
MONAD_NEXT(MIP-7 active) as well as all pre-NEXT revisions, and the three tests cover invalid selectors, jumpdest preservation/consumption, and trailing0xAE, on both interpreter and compiler. - PR hygiene: single commit, no merge commits; CI green on everything completed so far, including the compiler test suite.
Two non-blocking [P3] suggestions posted inline, both about hardening the future selector-assignment path: a consteval cross-check that the compiler and interpreter selector tables agree, and making the JUMPDEST/PUSHn guard asserts robust to assignments inserted after them.
Verdict: CORRECT
🤖 Generated with Claude Code
Baltoli
left a comment
There was a problem hiding this comment.
MIP-7 is pending spec tests, confirmation etc. - will review properly when we have that but let's not merge this just yet
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in revision gating, selector handling, or jump-destination preservation, with focused tests covering both engines.
0 open findings
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
2dbdbd9 to
6c67846
Compare
Decode MIP-7's EXTENSION (0xAE) and its selector byte in the interpreter and the compiler, active at MONAD_NEXT. No selector is assigned yet, so every extended opcode still behaves as INVALID. Unassigned and excluded selectors are not consumed, so JUMPDEST analysis is unchanged. A trailing 0xAE has no selector and halts exceptionally, as MIP-7 now requires (monad-crypto/MIPs#95). https://linear.app/category-labs/issue/EXE-232 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6c67846 to
e2adc5a
Compare
Implements the MIP-7
EXTENSION(0xAE) decode atMONAD_NEXT. No selector is assigned yet, so every extended opcode still behaves asINVALID. EXE-2320xAEdispatches on its selector through a second opcode table in the interpreter and the compiler. An unassigned or excluded selector isINVALIDand is not consumed, so0xAE 0x5Bkeeps itsJUMPDEST. A compile-time check keeps0x5BandPUSHnunassigned.0xAEhas no selector and halts exceptionally, as MIP-7 now requires (Update MIP-7, MIP-18: trailing 0xae monad-crypto/MIPs#95). That only changes behaviour once a selector is assigned; MIP-18 in MIP-18 (CALLSTACKDEPTH,CALLERN) #2621, stacked on this, covers it.🤖 Generated with Claude Code