cpu: cover eight VEX word translator semantics that no test observed #554
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!554
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/554/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-22 11:34 UTC · original
Leyukaka:vex-controls→main· +49 −4 · 4 files · 1 commits · merged 2026-11-22 12:38 UTCChange
This closes eight coverage gaps in the VEX.128 word translator,
tools/cpu_vex_aot.py(#325). Each was a one-line mutation of the translator that passed everycpu_test onmain. Only thecpu_aot_vex_wordsfixture, its check and its CMake export list change; the translator does not.tests/cpu/vex_words.asmgainsbyte_pack_reload:vpunpcklbw/vpunpckhbwinterleave bytes of both inputs, so the second source is no longer all zero;vpsrawby 1 halves the high words, which include a negative word;vpackuswbpacks words above 255 and below 0;vpsrlwby 32 and avpxorwith[r8]reload the packed bytes from the output buffer.vex_words_check.pyadds it to the existing native-versus-lifted loops: 4096 input pairs, outputs aliasing either input, RCX == RDX, and buffers 8 bytes off 16-byte alignment. A focused check also compares it with a Python reference in both native and both lifted builds, on one input pair aligned and one byte past alignment, and on all-zero inputs one byte past alignment.Verification
On
3791a82(branch onaefed61), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14:It passes. In the full suite, 260 of 261 tests pass (three of them capability skips). The exception is
pixel_aot_hardware, which fails the same way onmainataefed61and does not involve the CPU translators.Each mutation was applied to
tools/cpu_vex_aot.pyone at a time, followed by a rebuild and the wholecpu_family. Onmain, everycpu_test passed for each one. A control that turnedvpaddwinto a subtraction was caught bycpu_aot_vex_words, so the run does detect a broken translator. On this branch, each mutation failscpu_aot_vex_words:vpunpcklbwtakes the wrong byte of the second sourcevpunpckhbwtakes the wrong byte of the second sourcevpackuswbtruncates its first source instead of saturatingvpackuswblets -3 to -1 wrap instead of clamping to 0vpsrawby 1 shifts logicallyChecklist
AI-assisted.