Compute groups that are not whole waves: padded where the program can tell #245
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!245
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-245"
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?
@Kalmarv on GitHub · 2026-11-23 21:46 UTC · original
Kalmarv:fix/cs-pad-partial-waves→main· +828 −16 · 6 files · 1 commits · openThis is the compute side of the gap #152 names under "Not covered": lanes the PC never launched. It was offered in https://github.com/ivall/xcl/pull/152#issuecomment-7113450434.
A console wave always has all its lanes; a PC group of 40 threads has only 40. The lanes the PC never launches are still visible to a program:
v_writelanewrites them, and code that turns on EXEC runs in them. This PR launches those lanes for compute programs that can tell, inactive as on the console.One commit,
2fcb095, onmain08db802: +828 / -16, about 335 lines of translator code and about 510 of tests. That is over ~800 because of the tests; the translator change is one gate and its pass, which don't split into parts that are useful alone.2fcb095is63a55a0rebased onto newermain.git range-diffshows only whatmainchanged around it: a fieldmainrenamed (x64_whole_livetomask_whole_live),main'sXCL_DXIL_NO_OPTbeside this PR's two switches incache_allowedand its test, andsuccessorsinupper_lanes.rs, whichmainalready makespub(super).63a55a0is041772crebased with one conflict:Options::default()incrates/xcl/src/gpu/recomp/mod.rs, where #680 addedheap_windowsand this PR addspad_waves; the line keeps both (git range-diff: no other line changed).041772cwas761144drebased (two conflicts, resolved as @Rednaxeh did:emit.rs, the prelude then the padding;pso.rs, all four switches incache_allowedand its test), plus the two review fixes below. The earlier heads were887ae29andba63366(the same patch, rebased) and3aaef99, which added the fix for 64-bit writes to NULL that @JGonzalezRodriguez found (below).761144dis3aaef99rebased frommain9ab7d76, without conflicts and without a changed line (git range-diff:=).What is in it
What was wrong:
v_writelanewrites the inactive lanes whatever EXEC is.s_or_saveexec_b64 s, -1around whole-wave code,s_mov_b64 exec, -1,s_not_b64 exec, exec,s_wqm_b64 exec, exec.Measured on
main956a476(RTX 5070 Ti, split form; the same withXCL_X64_ALL_MASKS=1andXCL_WAVE64_SPIN=1). Expected values are the ISA's definition, not a console measurement:s_not_b64 exec, exec, then bits ofv_cmp_eq_u32 vcc, v0, v0s_or_saveexec_b64 s, -1, then the samev_movunder EXEC = -1,v_readlaneof lane 63Wave32 programs have the same gap in groups that are not a multiple of 32. It is not the split form's doing: it happens on every GPU and at both wave sizes.
The change: for compute, the missing lanes can simply be launched.
[numthreads(64, 1, 1)]for 40 threads, 1-D whatever the console's shape.thread index < 40.Which programs are padded:
crates/xcl/src/gpu/recomp/partial_waves.rs). Every other program keeps its group and its HLSL byte for byte (compute_groups_are_padded_only_where_the_program_can_tell).v_writelaneto a lane the last wave may not launch, or when EXEC may get a bit outside the launched lanes.3aaef99, the pass wrote its high word to s126 (EXEC_LO), andupper_lanes::sgpr_outputslisted a null SDST / VDST as two registers. With EXEC_HI 0,s_or_saveexec_b64 null, 0xFFFFFFFFwas then not seen as turning lanes on, ands_and_saveexec_b64 null,s_and_b64 nulland a VOP3v_cmpto null padded for nothing. @JGonzalezRodriguez found this.S_*_SAVEEXEC_B64/S_*_WREXEC_B64writes EXEC_LO and SDST only, as the translator emits it, so the pass usesb64 && wave64for them (@JGonzalezRodriguez's minor point).XCL_CS_PAD_ALL=1pads every group that is not whole waves, andXCL_NO_CS_PAD=1pads none. Both are for comparison and bypass the shader caches.s_barriercounts the group's hardware waves with its padding: in the split form a group of 32 threads or fewer padded to 64 is two hardware waves, and keeps the group sync (xcl_s_barrier). Before, the count was taken before the padding was decided, and such a group got a bareGroupMemoryBarrier().This is narrower than what I offered in the #152 comment (pad every partial group). I gated it so that programs that cannot tell keep their HLSL and pay nothing;
XCL_CS_PAD_ALL=1is the ungated form.The HLSL a padded program gets: no wave intrinsic that the translator does not already emit, and none in a new position.
[numthreads(N, 1, 1)], with N the next multiple of the console wave size.The entry ballot's argument is
ballot(gi < 40u)instead ofballot(true)(xcl_x_ballotin the split form). It is the same function in the same place.Split form (32-lane hardware):
XCL_X_THREADSis the padded count.xcl_x_threadand the exchange are unchanged.Native form (64-lane hardware): a padded group takes its threads through the prologue that every 2-D / 3-D compute group already has:
WaveActiveCountBits(true),WaveIsFirstLane;InterlockedAddon the groupshared counter,WaveReadLaneFirst;The only new thing is that a 1-D group can get it.
A padded group's thread count is a multiple of the hardware wave size, so the driver has no partial last wave to form for it. A padded program's wave operations therefore run in fewer partial waves than before, not more. The body of the program is translated as before.
Tests:
gpu_wave64_valu_code_in_lanes_not_launchedandgpu_wave32_valu_code_in_lanes_not_launched: one program, run in 1-D, 2-D and 3-D groups. It:s_not exec, execand afters_or_saveexec s, -1;v_writelanewrote.Both fail without the change. Each also runs with
PadWaves::Never(the translationmainmakes) and requires every partial wave to differ: 11 and 5 of them.gpu_padded_compute_groups_look_the_same_to_the_program: these are the same padded or not:s_barrier, and one atomic per thread.No padding lane stores.
gpu_wave64_saveexec_to_null_turns_on_lanes_not_launched: @JGonzalezRodriguez's case on the GPU. In a group of 20 threads,s_or_saveexec_b64 null, 0xFFFFFFFFwith EXEC_HI 0 turns on lanes 20..31, so a compare counts 32 lanes. Unpadded (PadWaves::Never), it counts 20.CPU:
partial_waves::tests(9),compute_groups_are_padded_only_where_the_program_can_tellanda_padded_group_barrier_counts_its_padding_waves. Two of the nine are for the null writes,a_saveexec_to_null_that_widens_exec_is_seenandmasks_discarded_into_null_leave_exec_alone; both fail without the fix in3aaef99.a_wave32_saveexec_b64_writes_one_wordanda_padded_group_barrier_counts_its_padding_wavesfail without the two review fixes in041772c.Tested
cargo test --workspace -- --test-threads=4(debug) on2fcb095, this change rebased ontomain08db802: 1444 passed, 0 failed, 47 ignored (thexcllibrary: 1319 passed, 27 ignored). SKIPPED: 25 notices from 15 GPU tests (21 for no wave64, three refused per-lane cases, one for no heap windows). On the previous base3f27770,lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrierfailed, both with this change and without it.main's #2420 has since rewritten that test, and it passes here.2fcb095, thank you:cargo test --release -p xcl --lib -- --test-threads=4, Windows 11 Pro, the head checked out as is (#245):fuzz_validate_and_gpu_1and_3, the AMD fuzz seeds of #2115, which fail the same way onmainon that card. There is no "no wave64" SKIPPED line, so the wave64 tests ran natively. SKIPPED: the six refused per-lane cases andpso_measurement_compiles_an_exact_synthetic_record(the driver cache can't be turned off there).63a55a0: 742 passed, 0 failed, 21 ignored on both cards, with no SKIPPED line on the RX 9070 XT.2fcb095merged with currentmain, thank you:cargo test -p xcl --lib(the library only, not the workspace), all passed, 0 failed, 27 ignored (#245).041772c, onmain930e8b4: 766 passed, 0 failed, 41 ignored (thexcllibrary: 722 passed, 21 ignored), the same two "no wave64" SKIPPED tests.gpu::recomp::: 204 passed, 0 failed, 18 ignored. The 15 tests of this PR: 15 passed.761144d, onmaindd2ae9a: 703 passed, 0 failed, 41 ignored (thexcllibrary: 663 passed, 21 ignored). SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, both "no wave64".gpu::recomp::: 196 passed, 0 failed, 18 ignored. The 13 tests of this PR: 13 passed.3aaef99, onmain9ab7d76: 664 passed, 0 failed, 40 ignored, with the same two SKIPPED tests. That wasba63366's 661 and the three new tests.gpu::recomp::: 195 passed, 0 failed, 18 ignored.3aaef99, built with and without it (the same tests in both):partial_waves::: 8 of 8 pass with the fix, and both new CPU tests fail without it.gpu_wave64_saveexec_to_null_turns_on_lanes_not_launchedpasses with the fix. Without it, every thread counts 20 lanes instead of 32.ba63366, on our machine: 661 passed, 0 failed, 40 ignored, with the same two SKIPPED tests.3aaef99, merged ontomain4017f8f(a clean merge), on an RTX 5070 Ti (NVIDIA 617.42) and on the AMD RDNA2 iGPU of a Ryzen 7 9800X3D (driver 32.0.21030.2001, native 64-lane waves, native Windows D3D12). Windows 11 Pro 25H2, rustc 1.100.0, debug (https://github.com/ivall/xcl/pull/245#issuecomment-7116600940):scripts/test.ps1: 665 passed, 0 failed, 40 ignored on both adapters;main4017f8fgave 652 / 0 / 40 on both.gpu_wave64_saveexec_to_null_turns_on_lanes_not_launchedincluded, ran in native 64-lane waves there.XCL_CS_PAD_ALL=1: 13 passed on both. WithXCL_NO_CS_PAD=1: 10 passed and 3 failed on both, the three GPU tests in their padded half, as expected.ba63366(main9ab7d76+ this commit), on an RX 7800 XT (RDNA3, native 64-lane waves, driver 32.0.32029.2010), Ryzen 7 7800X3D, Windows 11 Pro 26300, rustc 1.100.0, withXCL_REQUIRE_GPU=wave64,mesh(https://github.com/ivall/xcl/pull/245#issuecomment-7116934566):scripts/test.ps1, debug and release: 661 passed, 0 failed, 40 ignored, 0 SKIPPED;main9ab7d76gave 651 / 0 / 40.gpu::recomp::: 192 / 0 / 18 natively, and the same withXCL_SPLIT_WAVE64=1,XCL_CS_PAD_ALL=1,XCL_WAVE64_SPIN=1andXCL_X64_ALL_MASKS=1.XCL_NO_CS_PAD=1, both…_valu_code_in_lanes_not_launchedtests fail in every partial wave, natively on 64-lane hardware too.3aaef99merged ontomain2b4bb43, on an RTX 5060 Ti, debug, with the debug-layer tests enabled:cargo test --workspace, 683 passed, 0 failed, 41 ignored; the only SKIPPED tests are the two "no wave64" ones (https://github.com/ivall/xcl/pull/245#issuecomment-7117533279).ba63366and887ae29, which carry the same patch.3aaef99differs from them only by the null-write fix and its tests (git diff ba63366 3aaef99:partial_waves.rs,upper_lanes.rs,tests.rs).ba63366:cargo test --workspace, 661 passed, 0 failed, 40 ignored (main: 651 passed), and the 10 new tests pass (https://github.com/ivall/xcl/pull/245#issuecomment-7115577746).ba63366:cargo test --workspace, 661 passed, 0 failed, 40 ignored (https://github.com/ivall/xcl/pull/245#issuecomment-7115668691).887ae29(the same patch asba63366), on an RTX 4090 (wave32 hardware, wave64 split) and on an AMD Raphael RDNA2 iGPU (RADV 26.2.4, native wave64), both under Proton with vkd3d-proton on Linux, debug (https://github.com/ivall/xcl/pull/245#issuecomment-7115935021):partial_waves::tests6/6 and the four new tests 4/4 on both GPUs.XCL_NO_CS_PAD=1, and with the two GPU tests on base60565c4), both…_valu_code_in_lanes_not_launchedtests fail on both GPUs.gpu::recomp::: 192 passed, 0 failed, 18 ignored on the RTX 4090. On RADV: 189 passed, 3 failed, 18 ignored, also withXCL_CS_PAD_ALL=1. The three (gpu_f64_roots,gpu_f64_math_random,gpu_nonfused_mad_and_mac_prevent_fma_contraction) fail the same way on base60565c4.887ae29(main60565c4+ the same patch):<lib test exe> --exact … --test-threads=1), in three forms of the split (default,XCL_X64_ALL_MASKS=1,XCL_WAVE64_SPIN=1): 4 passed, 0 failed in each.XCL_NO_CS_PAD=1, which makes the translationmain's), both…_valu_code_in_lanes_not_launchedtests fail in every partial wave. For example:[24, 64, 7, 33], got[0, 40, 7, 0];[12, 32, 7, 33], got[0, 20, 7, 0].gpu::recomp::test (<lib test exe> gpu::recomp:: --test-threads=2):XCL_CS_PAD_ALL=1(every partial compute group padded)XCL_WAVE64_SPIN=1XCL_X64_ALL_MASKS=1XCL_X64_ALL_MASKS=1aregpu_split_wave64_lane_local_masksandgpu_split_wave64_local_and_exchanged_masks_in_diverging_waves. They assert that masks stay in their half, which that switch turns off. They failed the same way withmain's translator when I ran it onaf20b4b.cargo test --workspace --no-fail-fast -- --test-threads=2: 661 passed, 0 failed, 40 ignored (lib: 621 / 0 / 20).main9ab7d76and the previous headba63366(which differs only by the null-destination fix): 1262 and 1261 frames in 60 s, no crash or device removal (https://github.com/ivall/xcl/pull/245#issuecomment-7116934566).Overlaps:
1058c0b(#136, TG_SIZE) changed one constant: the wave count in the TG_SIZE SGPR is now the ceiling, so a program is told that a last, partial wave exists. That wave still has only the lanes the PC launched. This PR does not touch TG_SIZE (the line is unchanged, and a test checks that the value is the same padded or not); it gives the partial wave its missing lanes.gpu/recomp/mod.rswhere this PR does.63a55a0conflicted with itsdfc5578there; this head2fcb095merges with it without a conflict (git merge-tree).docs/wave64-on-wave32.mdsays that "the console group keeps itsnumthreads". With this PR, a compute program that can tell gets a padded group instead. The doc is not edited here.Regression run
Our own runs with
scripts/smoke.ps1, 120 s each, one after the other on the machine under Tested (RTX 5070 Ti), release builds from clean trees, on the direct route:XCL_DIRECT_DXIL=1, each run with its own XCL cache that starts from the same list of used pipelines (the driver's own cache untouched).mainat08db802(this PR's base), then this PR's head2fcb095. Themainrun is shared: one run serves this PR and #2098 and #350. All of these ran as one queue job, after one uncounted warm-up run ofmain(the title ran from a second exe path, whose driver cache starts cold). The job was queued to run beside a CPU-bound pipeline precompile on the same machine, but that precompile ended during the warm-up, so none of the runs above had it beside them.main:
PR:
PR vs
main: 1313 / 1313 frames (100 %), peak commit 28829 / 29957 MB (96 %); device removals 0 and crashes 0 on the PR run, 0 and 0 onmain.Not tested
ba63366, before the null-write fix;3aaef99;887ae29.AI use
dd2ae9aand its runs; Claude Code (Claude Opus 5.5), the rebase onto930e8b4, the two review fixes and their tests, and these runs; Claude Code (Claude Opus 5.5), the rebase onto9e3831eand its run🤖 Generated with Claude Code
github-bot referenced this pull request2026-11-26 04:20:57 +00:00
github-bot referenced this pull request2026-11-26 04:59:09 +00:00
github-bot referenced this pull request2026-11-26 05:18:41 +00:00
@denio4321 on GitHub · 2026-11-23 22:17 UTC · original
Tested
ba63366merged ontomain9ab7d76on RTX 3060 12 GB (Ampere, 32-lane waves), NVIDIA 610.88, Windows 11 Pro 23H2 (22631), rustc 1.100.0 MSVC, DXC 1.9.2602.17: pass..\scripts\test.ps1(debug,--test-threads=4), noXCL_SAMPLE_*set. Baselinemain9ab7d76alone on the same machine: 651 passed, 0 failed, 40 ignored.gpu_wave64_valu_code_in_lanes_not_launchedandgpu_wave32_valu_code_in_lanes_not_launchedpass here; the wave64 one runs in the split form (two hardware wave32s per console wave).gpu_padded_compute_groups_look_the_same_to_the_programandcompute_groups_are_padded_only_where_the_program_can_tellpass, and so do the sixpartial_waves::tests.main(no wave64).Not run: the new tests without the
emit.rschange (the negative control), or any game.AI-assisted (Claude Code).
@PHeitor1 on GitHub · 2026-11-23 22:22 UTC · original
Tested on RTX 5060 Ti 8 GB, driver 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native), Rust 1.100.0 msvc, debug.
cargo test --workspace --no-fail-fast -- --test-threads=4on the headba63366: 661 passed, 0 failed, 40 ignored (main9ab7d76: 651 / 0 / 40, so +10 new tests, all green on a 32-lane NVIDIA). SKIPPED: only the usual twono wave64(gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware).Run and written with Claude Code (Claude Opus 5.5).
@JGonzalezRodriguez on GitHub · 2026-11-23 22:35 UTC · original
Tested commit
887ae29(on base60565c4; also verified the current rebased headba63366has zero diff inpartial_waves.rs,upper_lanes.rs, andemit.rs) on both wave32-only hardware (NVIDIA RTX 4090) and native wave64 hardware (AMD Raphael RDNA2 / RADV).Tested
wine+ relaxedvkd3d-proton(30b0eb9), DXC1.9.2609.5, cross-builtx86_64-pc-windows-msvcdebug (rustc 1.98.1,clang-cl 23.1.1+lld-link,0 errors, 0 warnings).610.57.4, wave32 / split wave64)radv 26.2.4, native wave64 + wave32)partial_waves::testsXCL_WAVE64_SPIN=1)XCL_X64_ALL_MASKS=1)XCL_SPLIT_WAVE64=1)XCL_NO_CS_PAD=1)gpu::recomp::(default)gpu::recomp::(XCL_CS_PAD_ALL=1)60565c4negative control (2 new GPU tests carried onto base)* On AMD RADV, the 3 failures (
gpu_f64_roots,gpu_f64_math_random,gpu_nonfused_mad_and_mac_prevent_fma_contraction) also fail identically 3/3 on base60565c4(pre-existing RADV f64rsq/ f32 FMA quirks; zero regressions from this PR, including underXCL_CS_PAD_ALL=1). Native wave64 execution on RADV was verified viagpu_wave32_program_in_wave64_hardwarerunning without skipping.The native wave64 reorder prologue,
XCL_WT/xcl_lds[8191u]barrier handoff,TG_SIZE, barriers, and split-wave64 paths all behave cleanly on both GPUs.Findings
1. 64-bit writes with
SDST/VDST = null(125) clobberst.s[126](EXEC_LO)State::setignoresr == 125, so the low-word write tonullis skipped, but 64-bit writes still callst.set(dst + 1, ...)=st.set(126, ...), overwritingEXEC_LOin three places:partial_waves.rs:137-141(SAVEEXEC/WREXEC:st.set(dst + 1, ...))partial_waves.rs:160-163(ENC_SOP1/ENC_SOP2:st.set(dst + 1, hi))partial_waves.rs:173-180viaupper_lanes::sgpr_outputs(upper_lanes.rs:497, 509), which returns(125, 2)whenSDST/VDST == 125(including SDWASD=1).This causes both a false negative (missed padding) and false positives (spurious padding) on partial waves with
launched < 32(reproduced on both RTX 4090 and AMD RADV with a[20, 1, 1]wave64 group):s_mov_b32 exec_hi, 0; s_or_saveexec_b64 null, 0xFFFF_FFFFwidensEXEC_LOto0xFFFF_FFFF(activating lanes 20..31), settingst.s[126] = 0, which is immediately overwritten byst.set(126, eh)(LO | HI) before line 205 checksst.s[126] & LO == 0.sees_lanes_not_launchedreturnsNone, the shader stays unpadded, andv_cmp_eq_u32 vcc, v0, v0; s_bcnt1_i32_b64returns20instead of32(PadWaves::Alwaysreturns32).null—s_and_saveexec_b64 null, vcc,s_and_b64 null, exec, vcc, andv_cmp_gt_u32 null, v0, v1(ENC_VOP3) — overwritest.s[126]witheh(HI, lackingLO) and spuriously pad the group.Guarding
dst != 125before writing 64-bit pairs inpartial_waves.rs(e.g. aset64helper) and skippingv == 125inupper_lanes::sgpr_outputsfixes all three paths cleanly.(Minor: in
partial_waves.rs:138,if b64could also beif b64 && wave64to matchemit.rs:1118.)Not tested
ba63366(verified zero diff vs tested887ae29inpartial_waves.rs/upper_lanes.rs/emit.rs), retail titles.AI use
Antigravity (Gemini frontier model) assisted with code review, dual-GPU test execution, and drafting this report; every line cited and repro result was directly verified on this host.
@Kalmarv on GitHub · 2026-11-23 22:39 UTC · original
@JGonzalezRodriguez thank you, and for the RADV wave64 run. Finding 1 holds as you describe:
State::setskips 125, but the second word of a 64-bit write tonulllands on 126, andsgpr_outputsreturns(125, 2)for anulldestination. A fix with your cases as tests (the missed pad and the three spurious ones) is coming as a push to this PR, with you credited in the description; I'll also check theb64 && wave64point againstemit.rs. I'll ask for smoke runs once the new head is up.🤖 Claude Opus 5.5
@regiumlepidi on GitHub · 2026-11-23 23:08 UTC · original
Tested the new head
3aaef99merged onto currentmain4017f8f(clean merge) on native 64-lane hardware under Windows – an AMD RDNA2 iGPU – and on an NVIDIA RTX 5070 Ti, withmain4017f8fas the baseline on both: pass on both.Tested
XCL_ADAPTER=radeon.\scripts\test.ps1(cargo test --workspace -- --test-threads=4), noXCL_SAMPLE_*setmain4017f8fmain4017f8f3aaef99on4017f8f3aaef99on4017f8fgpu_wave64_valu_code_in_lanes_not_launched,gpu_wave64_saveexec_to_null_turns_on_lanes_not_launched(the null-saveexec case from the RADV review),gpu_wave32_valu_code_in_lanes_not_launchedandgpu_padded_compute_groups_look_the_same_to_the_programall pass, as do the 8partial_waves::testsandcompute_groups_are_padded_only_where_the_program_can_tell. ThePadWaves::Neverhalves of those tests (11 and 5 differing waves, the unpadded count of 20) hold on both adapters too.The switches, the 13 tests above only (
cargo test -p xcl --lib -- lanes_not_launched padded_compute compute_groups_are_padded partial_waves):XCL_CS_PAD_ALL=1XCL_NO_CS_PAD=1With
XCL_NO_CS_PAD=1the three GPU tests fail in theirWhereSeenhalf, as expected, since the switch turns it intoNever: e.g. on the iGPUgroup [40, 1, 1] wave 0 (40 lanes) | want [24, 64, 7, 33] | got [[0, 40, 0, 0]], and the null-saveexec case counts 20 instead of 32. So on 64-lane hardware too the padding is what makes them pass.Regression run
Not tested
scripts/smoke.ps1on a real title, main or this head; how many of a title's compute programs get padded.AI use: Claude Code with Claude Opus 5.5 ran the builds and tests and wrote this report; the numbers come from those runs.
@Rednaxeh on GitHub · 2026-11-23 23:25 UTC · original
RDNA3: Radeon RX 7800 XT (native 64-lane waves) on
ba63366: 661 passed, 0 failed; the new tests fail without the change here too; retail title runs the same asmainFirst AMD run of this PR, as asked under Not tested, plus a regression run on a retail title. Tested
ba63366, which ismain9ab7d76plus this PR's commit (fast-forward, so head = merge result), with no uncommitted changes. NoXCL_SAMPLE_*variables set for the test suite.x86_64-pc-windows-msvc, debug (release where said); DXC 1.9.2602.17 (Windows SDK 10.0.26100); system XGameRuntime 10.0.26100.9656Whole suite –
.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4) withXCL_REQUIRE_GPU=wave64,mesh, so a skipped GPU test would have failed: 661 passed, 0 failed, 40 ignored, 0 SKIPPED (lib 621 / 0 / 20).main9ab7d76alone on this machine, same command and switch, earlier today: 651 / 0 / 40, 0 SKIPPED. The 10 extra passes are this PR's tests: the 6 unit tests inpartial_waves.rs,compute_groups_are_padded_only_where_the_program_can_tell, and the 3 GPU tests.gpu::recomp::(cargo test -p xcl --lib -- gpu::recomp:: --test-threads=2,XCL_REQUIRE_GPU=wave64,meshthroughout):XCL_SPLIT_WAVE64=1(the 32-lane split form on AMD)XCL_CS_PAD_ALL=1XCL_WAVE64_SPIN=1XCL_X64_ALL_MASKS=1Under
XCL_X64_ALL_MASKS=1the twogpu_split_wave64_*_masks*tests that fail on the RTX 5070 Ti pass here: on native 64-lane waves there is no split for that switch to act on.The four new tests by exact name (
--exact --test-threads=1): 4 passed in each of the five forms (native,XCL_SPLIT_WAVE64=1,XCL_CS_PAD_ALL=1,XCL_WAVE64_SPIN=1,XCL_X64_ALL_MASKS=1).Release:
cargo build --release --workspace+cargo test --release --workspace -- --test-threads=4,XCL_REQUIRE_GPU=wave64,mesh: 661 passed, 0 failed, 40 ignored, 0 SKIPPED, the same as debug.Without the change (
XCL_NO_CS_PAD=1, same four tests):gpu_wave64_valu_code_in_lanes_not_launchedandgpu_wave32_valu_code_in_lanes_not_launchedfail in every partial wave, as on NVIDIA; the other two pass. So the native thread-counter prologue on 64-lane hardware, which the description lists as untested, takes the padded form here and the test catchesmain's translation on it. Examples, verbatim (want/gotas the test prints them):One difference from the NVIDIA failure quoted in the description (
got [0, 40, 7, 0]): natively on this GPU the third word is0, not7, in every case. I have not looked into why; it is the unfixed path either way.Regression run –
scripts/smoke.ps1 -Game <folder>on a retail title, release builds, no uncommitted changes, same machine, the five runs one after the other in this order. All five: exit 0x0, 0 device removals, 0 crashes. Thegpu:line names the wrong adapter (the script's known issue, #281 / #282 / #285); the GPU was the RX 7800 XT. Blocks unedited.main, first run on an emptycache/(the #284 first-run window; a warm-up, not for comparison):main, second run:mainagain, right after:Reading: the consecutive pair 4 / 5 is 1261 vs 1262 frames and 16236 vs 16302 MB peak, so no difference between this PR and
mainon this title. The spread between runs of the same build (main1470 → 1262) is far larger than any main / PR difference, and the near-zero presents at the end of runs 4 and 5 appear on both builds alike, so they come from where the title is by then (it stops presenting in its last seconds), not from this PR. Run 3's lower count and its14are what a first run with new shader translations looks like; run 4 does not repeat it.Not tested: how many of the title's compute programs get padded (not counted); which screen the title reaches, and why it stops presenting near the end of runs 4 and 5, was not looked at; no RDNA4 / RDNA2 (this machine has one GPU).
Report written with Claude Code (Claude Fable 5.1) from the runs above; the commands and counts are from this machine.
@Kalmarv on GitHub · 2026-11-23 23:28 UTC · original
@Rednaxeh thank you, the first AMD run and the first regression runs this PR has. One catch: after @JGonzalezRodriguez's finding above, the head moved to
3aaef99. The only change fromba63366is the null-destination fix inpartial_waves.rs/upper_lanes.rsand its tests (git diff ba63366 3aaef99). The PR check wants the PR's block made on the head commit. If you can, a singlescripts/smoke.ps1run built from3aaef99, same title and length, is all it needs; yourmainblocks still count. Your results go into the description either way, with your name and hardware.🤖 Claude Opus 5.5
@PHeitor1 on GitHub · 2026-11-23 23:56 UTC · original
Re-tested the new head
3aaef99merged ontomain2b4bb43(clean merge) on RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug,cargo test --workspace --no-fail-fast -- --test-threads=4, noXCL_SAMPLE_*.Pass: 683 passed, 0 failed, 41 ignored. SKIPPED: only the 2
no wave64tests.Run and written with Claude Code (Claude Opus 5.5).
@Kalmarv on GitHub · 2026-11-24 01:14 UTC · original
@Rednaxeh no need for a run at
3aaef99any more: we have our own copy of the title now, and our pair at3aaef99is in the description. Thanks again for the earlier ones.🤖 Claude Opus 5.5
@Rednaxeh on GitHub · 2026-11-24 11:40 UTC · original
@Kalmarv three things the PR needs now, from a second RX 7800 XT (driver 32.0.32029.2010, Ryzen 7 7800X3D, 32 GB, Windows 11 26300, release builds):
1. The branch no longer merges into
main(47efa2e): two small conflicts, both "both sides added a line at the same place":emit.rs, the computemainprologue:mainaddedself.safe_barrier_prelude(&mut h);where this PR addslet [nx, ny, nz] = padded.map_or([x, y, z], |t| [t, 1, 1]);– keep both, the prelude first.pso.rs(cache_allowedand its test):mainaddedXCL_X64_ALL_MASKS/XCL_WAVE64_SPINto the variables that disable the shader cache, this PR addsXCL_CS_PAD_ALL/XCL_NO_CS_PAD– the list wants all four, in both places.I have the merge resolved that way locally (
65f966f=47efa2e+761144d, nothing else changed); I can push it as a branch if it saves you the rebase.2. That merge still passes here.
XCL_REQUIRE_GPU=wave64,mesh:gpu::recomp::201 passed, 0 failed, 18 ignored (the PR's four tests included);.\scripts\test.ps1: 753 passed, 0 failed, 41 ignored, 0 SKIPPED.3. A smoke pair on the same
main, release builds, no uncommitted changes, one after the other, no other load (a first run of the merge that overlapped a test run is left out). Both blocks unedited.main47efa2e:the merge
65f966f:Frames 96 % of
main's, peak commit +10 %, no device removal, no crash: within the check's bounds. (On today'smainthe minute ends in the world loading on this card, hence the low last-3 on both.) The check itself wants the PR's block made on this PR's head, so after your rebase I'll run it once more on that commit – say the word.AI use: Claude Code (Claude Fable 5.1) found and resolved the conflicts and wrote this; the runs were mine.
@Kalmarv on GitHub · 2026-11-24 15:20 UTC · original
Rebased onto
main930e8b4as041772c(one commit; whole suite on an RTX 5070 Ti: 766 passed, 0 failed, 41 ignored, 2 SKIPPED for no wave64). The smoke pair for this head follows in the description.@Rednaxeh: the two conflicts are resolved the way you did it (
emit.rs: the prelude, thenpadded;pso.rs: all four variables incache_allowedand its test). Thanks for the merge and the RX 7800 XT pair; we'll run our own pair on the new head.Two fixes, squashed into the PR's commit:
s_barrierin a padded group. The barrier choice (compute_or_mesh_hw_waves) counted the group's threads without the padding, before the padding was decided. In split wave64 a group of 32 threads or fewer is padded to 64, two hardware waves, but was counted as one, sos_barrierlost its group sync. The count now includes the padding and is taken after it is decided. Test:a_padded_group_barrier_counts_its_padding_waves(fails without the fix).S_*_SAVEEXEC_B64/S_*_WREXEC_B64is translated as the 32-bit form (EXEC_LO and SDST only), butpartial_wavesmodelled it as 64-bit, so it could take EXEC_HI and SDST+1 as launched-lane subsets and not pad. The step now usesb64 && wave64. Test:a_wave32_saveexec_b64_writes_one_word(fails without the fix).AI use: Claude Code (Claude Opus 5.5)
@Kalmarv on GitHub · 2026-11-24 17:44 UTC · original
Rebased onto
main9e3831eas63a55a0. One conflict:Options::default()incrates/xcl/src/gpu/recomp/mod.rs, where #680 addedheap_windowsand this PR addspad_waves; the line keeps both.git range-diffagainst041772cshows no other changed line.Tested (RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 Pro 26200, debug)
cargo test --workspace -- --test-threads=4on63a55a0: 791 passed, 0 failed, 41 ignored (thexcllibrary: 742 passed, 21 ignored). SKIPPED:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64), andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows; #680's test).A smoke pair for
63a55a0againstmain9e3831efollows in the description. @Rednaxeh, if your offer (7130411564) still stands, a rerun of your RX 7800 XT pair on63a55a0would cover wave64 hardware for the rebased head.AI use: Claude Code (Claude Opus 5.5)
@raylitebull on GitHub · 2026-11-25 01:08 UTC · original
CI checks (
Build and testandPR description) are green on63a55a0.Remaining before merge: an independent AMD GPU pass on the current revised head
63a55a0.@Kalmarv on GitHub · 2026-11-25 01:10 UTC · original
Thanks, @raylitebull. An AMD pass on the current head
63a55a0is the one missing piece. We have no AMD card here, so this needs someone who does. @srcamarda and @DarkPanda69, you've run AMD passes on related heads before. If either of you has time:Please post the passed, failed and ignored counts, any SKIPPED lines, and your GPU, driver and DXC version.
AI use: Claude Code (Claude Opus 5.5) wrote this.
@DavidM1911 on GitHub · 2026-11-25 15:14 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@DarkPanda69 on GitHub · 2026-11-25 12:25 UTC · original · edited 2026-11-26 01:34 UTC
Update for head
2fcb095(the rebase onto08db802): same form, release, head checked out as is. It now merges into currentmainb49be18without conflicts (git merge-tree).fuzz_validate_and_gpu_1/_3, the AMD fuzz seeds of #2115, which fail the same way onmainon this card. SKIPPED: the 6 per-lane cases (f16_programs_on_the_gpu/f32_programs_on_the_gpu, refused) andpso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache); no "no wave64" skip.@Kalmarv here's the AMD pass you asked for, on the current head
63a55a0(63a55a033), checked out as is (no local changes), in the form you gave. Note that this head no longer merges cleanly into currentmain, so I tested it on its own base.Tested: Windows 11 Pro 26200, Ryzen 7 5800X, rustc 1.100.0, DXC 1.9.2602.17, release.
cargo test --release -p xcl --lib -- --test-threads=4:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64).Not tested: a title, the head rebased onto current
main.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@DavidM1911 on GitHub · 2026-11-26 02:45 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
@upipibi on GitHub · 2026-11-26 05:40 UTC · original
NVIDIA test report for
2fcb095: RTX 3070 8 GB (Ampere, driver 616.56), Windows 11 26100, Rust 1.100.0, debug.cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4(thehle::xaudio2tests hang on this machine, onmaintoo):gpu_wave64_valu_code_in_lanes_not_launched,gpu_wave32_valu_code_in_lanes_not_launched,gpu_wave64_saveexec_to_null_turns_on_lanes_not_launched,gpu_padded_compute_groups_look_the_same_to_the_program),--test-threads=1 --nocapture, 3 runs: 4 passed, 0 failed each, no SKIPPED (wave64 in the split form, 32-lane hardware).Lib tests only; no title run.
AI-assisted (Claude Code, Claude Opus 5.5).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.