Compute TG_SIZE: a partial last wave counts #136
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!136
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/136/head"
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?
@tiagonleal on GitHub · 2026-11-23 14:48 UTC · original
tiagonleal:fix/compute-tg-size-partial-wave→main· +31 −1 · 2 files · 1 commits · merged 2026-11-23 20:51 UTCFrom #105's "also noticed": "
Mode::Computetg_sizeuses truncating division instead ofdiv_ceil".TG_SIZE (the SGPR after the group ids, wave count | wave index << 6) was emitted as
threads / lanes, truncated. A group that is not a multiple of the wave size has a last, partial wave, so:A program that uses the count (to size a cross-wave reduction, or to know how many waves reach an LDS slot) skipped the last wave. The count is now the ceiling, computed when the HLSL is made (a constant, as before).
The retail pack never enables TG_SIZE (
CsInterface::tg_sizedoc), so no translated pack program changes. Only compute programs that enable it get different HLSL.Test:
gpu_compute_tg_size_counts_a_partial_last_wave. Every thread stores TG_SIZE, for 96 / 64 / 128 threads in wave64 and 96 / 40 in wave32 (split wave64 on 32-lane GPUs). Before:96 threads, wave64: thread 0 – left: 1, right: 2. After: all pass.Run: RTX 5070 Ti, driver 32.0.16.1742.
cargo test --workspace --no-fail-fast -- --test-threads=4onmain95bda11: 549 passed, 0 failed, 37 ignored.AI-assisted.
🤖 Generated with Claude Code
@WarmMilkCodes on GitHub · 2026-11-23 18:55 UTC · original
Tested #136
1058c0bmerged onto main956a476on AMD Radeon RX 6600 XT (RDNA2), driver 32.0.21045.29003, Windows 11 23H2 (22631.6199): passcargo test --workspace --no-fail-fast -- --test-threads=4, noXCL_SAMPLE_*data:No new failures vs main. The PR's new test passes on RDNA2. The one failure on both,
gpu_wave64_ps_whole_wave_reductions, is the 32-lane PS case on this card (#155).@ivall on GitHub · 2026-11-23 20:52 UTC · original
Merged (main
2abc562). Checked on an RX 9070 (RDNA4) with the 11 PRs merged together on main38b05b7:cargo build --workspace && cargo test --workspace -- --test-threads=4- 547 unit tests passed, 0 failed (19 ignored); the integration and e2e tests passed too.@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-23 14:48 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.