tooling: add a deterministic CPU differential fuzz smoke #887
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/894"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:18:22Z.
Refs #446.
Change
Adds a deterministic differential fuzz smoke for the shared
cpu_switch_aotlifter.tools/fuzz_cpu.pygenerates 20 leaf functions from seed0xA902covering 8-, 16-, 32- and 64-bit ALU chains, shifts and rotates, CMP/TEST producers feeding SETcc/CMOVcc/Jcc consumers, a forward branch diamond, and a Jcc to its own fallthrough. The build assembles one MASM DLL, translates all exports into one C++ source, and builds that source at the preset's optimization plus an explicit/O2build.The test runs native, default-translated and
/O2-translated exports over 313 deterministic input pairs per function and compares RAX plus a guarded 256-byte output buffer. A mismatch prints the seed, function, input, native/lifted values and the one-function MASM;--only NAME --input INDEXreproduces one case.CPU_FUZZ_FUNCTIONSandCPU_FUZZ_SEEDconfigure a longer manual run.Verification
Windows 11 Pro 26200, MSVC 19.52, CMake/Ninja, Ryzen 5 5500 (no GPU involved).
Dev: seed 0xA902, 20 functions, 313 inputs, 12,520 comparisons, 0.37 s.
Release: same 12,520 comparisons, 0.37 s.
Manual long run:
cmake --preset dev -DCPU_FUZZ_SEED=0xCCD1 -DCPU_FUZZ_FUNCTIONS=96, then the same test: 60,096 comparisons in 1.09 s.python -B tests/docs_links_check.py(13 files, 178 links),python -B tests/bidi_controls_check.py(718 files) andgit diff --checkpass.Evidence and follow-up
cpu_switch_aotfirst, 20 functions at about 0.4 s per Windows job, seed-only by default, and a documented promotion path to fixedcpu_asm_fixture/cpu_translationfixtures for cases worth keeping./O2build is the first hook for the dead-read class.Checklist
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-23T16:22:19Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
638e95ed49ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:30:41Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:31:31Z.
@codex review
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-23T16:34:46Z.
Codex Review: Didn't find any major issues. More of your lovely PRs please.
Reviewed commit:
b3f0076690ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-23T16:18:36Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
b3f0076ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-23T16:22:19Z.
Code review location:
tools/fuzz_cpu.py; line 219When a caller mistypes
--only NAMEor supplies an out-of-range or negative--input, these comprehensions leave a selection empty. The command then performs no comparisons but still prints that the default and/O2builds matched and exits successfully, making an invalid reproduction filter look like a pass; fail when either selection is empty.AGENTS.md reference: AGENTS.md:L75-L76
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:30:41Z.
Code review location:
tools/fuzz_cpu.py; line 219Fixed in
b3f0076: an empty--onlyor--inputselection now exits non-zero before any comparison, and a non-positiveCPU_FUZZ_FUNCTIONSis rejected. Verified--only fuzz_0 --input 0passes (2 comparisons);--only nope,--input 999and count 0 fail;cpu_aot_fuzz_smokestill passes.