tests: add unit and mutation tests for gfx1013_isa #3688
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!3688
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3686"
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:41 UTC · original
Ammmae0x:tests/gfx1013-isa→main· +1321 −0 · 5 files · 1 commits · merged 2026-12-01 03:12 UTCRefs #1149
Direct unit and mutation tests for
x2w::gfx1013::instruction(src/gfx1013_isa.cpp), with zero edits to existing files (5 new files only, +1321/-0; portable C++17 needing onlytests/gfx1013_isa_check.cpp+src/gfx1013_isa.cpp).tests/gfx1013_isa_check.cpp: 80 cases, no-arg runs all, optional<case>arg, loudFAIL: <case>: ...with exit 1. All 20 forms with exact opcode, size and name (VOP3 native0x202, all 3 fallbacks to VOPC/VOP2/VOP1, empty name for0x200; VINTRP 4 bytes; MTBUF bit 3 from(word(1) >> 18) & 8; MIMG bit 7 and NSA sizes 8/12/16/20); extensions on 233/234/249/250/255 for VOP1/VOP2/VOPC, VOP2 madmk/madak/fmamk/fmaak without src 255, SOP 255 incl. src1, SOPKs_setreg_imm32_b32, VOP3/VOP3P literal 255 in src0/src1/src2; non-zero pc slicing; 17 refusals pinning exact messages (misaligned pc, empty/short code, truncated extension words incl. MIMG NSA=1 and MTBUF, reserved FLAT segment, unknown formats 0x39/0x3b/0x3f). Includes<initializer_list>, MSVC /W4 clean intent.tests/cmake/gfx1013_isa.cmake: per-case tests +gfx1013_isa_all+ 5 WILL_FAIL TRUE configure-time copy mutations mirroringera_gpu_alias_open_base_control(mtbuf_bit3, mimg_nsa, vop3_fallback, vop2_madmk, flat_segment).tests/gfx1013_isa_meta_check.py+tests/checks/python-linux/gfx1013_isa.txt+docs/experiments/gfx1013-isa.md: contract audit + compile & run the real C++ check withg++ -std=c++17on Linux + all 5 CMake mutations, plus a Python transliteration model with 8/8 mutations killed (5 CMake + 3 model-only: ext_src255, sopk_setreg, vop3_literal).Linux (this host, base
origin/main1a9ccbc4):PASS: gfx1013 isa: 80 cases, 5/5 real C++ mutations killed, 8/8 model mutations killedrun_checks_parallel.py --from-dir tests/checks/python-linux: all 80 checks passedWindows Verification (
70dd849bfeda1beddf28c29b9857cfb6224cb2f2)AI-assisted.
@lukaslw-lab on GitHub · 2026-12-01 02:29 UTC · original · approved these changes
Reviewed
70dd849bby reading the diff; not built or run.Verdict: approve. The cases follow every branch of
instruction()and the five C++ mutations each drop a real guard; the one SHOULD can follow later. No MUST.ext_src255,sopk_setreg,vop3_literal,tests/gfx1013_isa_meta_check.py:259-265) only flip flags in the Python transliteration (decode(),:293). They show that the model notices the change, but not that the C++ check does. All three already have unique text anchors insrc/gfx1013_isa.cpp(:44,:71,:91), and the meta check already compiles the other five mutants with g++ (:542). Applying these three to the real source the same way, or as three more CMake controls, would make "8/8 killed" a claim about the C++. It would also catch drift between the 581-line model and the decoder.s_setreg_imm32_b32, VOP3/VOP3P src0–2), the MTBUF opcode bit 3 from word 1, MIMG bit 7 and NSA 1–3, and all three throw sites (gfx1013_isa.cpp:31/101/128), with exact messages and non-zero pc. The harness fails on an unknown case name, so a renamed case cannot pass silently. The new files are picked up by the existingtests/cmake/*.cmakeglob and thepython-linuxlist, and no existing file changes.Tests: the 80 cases plus
gfx1013_isa_allprove the decoder's form, opcode, size, name and refusal on synthetic words. The five*_mutcontrols prove the MTBUF bit, the NSA count, the VOP3 fallback, madmk and the FLAT segment guard 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++. Windows builds the targets, but theprpreset filter (CMakePresets.json) runs none of thegfx1013_isa*tests, so MSVC coverage is the author's local dev + release run (86/86).