Skip to content

jitv2: let IRIS_JIT_VERIFY turn the IR verifier back on - #381

Closed
jamesbraid wants to merge 3 commits into
techomancer:mainfrom
jamesbraid:jitv2-verifier-toggle
Closed

jamesbraid wants to merge 3 commits into
techomancer:mainfrom
jamesbraid:jitv2-verifier-toggle

Conversation

@jamesbraid

Copy link
Copy Markdown
Contributor

#377 turned Cranelift's IR verifier off outside unit tests and --features developer builds. A codegen bug in a release build then shows up as a miscompile or crash at run time instead of a verifier panic at compile time. IRIS_JIT_VERIFY=1 (or on) turns the verifier back on in any build, so a crash can be checked without rebuilding.

Also:

  • verifier_off_emits_the_same_code now compares verifier-on and verifier-off machine code for five page shapes instead of one: loads and stores of each width, FP, branch-likely, and a multi-block page with forward and backward branches.
  • The doc comment and CHANGELOG say exactly where the verifier runs. A Cargo profile named developer doesn't enable the feature, and integration tests and bins such as jitv2-verify run unverified unless the variable is set.
  • The CHANGELOG quotes the same boot timings as jitv2: compile without Cranelift's IR verifier #377's description.

Tested with cargo test --release --features jitv2 --lib and nextest (2388 passed), and cargo check --release --bins --tests with and without jitv2. Nothing tests the environment variable itself, because unit tests always run the verifier.

The verifier is off outside unit tests and developer builds, so invalid
IR from a codegen bug becomes a miscompile or a crash at run time rather
than a panic at compile time. Setting IRIS_JIT_VERIFY=1 (or "on") runs it
in any build, which lets someone holding a crash report get the clean
panic without rebuilding. Same values and caching as IRIS_JIT_CACHE.

The doc comment and CHANGELOG now say where it is on: a Cargo profile
named developer does not enable features, and integration tests and bins
such as jitv2-verify run unverified unless the variable is set.
The test compared the two builds on one page of word loads and stores.
The IR for narrow and 64-bit memory ops, FP ops, branch-likely, forward
and backward branches and jumps comes from different codegen paths, so
a flag that changed any of them would have gone unnoticed. Compile one
page of each and compare the machine code.
The entry gave x86 timings that appear nowhere else; the pull request
reports Fuel's boot to the login prompt in the loop and fast profiles.
Use those so the two agree.
@Samueltgg12

Copy link
Copy Markdown
Contributor

cool.

@jamesbraid

Copy link
Copy Markdown
Contributor Author

Folded into #379.

@jamesbraid jamesbraid closed this Oct 31, 2026
@jamesbraid
jamesbraid deleted the jitv2-verifier-toggle branch November 1, 2026 22:53
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.

2 participants