Repository navigation
Conversation
|
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean Two more passing tests than main: Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it. |
|
Test run on AMD RDNA4 with native 64-lane waves, the form Not tested lists, and one question about the wave64 semantics. Tested: the PR head
So the native wave64 path, including sending across the halves, is checked on real 64-lane hardware. A question on the wave64 semantics. The translation takes the target lane mod 64, so a lane can send to the other half, and the reversal case asserts that. Not tested: smoke or a retail title, a release build, a wave32 program in 64-lane hardware waves, pixel shaders (helper lanes), the console's own behaviour for AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests and the controls on my PC and wrote this comment. I have not reviewed the code. Update: the new head Tested:
AI use: as above, Claude Code (Claude Opus 5.5) ran the tests and the control on my PC and wrote this update. |
|
Hardware check of Tested
Regression run PR ( Not tested
AI use
|
|
Method. Inline RDNA2 assembly in OpenCL C through AMD's OpenCL driver (the #518 / #772 method), one group of 64 work-items built with
Agreeing with the PR's reference model in every case: of several senders the highest lane wins (a lowest-wins model fails on Effect on this PR (
A possible change in let rla = self.rla_half_fn();
self.line(&format!("uint {t}_a = {a} + {off16}u;"));
self.line(&format!("uint {t} = 0u, {t}_h = lane_id & 0x20u;"));
self.line(&format!("[loop] for (uint {t}_k = 0u; {t}_k < 32u; {t}_k++) {{"));
self.line(&format!(" uint {t}_s = {t}_h | {t}_k, {t}_sa = {rla}({t}_a, {t}_s), {t}_sd = {rla}({v}, {t}_s);"));
self.line(&format!(" if (lanebit_at({el}, {eh}, {t}_s) && (({t}_sa >> 2) & 31u) == (lane_id & 31u)) {t} = {t}_sd;"));
self.line("}");The same tests before (PR head) and after (with this change and the half reference):
The failures are always the #913 trio, which comes and goes between runs (it passed in the last RTX run). Since no lane would read the other half any more, the VS / PS refusal may not be needed; I did not test that. Keeping this in step with the #772 fix for Tested
Not tested
One of the 28 kernels (two senders per target)__kernel void k(__global uint* o) {
uint l = get_local_id(0), lo, L, cnt, r = 0xCAFEBABEu;
__asm__ volatile("v_mbcnt_lo_u32_b32 %0, -1, 0" : "=v"(lo));
__asm__ volatile("v_mbcnt_hi_u32_b32 %0, -1, %1" : "=v"(L) : "v"(lo)); // hardware lane 0..63
__asm__ volatile("s_bcnt1_i32_b64 %0, exec" : "=s"(cnt)); // 64 = native wave64
uint addr = 4u*(L>>1), data = 0x1000u + L;
ulong m = 0xffffffffffffffffUL, saved;
__asm__ volatile(
"s_mov_b64 %1, exec\n"
"s_mov_b64 exec, %4\n"
"ds_permute_b32 %0, %2, %3\n"
"s_waitcnt lgkmcnt(0)\n"
"s_mov_b64 exec, %1\n"
: "+v"(r), "=&s"(saved) : "v"(addr), "v"(data), "s"(m) : "memory");
o[l*4+0] = L; o[l*4+1] = cnt; o[l*4+2] = r; o[l*4+3] = addr;
}The other cases change only AI use: Claude Code (Claude Opus 5.5) wrote the probe kernels and the host, ran them and the tests on my PC, tried the change above and drafted this comment. Update for
AI use: Claude Code (Claude Opus 5.5) compared the commit, ran the probe and the tests on my PC and drafted this update. |
|
Measured
So @4usphs's suspicion is confirmed on RDNA2 hardware: Not tested: XCL's PR branch itself, other GPU generations, or retail titles. |
It was untranslated (the isa_coverage census listed it as missing). Each active lane sends DATA0 to lane ((ADDR + offset) >> 2) & 31 of its own 32-lane half: in wave64 too, as measured on RDNA2 in native wave64 (#925, like ds_bpermute_b32 in #772). Of several senders the highest lane wins, a lane nobody sends to gets 0, inactive lanes neither send nor receive, and no LDS memory is used. Each lane looks at the 32 senders of its half in lane order, through the half-local lane read ds_swizzle uses, so the split wave64 form needs no exchange. In a wave64 VS / PS that may run in 32-lane waves the instruction is refused: the console wave's lanes 32..63 do not exist there. Tests: a GPU test against the measured model (reversal within halves, colliding senders, high address bits, offsets 8 and 128, inactive lanes) in wave32, wave64 and split wave64, and the refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
874a9fd to
c3e3442
Compare
|
Test report for head Setup
Tested:
Correction to my first report: Not tested: pixel shaders with helper lanes; a title that uses the instruction. |
|
@4usphs: no, I didn't consider it. I took the target lane mod 64 from the ISA pseudocode and from XCL's own @KENAJBBY and @certified-retart's measurements settle it. On RDNA2 in native wave64, Pushed
Tested on
AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and wrote this reply. |
|
I checked the With all lanes active and Would you be open to adding the case? It can reuse the existing masked fixtures by seeding I used PortBridge to follow the related Wave64 work in VIctory #439 and keep the separate gather question in #772 linked. AI-assisted with Codex. |
|
@akimfomin Yes, that case is worth having. I get the same values from the model: Could you open it as its own test-only PR, stacked on this one? It only touches @hkgamingdk231-prog thank you for the native wave64 runs. Note that they were on AI use: Claude Code (Claude Opus 5.5) checked the values against the reference model and wrote this reply. |
|
Linux / AMD RDNA3 datapoint. Merged state: head Full suite, Not tested: retail titles (none here), Windows, RDNA4. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Code/CI review only (not independently runtime-tested by me): clean merge with both checks green ( |
|
Thanks for checking the byte-carry values. The stacked test-only PR is open on your |
…-dev#772) Measured on RDNA2 in native wave64, the index for lane l is (l & 32) | (((addr + offset) >> 2) & 31): - RX 6800M (gfx1031), luckyteagirl: xcl-dev#772 (comment) - gfx1036 with partial EXEC and immediate offsets, certified-retart: xcl-dev#772 (comment) XCL masked the index with 63 and read across the halves. - emit.rs: wave64 uses the half-wave index and reads it through rla_half_fn, as ds_swizzle does. As a result: - The split form needs no exchange, so xcl_x_rla_any and its 32-word slot are gone. - In a 32-lane wave of a wave64 VS / PS, the permute can no longer reach lanes 32..63, so the upper_lanes constant case is gone. - upper_lanes.rs: ds_bpermute is no longer a read of lanes >= 32. ds_permute is unchanged (xcl-dev#925). - docs/wave64-on-wave32.md: ds_bpermute is now listed with the reads that stay inside their half. New test gpu_ds_bpermute_wave64_stays_in_its_half: the three full-EXEC indices, offsets 4 and 128, and EXEC 0xAAAAAAAA_55555555, expected values from the measured model. On main 6efdabc it gives 226 wrong lanes. Three existing assertions that encoded the cross-half reading now expect the half-wave lanes: - gpu_format_stores_atomics_global_lds: l ^ 31 - gpu_split_wave64_cross_half_operations: l ^ 31 - gpu_split_wave64_waves_diverge: l ^ 1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-dev#772) Measured on RDNA2 in native wave64, the index for lane l is (l & 32) | (((addr + offset) >> 2) & 31): - RX 6800M (gfx1031), luckyteagirl: xcl-dev#772 (comment) - gfx1036 with partial EXEC and immediate offsets, certified-retart: xcl-dev#772 (comment) XCL masked the index with 63 and read across the halves. - emit.rs: wave64 uses the half-wave index and reads it through rla_half_fn, as ds_swizzle does. As a result: - The split form needs no exchange, so xcl_x_rla_any and its 32-word slot are gone. - In a 32-lane wave of a wave64 VS / PS, the permute can no longer reach lanes 32..63, so the upper_lanes constant case is gone. - upper_lanes.rs: ds_bpermute is no longer a read of lanes >= 32. ds_permute is unchanged (xcl-dev#925). - docs/wave64-on-wave32.md: ds_bpermute is now listed with the reads that stay inside their half. New test gpu_ds_bpermute_wave64_stays_in_its_half: the three full-EXEC indices, offsets 4 and 128, and EXEC 0xAAAAAAAA_55555555, expected values from the measured model. On main 6efdabc it gives 226 wrong lanes. Three existing assertions that encoded the cross-half reading now expect the half-wave lanes: - gpu_format_stores_atomics_global_lds: l ^ 31 - gpu_split_wave64_cross_half_operations: l ^ 31 - gpu_split_wave64_waves_diverge: l ^ 1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ds_permute_b32was untranslated (theisa_coveragecensus lists it as missing; no open PR or issue covers it). It is the forward form ofds_bpermute_b32. Each active lane sends DATA0 to lane((ADDR + offset) >> 2) & 31of its own 32-lane half, in wave64 too. That was measured on RDNA2 in native wave64 in the comments below (by @KENAJBBY and @certified-retart), and it matchesds_bpermute_b32in #772. Of several senders to one lane the highest-numbered one wins, a lane no active lane sends to gets 0, inactive lanes neither send nor receive, and no LDS memory is used.The first version of this PR (
874a9fd) took the target mod 64 and could send across the halves. It was wrong on the hardware, and its test agreed with it only because the reference model had the same mistake.What is in it
crates/xcl/src/gpu/recomp/emit.rs: each lane looks at the 32 senders of its half in lane order throughrla_half_fn, asds_swizzledoes, so the highest active sender wins. The split wave64 form needs no exchange. In a wave64 VS / PS that may run in 32-lane waves the instruction is refused: lanes 32..63 of the console wave don't exist there, andupper_lanesdoesn't model this instruction's writes to them.crates/xcl/src/gpu/recomp/tests.rs:gpu_ds_permute_b32compares against the measured model in wave32, wave64 and split wave64. The cases are a reversal (within each half), two senders per lane with high address bits set, offset 8 (wrapping in its half), offset 128 (the identity), and inactive senders and receivers.ds_permute_b32_refused_where_upper_lanes_do_not_existchecks the refusal, and that compute and non-split pixel modes translate. Against the first version's translation the GPU test fails:wave64 split=true lane 1: v10,left: 4158,right: 4126(lane 62's value where the hardware gives lane 30's).Tested
c3e3442, rebased ontomain6bac4b4stable-x86_64-pc-windows-msvc, debug, DXC 1.9.2602.17cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 721 passed, 0 failed, 41 ignoredgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware; noXCL_SAMPLE_*setRegression run
main:This PR:
Not tested
AI use
🤖 Generated with Claude Code