Fix whole-wave min reduction over a partial wave (WaveActive* recognition) #1857
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!1857
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1857"
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?
@llegate26 on GitHub · 2026-11-24 21:58 UTC · original
llegate26:wave64-partial-min-test→main· +311 −0 · 3 files · 6 commits · openWhat is in it
v_cndmask_b32+ 3× DPP8 xor 1/2/4 + DPP16 row_mirror +v_permlanex16+v_readlane32/0) and emitWaveActiveMin/WaveActiveMax/WaveActiveBitOrover the launched lanes, suppressing only the within-half DPP steps.v_readlanelane 32 + op + lane 0 steps that combine the two 32-lane halves of a wave64 (cross-half).gpu_wave64_ps_partial_wave_min(synthetic, no game data) and negative tests for the recogniser.Tested
cargo test --workspace -- --test-threads=4: 1060 passed, 4 failed, 26 ignored. The 4 failures arefuzz_validate_and_gpu_*failing withCreateComputePipelineState: 0x8007000E(out of memory) — pre-existing, unrelated to this change.Regression run
scripts/smoke.ps1needs a real title (no title data in this environment).Not tested
scripts/smoke.ps1) on a real title.AI use
WaveActive*emission, and wrote and ran the synthetic tests.3da2abb) y reconciliar con el fix wave64 762c36ed10@upipibi on GitHub · 2026-11-24 22:07 UTC · original
Checked on Ampere: RTX 3070 8 GB (32-lane waves, so wave64 compute is split over two host waves), driver 616.56, Windows 11, debug.
gpu_wave64_ps_partial_wave_minandgpu_wave64_ps_whole_wave_reductionspass onae53d84.A regression in split-wave64 compute.
recognize_whole_wave_reductionsruns for every program, not only graphics. In a wave64 compute program on a 32-lane GPU,WaveActiveMincovers one 32-lane host wave. Thev_readlane …, 32step it skips is what joined the two halves. I ran yourwhole_wave_reduceidiom as a 64-thread wave64 compute program: seed1000 - tid, every lane in the mask, so the minimum (937) is in lane 63, and every lane storess40:b9b6ea6ae53d84969 is the minimum of lanes 0..31 only. A wave64 PS on these GPUs has no populated upper half (
upper_lanes), so the PS tests can't show this. Limiting the recognition to that case, or skipping it when the console wave is split (runner::split_wave64()/ the emitter's x64 mode), would keep compute correct.Test (add next to
gpu_wave64_ps_partial_wave_min)AI-assisted (Claude Code). Synthetic tests only.
@Anon64 on GitHub · 2026-11-24 22:21 UTC · original
Regression run for this PR: head
ae53d84, based onmainb9b6ea6. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, back to back with themainrun.main
b9b6ea6:this PR:
No device removals or crashes; 102 % of main's frames, 74 % of its peak commit.
Peak commit on
b9b6ea6is mostly the pipeline preload's DXC compiles on this machine (#1035, fixed on latermainby #1321), and it varies a lot from run to run.Not tested: the whole suite; whether the title reaches the changed reductions in these 60 s.
Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@WebIdentity1 on GitHub · 2026-11-24 22:51 UTC · original
Scoped fix for the split-wave64 compute regression that @upipibi found on #1857, verified on an RTX 3090 at exact head
ae53d8435f346dbe66d47a78bd647060fe74eea9. I adapted their public fixture and kept the patch on this author-owned PR.Tested — native Windows 10 19045, RTX 3090 driver 591.74, Rust 1.98.1 MSVC,
XCL_ADAPTER=3090; direct DXIL and forced split unset. Public synthetic shader only.gpu_wave64_cs_whole_wave_min_spans_both_halvestest on the unmodified head: 0 passed / 1 failed, adapter printedNVIDIA GeForce RTX 3090,split=true,WaveActiveMin=true; all 64 lanes read 969 instead of 937. The intrinsic sees only the first host wave32; the suppressed readlane steps had joined both halves.split=true,WaveActiveMin=false, and all 64 lanes read 937. The threegpu_wave64_ps_controls passed 3/0, including the PR's partial-wave pixel minimum of 2. The rewrite remains enabled there.cargo build --locked --workspace: exit 0 on both snapshots.cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output: control 889 passed / 2 failed / 42 ignored, fix 890 / 1 / 42, across 20 targets with six explicitSKIPPEDlines each. The common failure is the existinggpu_clamp_and_omod_per_instructionon this driver; the extra control failure is this new test. No fix-only failure.Em::x64()'s mode predicate, so the original cross-half sequence stays intact only where a console wave spans two hardware waves.No commit or competing PR from me; please incorporate the small guard and regression if useful:
Two-file patch (40 insertions, one deletion)
Not tested: current-main integration, retail smoke/gameplay, driver compile cost, peak memory, AMD native-wave64, or other reduction idioms. This does not establish merge readiness; the PR description check is still red.
AI use: Codex desktop (GPT-6) adapted @upipibi's fixture, prepared the local patch, ran the Windows tests and drafted this report from the retained logs.
@futurepro62 on GitHub · 2026-11-24 22:41 UTC · original · edited 2026-11-24 22:58 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
ae53d84(on its baseb9b6ea6).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: 889 passed, 0 failed, 42 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.gpu_wave64_ps_partial_wave_min.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 890 passed, 0 failed, 42 ignored. SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out five tests where this PR's base has them. They fail on main689f2dbtoo, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns their skips into failures. These areheap_window_out_of_memory_falls_back_to_the_switch_form(#1651) and the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests (follow-up on #1651). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-25 01:28 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@raylitebull on GitHub · 2026-11-25 02:01 UTC · original
CIworkflow approved for762c36e.Review note on
762c36e:recomp/mod.rsstill callsrecognize_whole_wave_reductions(&insts)unconditionally, so split-wave64 compute/mesh/geometry dispatches on 32-lane GPUs still hit the cross-half regression pointed out above (missing upper-half contribution). Guarding it whenopt.wave64 && opt.split_wave64 && matches!(opt.mode, Mode::Kernel | Mode::Compute(_) | Mode::Mesh(_) | Mode::Geometry(_)), fixing thePR descriptioncheck, and getting fresh AMD + NVIDIA verification on the updated head are needed before merge.@upipibi on GitHub · 2026-11-25 02:37 UTC · original
Re-checked
762c36eon the RTX 3070 (driver 616.56, 32-lane waves, so the split form):gpu_wave64_ps_partial_wave_minandrecognize_rejects_wrong_reduction_variantspass withXCL_DIRECT_DXIL=0and1.AI-assisted (Claude Code).
@DavidM1911 on GitHub · 2026-11-26 00:34 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.