tombox-xshader tests: synthetic amplification + mesh pair rendered on WARP #313
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!313
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/313/head"
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?
@enderrr9 on GitHub · 2026-11-23 17:37 UTC · original
enderrr9:xshader-amp-synthetic-warp→main· +203 −8 · 1 files · 1 commits · closed without mergingWhat
This is a test-only change in
crates/tombox-xshader/tests/amp.rs. It adds a hand-assembled amplification + mesh shader pair and renders it on WARP. No game dumps are needed.All four existing tests in
tests/amp.rsneed theconsole_xscfixtures (as2/as3/ms3) from local title dumps. Without them, no amplification shader runs on a GPU, in CI or on a contributor's machine. The other AS tests (synthetic.rs,mesh.rs) stop at the HLSL/DXC compile.The pair follows the ring ABI that
hlsl/amp.rsdecodes:s2/s3hold the args/payload rings >> 8 ands4the group id. The AS shifts both rings left by 8 withs_lshl_b64, offsets them by its group, and stores:global_store_dwordx4;global_store_dword. Only dword 0 of the args entry is written, so the open Y/Z encoding question (BLOCKERS.md, #115) doesn't affect the test.global_load_dwordx4through thes[10:11]window. Each mesh group draws one pixel-wide triangle atx = payload[0] + groupand exports the payload tag, its group index and the AS group.Tests added
synthetic_pair_disassembles_to_the_ring_abi_shape: the hand-written words decode to the intended instructions, and all three memory ops are global-segment with an SGPR base.gpu_synthetic_amplification_feeds_payload_and_group_counts_to_the_mesh_stage: 2 AS groups launch 1 and 2 mesh groups. Pixels 0, 4 and 5 hold the payload and group values, the rest keep the clear colour, and there are zero global-memory misses. This is the same pattern as the as3/ms3 fixture test.gpu_synthetic_amplification_reads_root_constants_through_s0_s1: the AS loads the group count and tag as root constants withs_load_dwordx2froms[0:1]. That is the memory-based root ABI (hlsl/rootmem.rs) that amplification shaders must use underFORCE_MEMORY_BASED_ABI. Pixels 0, 1, 4 and 5 are drawn. Until now, rootmem only ran on a GPU for compute shaders (exec_mem/rootmem.rs).Harness changes
render()is split intorender_pair(), which takes translated shaders and optional root constants. The fixture test still callsrender()unchanged.tests/mesh.rsuses.Testing
cargo test -p tombox-xshader --locked --test ampon WARP: 3 passed, 4 ignored (the fixture tests).TOMBOX_EXEC_HW=1 cargo test -p tombox-xshader --locked --test amp -- gpu_syntheticon an RTX 3050 Laptop GPU: 2 passed.pr_gate.py --base $(git merge-base main HEAD): 1 file checked, 0 problems.Limits
The instruction sequences are hand-written to the ABI the translator already models. They are not output of the console compiler. So this pins the translator's AS/MS behaviour on a real GPU path; it is not new console evidence.
🤖 Generated with Claude Code
@MeNoSkills on GitHub · 2026-11-23 19:21 UTC · original
Independent run of this PR's
tests/amp.rson an RTX 4070 Ti (Windows 10 19045, mesh shader tier 1.0 reported by the adapter),TOMBOX_EXEC_HW=1, release build: 3 passed, 0 failed, 4 ignored (the console_xsc fixture tests):synthetic_pair_disassembles_to_the_ring_abi_shape,gpu_synthetic_amplification_feeds_payload_and_group_counts_to_the_mesh_stageandgpu_synthetic_amplification_reads_root_constants_through_s0_s1.One note on the default WARP run: on this machine's WARP (Windows 10 19045) the adapter reports
MeshShaderTier 0, so the twogpu_synthetic_*tests panic with "WARP reports MeshShaderTier 0: rerun with TOMBOX_EXEC_HW=1" instead of passing.tests/mesh.rsfails the same way on unmodified main, so this is not specific to the PR. It only means the "on WARP" claim depends on a WARP build with mesh support; where WARP has none, a skip with a message (asrun_mem_casesdoes for shader-model limits) would keepcargo testgreen on older Windows.@omonkeyz on GitHub · 2026-11-25 13:49 UTC · original
Applied on main in
d510bf1(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed