ci(vcr-oracle): CI-gate the RV32 immediate-shift-fold execution oracle (#472, #242)#489
Merged
Conversation
#472, #242) VCR-ORACLE-001's deliverable is CI-gating the differential oracles, not just shipping them as dev-time scripts. The RV32 immediate-shift-fold lever (#487, PR landed flag-off behind SYNTH_RV_SHIFT_FOLD) came with a unicorn UC_ARCH_RISCV differential (shift_fold_riscv_differential.py) but it only ran by hand. Since the lever sits flag-off awaiting the on-silicon flip, nothing else exercises the flag-on path — exactly the gap the cmp-select two-move oracle was added to close. Adds an isolated `rv32-shift-fold-oracle` CI job mirroring the existing `cmp-select-oracle` job: build synth, pip-install wasmtime+unicorn+pyelftools in that job ONLY (the main `cargo test` gate is not taxed with the C-library build graph), and run the differential. It executes every fixture function in BOTH flag states under unicorn and asserts bit-identical-to-wasmtime — continuously validating the slli/srli/srai folds, the `& 31` mask on >=32 and negative shift amounts, and the variable-shift non-fold, plus non-vacuity (.text 168B->148B, 5 folds). The differential now honors a SYNTH env override (default release for local dev; CI points it at the debug build for speed, like cmp-select). Frozen-safe: no codegen change, no emitted bytes change — wires an already-written, already-passing oracle into CI. Verified locally with the exact CI invocation (debug binary via SYNTH=./target/debug/synth): ORACLE PASS. ci.yml parses; new job well-formed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…h disasm` text The CI oracle job failed with `SYMBOL MISSING` on the fresh runner while passing locally: the harness scraped function addresses out of `synth disasm` stdout with a regex, and that text is host-dependent (the disasm backend even decodes RISC-V bytes with an ARM decoder, and on the bare runner the symbol-line format differs so the regex matched nothing). Read the addresses straight from the ELF symbol table via pyelftools instead — the same backend-independent approach base_cse_differential.py uses. synth emits the symtab with an empty section name, so it's found by sh_type (SHT_SYMTAB), and addresses are made .text-relative by subtracting sh_addr. Re-verified with the exact CI invocation (debug binary via SYNTH env): ORACLE PASS, 5 folds, all 6 functions matched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
CI-gates the RV32 immediate-shift-fold differential oracle. VCR-ORACLE-001's deliverable is CI-gating the differentials, not shipping them as dev-time scripts you have to remember to run.
The RV32 immediate-shift-fold lever (#487, landed flag-off behind
SYNTH_RV_SHIFT_FOLD) came with a unicornUC_ARCH_RISCVdifferential (shift_fold_riscv_differential.py) that only ran by hand. Because the lever sits flag-off awaiting the on-silicon flip, nothing else exercises the flag-on path — the exact gap thecmp-selecttwo-move oracle was added to close for that lever.How
Adds an isolated
rv32-shift-fold-oracleCI job that mirrors the existingcmp-select-oraclejob:wasmtime/unicorn/pyelftoolsin that job only (the maincargo testgate is not taxed with the C-library build graph);It continuously validates the
slli/srli/sraifolds, the& 31mask on>=32and negative shift amounts, and the variable-shift non-fold, plus non-vacuity (.text168B→148B, 5 folds). The differential now honors aSYNTHenv override (default release for local dev; CI points it at the debug build for speed, exactly likecmp-select).Frozen-safe
No codegen change, no emitted-bytes change — this wires an already-written, already-passing oracle into CI. Verified locally with the exact CI invocation:
ci.ymlparses (yaml.safe_load); the new job is well-formed.Part of epic #242 (VCR-*), closing the CI-gate loop on the #472 lever-1 oracle.
🤖 Generated with Claude Code