Skip to content

test: GPU fixtures for FSPX scalar lists ending in vcc_lo,vcc_hi and src_scc (TEST-593) - #2962

Open
itsRevela wants to merge 1 commit into
ItsNotRexed:mainfrom
itsRevela:test/fspx-rules-gpu
Open

itsRevela wants to merge 1 commit into
ItsNotRexed:mainfrom
itsRevela:test/fspx-rules-gpu

Conversation

@itsRevela

Copy link
Copy Markdown
Contributor

Item: TEST-593 (claim).

docs/design.md's "Scalar/buffer memory" row covers the rules #2000 added for FidelityFX FSR4's FSPX programs: LLVM VCCTuple scalar lists ending in vcc_lo,vcc_hi and the src_scc operand. They were CPU-checked by tests/semantic/test_fspx_rules.py only. This adds two single-thread compute fixtures to scripts/run_gpu_tests.py's dump tests.

cs_fspx_slist: the heap is seeded with 16 dwords 0xf5f00000 + i, a RAW V# at 0x80, and two data words.

word instruction expected
0–3 s_buffer_load_dwordx8 [s100,…,s105,vcc_lo,vcc_hi]: s100, s105, vcc_lo, vcc_hi i 0, 5, 6, 7
4, 5 s_buffer_load_dwordx16 [s92,…,s105,vcc_lo,vcc_hi]: s92, vcc_hi i 0, 15
6 a V# loaded into [s104,s105,vcc_lo,vcc_hi], then s_buffer_load_dword through it 0xcafe1234
7 the same V#, buffer_load_dword at 4 0xbeef5678

cs_fspx_src_scc: v_add_nc_u32 src_scc + 20 with SCC 1 gives 21, and with SCC 0 (after s_add_u32 clears it) gives 20; s_mov_b32 src_scc gives 1; s_add_u32 10, src_scc gives 11.

Runner change: llvm-mc 21 can't assemble these lists ("registers in a list must be of the same kind"; s[100:107] is out of range), and with gfx1013 it can't decode them either. Per docs/fspx.md, only LLVM 23 prints them, for gfx1030-class targets. So assemble_to_s now passes an instruction line that already carries ; encoding: [...] to the translator as written, and assembles the rest. It checks that llvm-mc gave one instruction per remaining line and fails with a clear message if not. Fixtures without such lines assemble exactly as before. The five verbatim lines carry their real machine words: llvm-mc's encoding of the same instruction on a nearby range, with the register field moved (SMEM SDATA to 100/92/104, SBASE to 52, MUBUF SRSRC to 26). The fixture header documents this.

Tested

Windows 11, NVIDIA GeForce RTX 3070 Ti (driver 610.88), llvm-mc 21.1.8, SPIRV-Tools v2026.4:

  • run_gpu_tests.py --filter cs_fspx: both PASS with exactly the words above. The listing handed to the translator has all five instructions in the vcc_lo,vcc_hi form.
  • tests/test_run_gpu_tests.py (four new tests: the split, the source order, the count check, a plain fixture): OK. tests/test_run_gpu_tests_paths.py: OK.
  • The docs/design.md row now says GPU-checked; all four docs tests pass.

No game files. AI-assisted (Claude Code).

…src_scc (TEST-593)

The "Scalar/buffer memory" rules for FidelityFX FSR4's FSPX programs (ItsNotRexed#2000)
were CPU-checked only. cs_fspx_slist runs s_buffer_load_dwordx8/x16 into
lists ending in vcc_lo,vcc_hi and a V# loaded into [s104,s105,vcc_lo,vcc_hi]
used by s_buffer_load_dword and buffer_load_dword; cs_fspx_src_scc reads
src_scc from VALU and SALU with SCC 1 and 0. Both pass on an RTX 3070 Ti.

llvm-mc 21 cannot assemble those lists (and with gfx1013 cannot decode
them; only LLVM 23 prints them, for gfx1030-class targets, docs/fspx.md),
so run_gpu_tests.py's assemble_to_s now passes an instruction line that
already carries `; encoding: [...]` to the translator as written and
assembles the rest, checking one assembled instruction per other line.
The five lines carry their machine words: llvm-mc's encoding of the same
instruction on a nearby range, with the register field moved. Fixtures
without such lines assemble exactly as before. Unit tests cover the split,
the order, and the count check; the docs/design.md row says GPU-checked.
@Doffi4

Doffi4 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Independently tested 00ec6bc7 on Windows 11 (26200), Radeon 780M (26.11.2) and RTX 5060 Laptop (621.01). Ran scripts/run_gpu_tests.py --filter cs_fspx --require-pass with LLVM 23.1.6 and SPIRV-Tools 2026.4. Both fixtures passed bit-exact on each GPU (2/2; both modules validated). Used the Vulkan harness from 16282101 after verifying that the PR did not change the runtime harness sources or build configuration. Synthetic inputs only. AI-assisted testing and reporting.

@Marukooh

Copy link
Copy Markdown
Contributor

Tested 00ec6bc7 on CachyOS Linux, Python 3.14. tests/test_run_gpu_tests.py: 38 passed, 36 subtests passed.

The two TEST-593 fixtures also ran on the RTX 5070 Ti with NVIDIA 620.73.04. Both Vulkan modules validated and every checked word matched, including the VCCTuple tails and src_scc.

AI-assisted, synthetic inputs only.

@crastinator

Copy link
Copy Markdown
Contributor

Tested 00ec6bc merged into main 16282101 (clean merge) on AMD Radeon RX 6700 XT (Navi 22, gfx1031, subgroup 32..64), RADV Mesa 26.3.1, CachyOS, Linux 7.3.5, GCC 16.2.1, llvm-mc 23.1.5: pass.

  • New tests pass natively: cs_fspx_slist (0xf5f00000 0xf5f00005 0xf5f00006 0xf5f00007 0xf5f00000 0xf5f0000f 0xcafe1234 0xbeef5678); cs_fspx_src_scc (0x15 0x14 0x1 0xb).
  • Whole run_gpu_tests.py: 177/191 native, 177/191 with LEONIDA_W64_EMULATE=1 (the skips are the D3D12-only fixtures and ps_w64x_readlane, as on main). ctest 37/37.
  • tests/test_run_gpu_tests.py: 38 passed, 36 subtests passed.

No game files. AI-assisted (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51):

No problems found. ctest on the RTX 4080 SUPER: 129/129 passed. Intel UHD 770 ctest: only the two known base failures, d3d12_descriptor (fixed by #2948) and d3d12_subgroup (fixed by #2934). d3d12_present failed once in the full Intel run but passes 3/3 when run alone on Intel, so it is load-related, not this PR.
Fixtures cs_fspx_slist and cs_fspx_src_scc: PASS on both RTX 4080 SUPER and Intel UHD 770 with identical output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants