tombox-xshader tests: s_swappc_b64 vertex fetch with two link registers, ds_append/ds_consume verified, LDS-mode refusal pinned #298

Closed
github-bot wants to merge 1 commit from gh-pr/298/head into gh-pr/298/base
Owner

@⁠MeNoSkills on GitHub · 2026-11-23 16:52 UTC · original
MeNoSkills:test/vertex-fetch-ds-append → main · +62 −0 · 3 files · 1 commits · closed without merging

Test only, no change to the translator. Follow-up to #297 for two more mnemonics that no verified group names although tests already exercise them.

What changes

  • s_swappc_b64 (47,110 uses in the analysed titles, the vertex-fetch call): vertex_fetch_reads_sparse_attributes_from_a_vertex_buffer already runs it end to end, but it never reports a verified mnemonic. The new exec_mem/vfetch.rs test runs the same draw (vertex buffer, input layout, translated vertex shader, pixel shader that reads the result back) with two link registers (s_swappc_b64 s4, s4 and s12, s12) and seven 32-bit attribute values (0, 1, 0x7fffffff, 0x80000000, 0xffffffff, 0xdeadbeef, 0x01000001), and checks the four output words exactly, including the default (0, 0, 0, 1.0) of the components the layout does not supply. It reports s_swappc_b64 in the vertex_fetch_call group.
  • ds_append and ds_consume: ds_gds_append_consume checks the GDS counter totals, the untouched neighbours, the inactive lanes and, on a wave32 device, the per-wave pre-op values for four exec masks. On hardware it now also reports both mnemonics in the gds_append_consume group (TOMBOX_EXEC_VERIFIED), as the other groups do. Without TOMBOX_EXEC_HW it behaves as before.
  • New ds_append_and_consume_on_lds_are_refused_by_name: with GDS=0 the translator answers unsupported encoding [ds_append @ 0x4c] (and ds_consume); the test pins that the refusal exists and names the instruction. There is no LDS-counter lowering, and neither mnemonic appears in the analysed titles (0 uses), so I did not add one.

Results

On an NVIDIA RTX 4070 Ti (Windows 10 build 19045, MSVC, TOMBOX_EXEC_HW=1): the three tests pass and TOMBOX_EXEC_VERIFIED writes vertex_fetch_call.txt (s_swappc_b64) and gds_append_consume.txt (ds_append, ds_consume). On WARP the new vertex-fetch test passes; ds_gds_append_consume fails on my machine's WARP with device removed 0x887a0005 before reaching the new lines (Windows 10 WARP is old; it passes on the RTX and its CI result is the maintainer's to confirm). Sensitivity check: moving the first vertex attribute register from v4 to v8 (hlsl.rs, the first computation) makes both the old and the new vertex-fetch tests fail; reverted, not in the PR. python .github/scripts/pr_gate.py --base upstream/main --head HEAD: 0 problems; the branch is on main f89e410.

What this does not check

  • The register layout after the call (groups of four VGPRs from v4, one per read input register, (0, 0, 0, 1.0) for components the signature does not supply) is the translator's model, taken from observed shaders; the tests confirm the translator keeps to it, not that it matches the console fetch shader for every format. In particular the default w of an integer-format attribute is 1.0f here.
  • Float attribute payloads (NaN patterns) are not covered: only 32-bit unsigned values travel through the fetch.
**@⁠MeNoSkills** on GitHub · 2026-11-23 16:52 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/298) `MeNoSkills:test/vertex-fetch-ds-append` → `main` · +62 −0 · 3 files · 1 commits · closed without merging Test only, no change to the translator. Follow-up to #297 for two more mnemonics that no verified group names although tests already exercise them. ## What changes - `s_swappc_b64` (47,110 uses in the analysed titles, the vertex-fetch call): `vertex_fetch_reads_sparse_attributes_from_a_vertex_buffer` already runs it end to end, but it never reports a verified mnemonic. The new `exec_mem/vfetch.rs` test runs the same draw (vertex buffer, input layout, translated vertex shader, pixel shader that reads the result back) with two link registers (`s_swappc_b64 s4, s4` and `s12, s12`) and seven 32-bit attribute values (0, 1, 0x7fffffff, 0x80000000, 0xffffffff, 0xdeadbeef, 0x01000001), and checks the four output words exactly, including the default (0, 0, 0, 1.0) of the components the layout does not supply. It reports `s_swappc_b64` in the `vertex_fetch_call` group. - `ds_append` and `ds_consume`: `ds_gds_append_consume` checks the GDS counter totals, the untouched neighbours, the inactive lanes and, on a wave32 device, the per-wave pre-op values for four exec masks. On hardware it now also reports both mnemonics in the `gds_append_consume` group (`TOMBOX_EXEC_VERIFIED`), as the other groups do. Without `TOMBOX_EXEC_HW` it behaves as before. - New `ds_append_and_consume_on_lds_are_refused_by_name`: with GDS=0 the translator answers `unsupported encoding [ds_append @ 0x4c]` (and `ds_consume`); the test pins that the refusal exists and names the instruction. There is no LDS-counter lowering, and neither mnemonic appears in the analysed titles (0 uses), so I did not add one. ## Results On an NVIDIA RTX 4070 Ti (Windows 10 build 19045, MSVC, `TOMBOX_EXEC_HW=1`): the three tests pass and `TOMBOX_EXEC_VERIFIED` writes `vertex_fetch_call.txt` (`s_swappc_b64`) and `gds_append_consume.txt` (`ds_append`, `ds_consume`). On WARP the new vertex-fetch test passes; `ds_gds_append_consume` fails on my machine's WARP with `device removed 0x887a0005` before reaching the new lines (Windows 10 WARP is old; it passes on the RTX and its CI result is the maintainer's to confirm). Sensitivity check: moving the first vertex attribute register from v4 to v8 (`hlsl.rs`, the `first` computation) makes both the old and the new vertex-fetch tests fail; reverted, not in the PR. `python .github/scripts/pr_gate.py --base upstream/main --head HEAD`: 0 problems; the branch is on main f89e410. ## What this does not check - The register layout after the call (groups of four VGPRs from v4, one per read input register, (0, 0, 0, 1.0) for components the signature does not supply) is the translator's model, taken from observed shaders; the tests confirm the translator keeps to it, not that it matches the console fetch shader for every format. In particular the default w of an integer-format attribute is 1.0f here. - Float attribute payloads (NaN patterns) are not covered: only 32-bit unsigned values travel through the fetch.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:17:44 +00:00
github-bot closed this pull request 2026-11-26 06:17:44 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-25 13:48 UTC · original

Applied on main in 5ec2fde (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

**@⁠omonkeyz** on GitHub · 2026-11-25 13:48 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/298#issuecomment-7164327938) Applied on main in 5ec2fde (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.