tests: add refusal and mutation tests for gfx1013_vertex_id #3691
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!3691
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3689"
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:50 UTC · original
Ammmae0x:tests/gfx1013-vertex-id→main· +2382 −0 · 5 files · 1 commits · merged 2026-12-01 03:12 UTCRefs #1149
Direct, portable C++17 tests for
x2w::translate_gfx1013_vertex_idandx2w::translate_gfx1013_buffered_vertex(src/gfx1013_vertex_id.cpp), with zero edits to existing files (5 new files only, +2382/-0). No GPU, no device, no dxc.exe and no Windows header is needed: the check links onlytests/gfx1013_vertex_id_check.cpp+src/gfx1013_vertex_id.cpp.What landed — commit
008bd7f0, 54 cases intests/gfx1013_vertex_id_check.cpp(no-arg +<case>/--case <case>, loudFAIL: <case>: ...to stderr):192u - sel, two's-complement patterns), float constants 240..247, literal255,v_mov/v_cvt_f32_i32/v_lshlrev/v_and/d54bFMA without modifiers,pos/param0export masks with disabled lanes (reg=128) as0.0, prefetch/priority skips,param1absent.ud3cbuffer,s_mov_b32/s_mov_b64,s_or_b32vertex high (0x9380ff00+0x80000),s_load_dwordx4on thevb_tableand root tables 0/1 (table 1 at offset 32),s_load_dwordx16(0xf4300000), 2- and 3-dword vertextbuffer/bufferloads (0xe0342000/0xe03c2000),v_rsqrt_f32,d503add modifiers, VOP2 (3, 4, 5, 8, 37, 43),param1export (0xf8000210) with exactbindings(srv N buf vb 0/table T OFF)."<reason> at vertex byte <addr>"text:truncated instruction,undefined VGPR,unresolved scalar input,unsupported input selector(248 and 254),invalid buffer descriptor range,unexpected buffer descriptor,overwritten buffer descriptor,unsupported scalar load offset,scalar load register range,expected vertex stream zero,unresolved root table,unsupported vertex load operands,vertex load destination range,invalid scalar destination,unsupported scalar pair,unsupported scalar move,unsupported vertex address high word,unsupported add modifiers,unsupported FMA modifiers(buffered neg-mask0x18000000vs unbuffered0xf8000000),duplicate vertex export,unexpected disabled export operand,incomplete exports or trailing instructions,unsupported vertex instruction,missing endpgm.tests/cmake/gfx1013_vertex_id.cmakeregisters the check (C++17, no Windows library) with one CTest entry per case plusgfx1013_vertex_id_all, and 5WILL_FAIL TRUEconfigure-time copy mutations ofsrc/gfx1013_vertex_id.cpp, mirroringera_gpu_alias_open_base_control: dropoverwritten buffer descriptorcheck, dropoffset % 32inunresolved root table, widen unbuffered FMA mask to0x18000000, dropunexpected disabled export operand, drop trailing-instructionspc != code.size().tests/gfx1013_vertex_id_meta_check.py+tests/checks/python-linux/gfx1013_vertex_id.txtaudit the contract, the C++ check, the CMake fragment and the note; run a Python transliteration of the translator over all 54 cases; compile and run the real C++ check withg++ -std=c++17; compile each CMake mutation copy the same way and run its control case; and run a model mutation audit (7 mutations: the 5 CMake controls plus vertex-stream-zero and scalar-pair guards).docs/experiments/gfx1013-vertex-id.mddocuments the cases, controls and Windows run.Linux verification (this host cannot run Windows CTest or MSVC, so Windows verification is pending):
tests/gfx1013_vertex_id_meta_check.py:PASS: gfx1013 vertex id: 54 cases, 5/5 real C++ mutations killed, 7/7 model mutations killedtools/run_checks_parallel.py --from-dir tests/checks/python-linux:all 80 checks passedtests/form_coverage_check.py: passed;tests/docs_links_check.py:Checked 198 Markdown files and 765 links;tests/bidi_controls_check.py:Checked 2793 tracked source, script and build/CI files: no bidirectional controlspy_compilepassed,git diff --checkclean, merge-tree exits 0, zero personal paths in the diff.Caught in development:
0xc0800000is3229614080u, not3238002688u; and theparam1export in the buffered case readsv1after the vertex-load temporaries, so its first lane isr3, notr0.Windows Verification (
008bd7f010c08b5ce18673323d753adc6734327a)AI-assisted.
@lukaslw-lab on GitHub · 2026-12-01 02:59 UTC · original · approved these changes
Reviewed
008bd7f0by reading the diff; not built or run.Verdict: approve. The 54 cases cover both translators and every refusal message they throw, and the five C++ controls each drop a real guard. The SHOULD can follow later. No MUST.
vertex_stream_zero,scalar_pair,tests/gfx1013_vertex_id_meta_check.py:380-385) only change the Python transliteration. Their anchors exist once insrc/gfx1013_vertex_id.cpp(:113,:142-143), and the meta check already compiles the other five mutants with g++ (:922). Applying these two to the real source the same way, or as CMake controls, would make "7/7 killed" a claim about the C++. It would also catch drift between the 958-line model and the translators.src/gfx1013_vertex_id.cppare pinned by a case with theat vertex byte <addr>suffix.bindingsfor both the unbuffered and buffered paths, including the 193..208 two's-complement selectors, thevb_table/ root-table loads (table 1 at offset 32) and theparam1export.Tests: the cases prove the accepted HLSL and bindings and each refusal substring. The
*_mutcontrols prove the overwritten-descriptor, root-table alignment, FMA-modifier, disabled-export and trailing-instruction guards 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_vertex_id*tests, so the MSVC evidence is the author's dev + release run (60/60).