cpu: cover eight jump-table translator semantics that no test observed #372
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!372
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/372/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?
@Leyukaka on GitHub · 2026-11-21 23:39 UTC · original
Leyukaka:jump-table-controls→main· +56 −5 · 4 files · 1 commits · merged 2026-11-21 23:56 UTCChange
This closes eight coverage gaps in the jump-table translator,
tools/cpu_switch_aot.py. Each was a one-line mutation of the translator that passed everycpu_test onmain. Only thecpu_aot_narrow_returnsfixture, its check and its CMake export list change; the translator does not.tests/cpu/narrow.asmgains two exports:qword_ops: a 64-bitimul rax, rdx;shlandsarof RDX by CL; andmovsx r11, dl. Each result is written to the trace.flag_results:inc althensete;testthensetb;cmpthensetleandsets.Both run on a focused input that pins the mutations,
(32, 0x8000000000000080)and(255, 255), followed by the fixture's general input pairs.narrow_check.pycomputes their reference values in Python, independently of the translator.Verification
On
06b7bd9(branch on9bdbb20), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14:It passes, and so does the full suite (146 of 146 tests).
Each mutation was applied to
tools/cpu_switch_aot.pyone at a time, followed by a rebuild and the wholecpu_family. Onmain, all 42cpu_tests passed for each one. A control that swapped thee/neconditions was caught bycpu_aot_jump_tables, so the run does detect a broken translator. On this branch, each mutation failscpu_aot_narrow_returns:imulreads operand 0 twiceqword_opsRAX:0x1000expected,0x400mutatedmovsxsource cast unsigned0xffffffffffffff80expected31sarsource cast unsigned0xffffffff80000000expectedincflags computed from the operand before the incrementflag_resultstrace word 0:inc alfrom 255 sets ZFtestsets CFlewithout equalitysetleatRCX == RDXsas<= 0setsafter a zero differenceEvidence and follow-up
The fixture and check changes were drafted with Codex from the mutation list, then reviewed, built and mutation-tested locally. No open PR touches
tests/cpu/narrow*. Similar gaps found incpu_chained_aot.py/cpu_call_aot.py(six mutations) andpixel_aot.py(five) are queued as separate PRs.Checklist
AI-assisted.