tests: add unit and mutation tests for gfx1013_compute_ir #3686
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!3686
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3684"
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?
@Ammmae0x on GitHub · 2026-12-01 01:38 UTC · original
Ammmae0x:tests/gfx1013-compute-ir→main· +2169 −0 · 5 files · 1 commits · merged 2026-12-01 03:12 UTCRefs #1149
Adds direct unit and mutation tests for
x2w::decode_local_dataandx2w::expand_gfx1013_compute(src/gfx1013_compute_ir.cpp), with zero edits to existing files (5 new files only). The check is portable C++17 and links onlysrc/gfx1013_compute_ir.cpp: no GPU, no device, no dxc.exe and no Windows header is needed.What landed (commit
915e568f, branchtests/gfx1013-compute-irfromorigin/main1a9ccbc4):tests/gfx1013_compute_ir_check.cpp: 83 cases, no-arg or single-case. 40 valid decodes (16 RMW atomics incl. return-old forms, 10 reads, 6 writes, 8 read2/write2 pairs with exactbyte_offsetanddata_register), 11 decode refusals (GDS/mask, unsupported opcode 0x3e; opcode 0xff is a valid read_b128, not a refusal), 20 valid expansions (lower/uppercase hex, CRLF and missing trailing newline, halfword odd-address guards, d16/d16_hi bitfields, VOP2 literal and inline-constant forms incl. the 193..208 two's-complement wrap, all 7 VOP2 opcodes) and 12 expansion refusals, every refusal pinning its exact substring.tests/cmake/gfx1013_compute_ir.cmake: registers the check (C++17, no Windows library) with one CTest entry per case plusgfx1013_compute_ir_all, and 5WILL_FAIL TRUEconfigure-time copy mutations (GDS mask, unsupported DS opcode, register-tuple bound, unsupported VOP2 opcode, inline-negative mapping).tests/gfx1013_compute_ir_meta_check.py+tests/checks/python-linux/gfx1013_compute_ir.txt: contract audit plus a Python transliteration over all 83 cases; compiles and runs the real C++ check withg++ -std=c++17and compiles each of the 5 CMake mutation copies the same way, running each control case (must fail); 8/8 model mutations killed.docs/experiments/gfx1013-compute-ir.md: cases, controls and runs.Linux verification (this host, g++ 13.3.0, /tmp/pe-env Python 3.12.3):
tests/gfx1013_compute_ir_meta_check.py: PASS: gfx1013 compute ir: 83 cases, 5/5 real C++ mutations killed, 8/8 model mutations killedg++ -std=c++17 -Isrc -Wall -Wextra tests/gfx1013_compute_ir_check.cpp src/gfx1013_compute_ir.cpp: 83/83 cases passed (only pre-existing-Wmissing-field-initializerswarning insrc/gfx1013_compute_ir.cpp:16, untouched source)tools/run_checks_parallel.py --from-dir tests/checks/python-linux: all 80 checks passedtests/form_coverage_check.py,tests/docs_links_check.py(198 Markdown files, 765 links),tests/bidi_controls_check.py: passgit diff --checkclean;git merge-tree --write-tree origin/main HEADexits 0; zero personal pathsWindows Verification (
915e568f95703232e74aa34dee31620d01c4421a)AI-assisted.
@lukaslw-lab on GitHub · 2026-12-01 02:31 UTC · original · approved these changes
Reviewed
915e568fby reading the diff; not built or run.Verdict: approve. The 83 cases follow the decode and expansion paths in
src/gfx1013_compute_ir.cpp, and each of the five C++ controls drops a guard that its control case reaches. The SHOULD can follow later. No MUST.literal_length,vop2_source,unknown_pragma,tests/gfx1013_compute_ir_meta_check.py:272-277) only flip flags in the Python transliteration. Their anchors each appear once in the source (e.g.gfx1013_compute_ir.cpp:140,:216). The meta check already compiles the other five mutants with g++ (:749), so applying these three the same way, or as CMake controls, would make "8/8 killed" a claim about the C++ rather than the model.read_b64into v255, so 255 + 2 > 257 is false. The inline-negative control pins the 193..208 two's-complement mapping (:150). Read2/write2 cases checkbyte_offsetanddata_register. Opcode 0xff is correctly a validread_b128, not a refusal. No existing file changes.Tests: 51 decode + 32 expansion cases prove accepted shapes and each pinned refusal substring. The five
*_mutcontrols prove the GDS mask, the DS opcode refusal, the tuple bound, the VOP2 opcode refusal and the inline-negative mapping are each needed. CI at this head: Linux ran the meta check, which compiles and runs the real check and the five mutants with g++. The Windowsprfilter (CMakePresets.json) runs none of thegfx1013_compute_ir*tests, so the MSVC evidence is the author's dev + release run (89/89).