Repository navigation
Conversation
warp_budget_saturates_without_wraparound_and_preserves_draw_fields clamps 128 records, two groups of 64. The clamp charges records in lane order within a group, but the two groups race for the budget word with a compare and swap, so whichever group charges first keeps its first two real draws: 1 and 2, or 64 and 65. The test required 1 and 2 and failed in 8 of 10 runs on its own here (WARP, single test thread); the group that won was group 1 every time it failed. The test now accepts either pair and names the records kept when it fails. Everything else it checks is unchanged: the budget saturates without wrapping, the source is untouched, every other draw is emptied and the remaining fields of every record are kept. 20 of 20 runs pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head AI-assisted (Claude Code); no game data. |
…copy queue, indirect windows, profiler; all behind switches) Brings in 9376fd6 too. On this NVIDIA laptop 9376fd6 hung the device twice by default (its write-watch shortcut, fxceless#670); VICTORY_VIEW_ASK=1 avoided it. Test with that set. Conflict in indirect.rs, kept from both sides: - The clamp shader keeps upstream's per-group budget charge and its MOST_DRAW guard, and this side's dispatch in parts (SPLIT records for one compute dispatch past 65,535 groups in x, the prologue's indirect light gather). This side's wide-dispatch counters in budget words 3-4 are dropped: upstream no longer reads or zeroes them. - clamp_into (upstream's state-tracked scratch) takes this side's `how` bits (AHEAD, IN_PARTS) instead of a bool; bound_split goes through it. - The split test reads back like upstream's tests (INDIRECT_ARGUMENT -> COPY_SOURCE). cargo test -p victory-gpu --lib indirect:: texture:: watch:: : 30 passed, 1 failed (warp_budget_saturates_..., the upstream race between two groups that fxceless#847 describes; not this merge), 2 ignored. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The switch this branch added turned the clamp pass off so `ExecuteIndirect` could read the title's own argument buffer. `dkdknight` ran it on an RTX 5080, twice, and both runs died with `0xc0000005` writing `0x0` within seconds. That is the answer the switch deserved: the title's argument records contain bounds the pass is what enforces, so "read them directly" is not a fast path, it is a crash with a longer name. So `0` no longer means "bypass". `clamp_setting` returns `(clamp on, say so)` and the clamp is on whatever is asked; a run that asked is told once, with the reason and with what actually answers its complaint. `clamp_is_on` is consulted where the clamp is first made, so the refusal is spoken even in a run that never reaches the pass. That leaves no path for the bypass, so the code is gone rather than unreachable: the `if !clamped` branch in `draw.rs` and the two `if clamped` teardowns go with it, and so does `wait_direct`, which existed only to put a barrier in front of an unclamped execute. Dead code behind a switch that is now always true is a lie about what the program can do. The cost the switch was chasing is real -- about five thousand one-record indirect mesh draws a frame, and SM issue at 4% in `dkdknight`'s Nsight capture -- and the answer to it is hoisting the clamps out of the per-record path (`VICTORY_HOIST_CLAMPS`, Phase I), which keeps the bounds check and stops paying for it once per record. Probe: `clamp_setting` returns `parse_clamp_enabled(asked)` again -> the new test fails with `left: (false, true), right: (true, true)` -> restored byte-identical (sha256 ade38ee886e354e5). cargo test -p victory-gpu --lib: 161 passed, 1 failed -- the failure is `warp_budget_saturates...`, the pre-existing flake (fxceless#847/fxceless#849), on a test this commit does not touch. cargo clippy -p victory-gpu --lib -D warnings: only the two pre-existing fxceless#841 errors remain.
|
Evidence from a fourth machine (Windows, WARP, this repo's own suite), and one thing your two PRs between them have established that neither body says: this is a regression, not a missing nicety.
Measured: full suite, four processes at a time, twelve runs on I have opened #970 taking |
The switch this branch added turned the clamp pass off so `ExecuteIndirect` could read the title's own argument buffer. `dkdknight` ran it on an RTX 5080, twice, and both runs died with `0xc0000005` writing `0x0` within seconds. That is the answer the switch deserved: the title's argument records contain bounds the pass is what enforces, so "read them directly" is not a fast path, it is a crash with a longer name. So `0` no longer means "bypass". `clamp_setting` returns `(clamp on, say so)` and the clamp is on whatever is asked; a run that asked is told once, with the reason and with what actually answers its complaint. `clamp_is_on` is consulted where the clamp is first made, so the refusal is spoken even in a run that never reaches the pass. That leaves no path for the bypass, so the code is gone rather than unreachable: the `if !clamped` branch in `draw.rs` and the two `if clamped` teardowns go with it, and so does `wait_direct`, which existed only to put a barrier in front of an unclamped execute. Dead code behind a switch that is now always true is a lie about what the program can do. The cost the switch was chasing is real -- about five thousand one-record indirect mesh draws a frame, and SM issue at 4% in `dkdknight`'s Nsight capture -- and the answer to it is hoisting the clamps out of the per-record path (`VICTORY_HOIST_CLAMPS`, Phase I), which keeps the bounds check and stops paying for it once per record. Probe: `clamp_setting` returns `parse_clamp_enabled(asked)` again -> the new test fails with `left: (false, true), right: (true, true)` -> restored byte-identical (sha256 ade38ee886e354e5). cargo test -p victory-gpu --lib: 161 passed, 1 failed -- the failure is `warp_budget_saturates...`, the pre-existing flake (fxceless#847/fxceless#849), on a test this commit does not touch. cargo clippy -p victory-gpu --lib -D warnings: only the two pre-existing fxceless#841 errors remain.
indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fieldsfails intermittently.Cause. The test clamps 128 records, two groups of 64. The clamp shader charges records in lane order within a group, but the two groups race for the budget word with a compare and swap (
indirect.rs, thewhile (before < BUDGET)loop). Whichever group charges first keeps its first two real draws: records 1 and 2, or 64 and 65. The test required 1 and 2.Measured on WARP (RTX 4070 machine, single test thread): the old test failed in 8 of 10 runs on its own; with a temporary log of the kept record, every failure kept record 64. In the full suite it passed more often, which is why it slips through.
Change. The test accepts
[1, 2]or[64, 65]and names the records kept when it fails. Everything else it checks is unchanged: the budget saturates without wrapping, the source is untouched, every other draw is emptied, and the remaining fields of every record are kept. The shader is not touched.Proof. The fixed test passes 20 of 20 runs alone;
cargo test -p victory-gpu --libpasses 3 of 3 (159 passed);cargo xtask policy --stagedok.Note on CI. Both clippy jobs already fail on
mainwithout this change (placed_filler_twinsnever used,sort_unstable_by_keyindraw.rs,depth_writtennever read); #841 fixes those.Not in this PR, seen while testing:
watch::tests::a_write_is_reported_at_every_checked_viewfailed once in 10 parallel runs of the GPU tests (0 of 15 serial), and one parallel run of the GPU test binary ended in0xc0000005(not reproduced in 10 more runs).🤖 Generated with Claude Code