Skip to content

Test conditional wave64 mesh allocation across four sweep workgroups - #6030

Open
kacper-serewis wants to merge 4 commits into
ItsNotRexed:mainfrom
kacper-serewis:test/conditional-mesh-sweep
Open

kacper-serewis wants to merge 4 commits into
ItsNotRexed:mainfrom
kacper-serewis:test/conditional-mesh-sweep

Conversation

@kacper-serewis

Copy link
Copy Markdown
Contributor

ASSET-491 synthetic regression follow-up. Coordination claim.

Depends on: #4247
Depends on: #5651
Depends on: #5072
Depends on: #4628

The change for review is 74417e1 atop #5651. Only wave zero sends the allocation, including invocation zero so the test also works with #4272's allocation gate. Both waves execute a two-trip scalar loop around the barrier before exporting the fullscreen triangle. The GPU fixture runner checks its gradient. The optional four-workgroup test calls the normal sweep translator, native and compute runners, and comparator, then checks the native primitive query, each individual header, and both frames.

Windows, NVIDIA GeForce RTX 5070, driver 616.56. Five alternating runs each with the translator from main 561b65a and that same translator with only the #4247 delta. Each old native query returned four primitives while all four explicitly written lowered headers were (0,0). Every fixed run returned four native primitives, (3,1) in every lowered slot, and matching coverage and colour at all 4,096 pixels. Native and compute translations passed spirv-val each time.

Controls on the old and fixed translator revisions: wave-zero-only send with one barrier and lane-zero EXEC predicate with one barrier both retained (3,1) in every slot. Both waves sending before one barrier reproduced #4298's known overwrite. The standard GPU runner passed all 4,096 gradient pixels in each stage with the fix. All 20 sweep and 12 fallback VS CPU tests passed.

Reproduce with VK_MS_SWEEP pointing to the built vk_ms_sweep executable and LLVM_MC pointing to AMDGPU llvm-mc: python -I tests/test_ms_sweep_gpu.py. For the standard GPU runner set LEONIDA_W64_EMULATE=1 and run python -I scripts/run_gpu_tests.py --filter ms_wave0_alloc_rounds --require-pass once per LEONIDA_MESH_COMPUTE setting (0 and 1).

AI-assisted. All inputs are hand-written synthetic fixtures.

@jdPhobos

Copy link
Copy Markdown

Tested 74417e1 on AMD Radeon RX 7800 XT (RDNA 3, gfx1101, native 64-wide subgroups 32..64), AMD proprietary driver 26.11.2, Vulkan 1.4.359 (Vulkan SDK 1.4.363.1), Windows 11 x64, MSVC RelWithDebInfo (VS 2026) (first native 64-wide AMD GPU run): mixed — run_gpu_tests.py passes all 4 modes, tests/test_ms_sweep_gpu.py fails with AssertionError: None != 4 on row["native_prims"].

1. scripts/run_gpu_tests.py --filter ms_wave0_alloc_rounds --require-pass: 4/4 PASS

  • Native wave64 (LEONIDA_W64_EMULATE unset) + LEONIDA_MESH_COMPUTE=0: PASS (4096/4096 pixels exact, spirv-val pass)
  • Native wave64 (LEONIDA_W64_EMULATE unset) + LEONIDA_MESH_COMPUTE=1: PASS (4096/4096 pixels exact, spirv-val pass)
  • LEONIDA_W64_EMULATE=1 + LEONIDA_MESH_COMPUTE=0: PASS (4096/4096 pixels exact, spirv-val pass)
  • LEONIDA_W64_EMULATE=1 + LEONIDA_MESH_COMPUTE=1: PASS (4096/4096 pixels exact, spirv-val pass)

2. tests/test_ms_sweep_gpu.py (VK_MS_SWEEP set, LLVM_MC unset): FAIL

Both native and fb translations succeeded (1 shaders: 1 translated, 1 pass spirv-val) and vk_ms_sweep exited 0 (agree, geometry: 1; fallback emitted verts 12, prims 4, bad_pos 0, bad_index 0, over_max 0, unwritten_headers 0), but row["native_prims"] was None instead of 4:

FAIL: test_conditional_allocation_survives_rounds (__main__.MeshAllocation.test_conditional_allocation_survives_rounds)
Traceback (most recent call last):
  File "D:\Leonida\tests\test_ms_sweep_gpu.py", line 44, in test_conditional_allocation_survives_rounds
    self.assertEqual(row["native_prims"], ms_sweep.GROUPS)
AssertionError: None != 4

Synthetic fixtures only; no game files.

@sennecools

Copy link
Copy Markdown

Tested 74417e1 merged onto main 561b65a on Windows 11 with two AMD GPUs: RX 9070 XT (RDNA4, driver 32.0.32029.2010) and Radeon(TM) Graphics iGPU (RDNA2, 32.0.21045). gh pr diff no longer applies to main (runtime/CMakeLists.txt, scripts/run_gpu_tests.py), but the branch merges cleanly.

AI-assisted.

@DavidM1911

Copy link
Copy Markdown

Tested 74417e1 on a mesh-capable Vulkan device, Windows 11, Vulkan SDK 1.4.363, MSVC 14.50, llvm-mc 23.1.6 (AMDGPU, LLVM-MinGW build):

VK_MS_SWEEP=<built vk_ms_sweep> LLVM_MC=<llvm-mc> python -I tests/test_ms_sweep_gpu.py

  • NVIDIA GeForce RTX 3060 Ti (driver 610.88): PASS. Both modes translated and passed spirv-val ("1 shaders: 1 translated, 1 pass spirv-val" native and fb), native and compute agreed on geometry, all 4,096 gradient pixels matched, lowered headers (3,1) in every slot — same shape as your RTX 5070 run.
  • AMD Radeon(TM) Graphics iGPU (Ryzen 9 7900X, gfx1036, driver 24.10.24, maxPushConstantsSize 128): cannot run — vk_ms_sweep exits 77 in both modes with "push constants 128 bytes". Same wall as the other GPU fixtures on this device until the pc-tail path covers the sweep shaders; not a failure of this change. LEONIDA_PC_TAIL_UBO=1 did not change it (the sweep path does not consume it yet).

AI-assisted. Synthetic fixtures only, no game files.

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