No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1134
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1134"
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?
@DominicBrett on GitHub · 2026-11-25 21:17 UTC · original
fix/warp-budget-group-order→main· +15 −2 · 1 files · 1 commits · closed without mergingFixes #1100 and #1118:
indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fieldsfails intermittently, and on some machines nearly every time.Cause
The cause is the test, not the shader. The test sends 128 records, which the clamp runs as two groups of 64. Each group adds up its own records' cost in lane order, then charges that sum to the one budget word with a compare-and-swap. Every real draw costs 2^26, so the group that charges first takes the whole 2^27 budget with its first two real draws, and every draw in the other group runs empty.
D3D12 gives no order between thread groups, and WARP (which this test always uses, whatever GPU is installed) runs groups on CPU threads. Either group can win. The test hard-coded the first group winning (
assert!(i == 1 || i == 2)), so it fails whenever the second group charges first (records 64 and 65 kept).This also answers the question in #1118: the GPU's wave width isn't involved. The harness runs on WARP, and the clamp's
numthreads(64)plus groupshared walk is the same on every adapter. That explains why it "passed twice, then failed three times" on the same machine.Fix (test only, shader unchanged)
The test now accepts either
[1, 2]or[64, 65]as the kept pair. It still requires:BUDGET(no wraparound);Evidence
Windows 11 26200, RTX 4070 SUPER (driver 617.42), Rust 1.98.1 MSVC, on
085ee7c. The test binary was run 100 times, with a temporaryeprintln!of the kept record indices (removed before committing):[1, 2][64, 65]085ee7c)Every failure before the fix is a run where the second group won. After the fix, both orders still occur and both pass.
The test still catches a real bug: with the shader's fit check broken on purpose (
fit = 1u;, so nothing is ever cut by the budget), the updated test fails:kept [1, 2, 3, …, 127].Other checks:
cargo test -p victory-gpu: 183 passed, 0 failed, 5 ignored.cargo clippy -p victory-gpu --all-targets: same 11 existing warnings before and after, none in the changed lines.rustfmt --check: the changed hunk is clean (the file has existing rustfmt diffs elsewhere, left alone).🤖 Generated with Claude Code
Pull request closed