Skip to content

build: document opt-level=z + CGU=1 miscompile and CGU>=2 alternative#762

Merged
ch4r10t33r merged 4 commits into
mainfrom
fix/cargo-profile-codegen-units-note
Apr 20, 2026
Merged

build: document opt-level=z + CGU=1 miscompile and CGU>=2 alternative#762
ch4r10t33r merged 4 commits into
mainfrom
fix/cargo-profile-codegen-units-note

Conversation

@ch4r10t33r
Copy link
Copy Markdown
Contributor

Summary

Docs-only follow-up to #759. Expand the [profile.openvm-release] / [profile.risc0-release] comments in rust/Cargo.toml with the narrowed root cause from a bisection session on x86_64 Linux (rustc 1.95, AMD EPYC-Genoa + GitHub runners) and cross-reference the upstream issue.

Key findings now captured in-file:

  • The miscompile requires the combination opt-level = "z" AND codegen-units = 1. Either change alone clears it.
  • Faulting code is lean_vm::tables::utils::eval_virtual_bus_column once inlined into lean_prover::prove_execution — a stack reload of a spilled AVX2 lane inside a 16-YMM-register-live basic block.
  • The comment now lists the three bisected combinations so a future reader can immediately see the alternative (opt-level = "z" + codegen-units >= 2) if they ever want to revisit z for binary-size reasons.
  • Added a cross-reference to the upstream issue leanEthereum/leanMultisig#198 alongside the existing risc0: prove_execution crashes with GPE in xmss_aggregate during CI #734 reference.

No code/config values changed — profile keys and values are byte-identical to main. Diff is 14 lines of comment text.

Test plan

  • cargo fmt --manifest-path rust/Cargo.toml --all -- --check clean
  • cargo clippy --manifest-path rust/Cargo.toml --workspace -- -D warnings clean
  • cargo metadata --manifest-path rust/Cargo.toml --no-deps parses without error
  • Local zig fmt --check pkgs build.zig clean
  • CI green (docs-only change; expect no regression from build, multisig-glue: bump prover profile opt-level from z to s (#734) #759's shipped workaround)

ch4r10t33r and others added 3 commits April 18, 2026 04:21
Expand the risc0/openvm profile comments with the narrowed root cause from
bisection on x86_64 Linux (rustc 1.95): the miscompile requires both
opt-level="z" AND codegen-units=1, with the faulting code in
eval_virtual_bus_column's inlined SIMD fold. Either mitigation alone
suffices; we keep opt-level="s" + CGU=1 for single-CGU size optimization.

Cross-reference the upstream issue leanEthereum/leanVM#198 so future
readers can follow the investigation and any eventual rustc/LLVM fix.
@ch4r10t33r ch4r10t33r merged commit 7f7f57e into main Apr 20, 2026
9 checks passed
@ch4r10t33r ch4r10t33r deleted the fix/cargo-profile-codegen-units-note branch April 20, 2026 10:00
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