Repository navigation
GPU test cs_w64x_carry: carry chains over the 64 lanes of a wave64 - #2415
evilclanker9000 wants to merge 4 commits into
Conversation
v_add_co_u32, v_add_co_ci_u32, v_sub_co_u32, v_subrev_co_u32, v_sub_co_ci_u32 and v_subrev_co_ci_u32 with the carry-out in an SGPR pair or in VCC and the carry-in from an SGPR pair or from VCC, per lane of one 64-lane group. The carry-in mask differs between the two halves, so a mask cut to its low word or with its words swapped shows. The test dumps 922 words (13 ops x 64 lanes, a flag word per lane, s_bcnt1 / s_ff1 of every mask), derived from the ISA pseudocode in the .asm header. The wave32 counterpart is cs_w32_dot4_carry (ItsNotRexed#2311). check.py gets W64X_FULL for wave64 tests judged on a whole dump (--require-wave64, a skip on a device without 64-wide subgroups, no flag with LEONIDA_W64_EMULATE=1). AI-assisted.
AI-assisted.
|
Tested I translated the checked-in synthetic All 60 |
|
Tested
No failures and no skips on this device. A full On the code: |
|
Full run on the same commit ( The single failure is not from this PR: That is #2407: on a device with only 64-wide subgroups the runner judges this wave32 fixture after |
|
Tested cbb7d4f on two GPUs in one laptop, Windows 11, MSVC 19.44, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8 (WSL Debian),
|
|
Tested Test programs built from So the carry chains over the 64 lanes are exact under AI-assisted run on a contributor machine. |
Conflicts: scripts/run_gpu_tests.py tests/test_shader_checks.py AI-assisted.
scripts/run_gpu_tests.py tests/semantic/regen_fixtures.py tests/test_shader_checks.py AI-assisted.
|
Tested 4a4a230 on NVIDIA GeForce RTX 5070 Ti Laptop GPU (Blackwell, 621.24, subgroup 32..32) and AMD Radeon 610M (RDNA2 iGPU, AMD 26.11.2 / 32.0.21045.29003, subgroup 32..64), Windows 11 Home 26200: pass. Same laptop, one GPU at a time through
So the fixture is exact natively on a wave64 RDNA2 device and under emulation on a 32-wide one. One run of each. No game files. AI-assisted (Claude Code). |
|
Tested
Cause: in
Fix: move the new AI-assisted (Claude Code). |
|
Tested
Xbox 1.0.2.1 coverage: 1,509 of 26,503 local |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-W64-CARRY, #2300 (comment)
What and why
The carry ops
v_add_co_u32,v_add_co_ci_u32,v_sub_co_u32,v_subrev_co_u32,v_sub_co_ci_u32andv_subrev_co_ci_u32have a wave32 GPU test (cs_w32_dot4_carry, #2311) but none for wave64, where the carry-out and carry-in are a 64-bit SGPR pair or VCC. This addscs_w64x_carry, one 64-lane group (acs_w64x_*cross-half test):v_sub_co,v_subrev_co,v_sub_co_ci,v_subrev_co_ci, a VOP2v_sub_co_ci_u32with VCC as carry-in and carry-out, and a three-stage VCC chain.0x0ff0a55b_5a5a5a5a, so it differs between the halves, and the boundaries (carry at lane 22, 32, 47) sit on lanes whose carry-in decides the result. A mask cut to its low word, with its words swapped, or a carry-in read from the wrong word changes the output.v_cndmask, so the check does not depend on how an SGPR pair reads as data), ands_bcnt1_i32_b64/s_ff1_i32_b64of every mask..asmheader derives the masks and sample words from the ISA pseudocode;W64X_CARRY_WORDSincheck.pyis the same formulas in plain Python.check.pygetsW64X_FULL, a list of wave64 tests judged on every word of the dump (--require-wave64, a skip where the device has no 64-wide subgroup, no flag underLEONIDA_W64_EMULATE=1), andrun_gpu_tests.pyruns it. The same shader is a semantic fixture (test_w64x_carry_fixture.py: hand constants, a plain-Python model, and the translated shader run on 64 lanes in the wave interpreter). No translator change; it passed as it was.Tested
compute subgroup size: 64):run_gpu_tests.py --filter cs_w64x_carry922/922 words exact.LEONIDA_W64_EMULATE=1(--wave64-emulate, 32-wide subgroups): 922/922 words exact.s_bcnt1_i32_b64of a lane mask counting only the low word (word 896 expected 0x20, got 0, on both devices); dropping the carry that comes from adding the carry-in in the_co_ciops (Radeon: word 257 expected 0x80000000, got 0x7fffffff).python -m unittest discover -s tests/semantic: 2570 tests OK (3 skipped);python tests/semantic/regen_fixtures.py --checkclean;python -I tests/test_shader_checks.pyOK.Checklist
AI-assisted.