tooling: add a deterministic CPU differential fuzz smoke #894
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!894
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/894/head"
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?
@triggered02 on GitHub · 2026-11-23 16:18 UTC · original
triggered02:tooling/cpu-differential-fuzz→main· +356 −0 · 4 files · 2 commits · merged 2026-11-23 16:46 UTCRefs #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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-23 16:18 UTC · original · edited 2026-11-23 16:34 UTC
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.
@ -0,0 +218,4 @@if count <= 0:raise SystemExit("CPU_FUZZ_FUNCTIONS must be positive")selected = [function for function in functions if only is None or function.name == only]selected_inputs = [(index, value) for index, value in enumerate(inputs) if input_index is None or index == input_index]@chatgpt-codex-connector[bot] on GitHub · 2026-11-23 16:22 UTC · original
When 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 👍 / 👎.
@ -0,0 +218,4 @@if count <= 0:raise SystemExit("CPU_FUZZ_FUNCTIONS must be positive")selected = [function for function in functions if only is None or function.name == only]selected_inputs = [(index, value) for index, value in enumerate(inputs) if input_index is None or index == input_index]@triggered02 on GitHub · 2026-11-23 16:30 UTC · original
Fixed 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.@triggered02 on GitHub · 2026-11-23 16:31 UTC · original
@codex review
@chatgpt-codex-connector[bot] on GitHub · 2026-11-23 16:34 UTC · original
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".
@chatgpt-codex-connector[bot] on GitHub · 2026-11-23 16:22 UTC · original · reviewed
💡 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".