Two indirect budget tests fail on an RTX 4060 Ti: a clamp's charge the next clamp does not see #211

Closed
opened 2026-11-27 19:52:59 +00:00 by github-bot · 2 comments
Owner

@⁠Cannnabis on GitHub · 2026-11-27 19:49 UTC · original

Summary

Two victory-gpu tests fail on this machine, both about a list's budget: a clamp's charge is not seen where the test says it must be. Everything else passes (418 of 420; no debug-layer messages).

indirect::tests::host_list_budget_starts_empty_at_each_submission
  panicked at crates\victory-gpu\src\indirect.rs:2745:13:
  assertion `left == right` failed: round 0: the spent budget empties the record after it
    left: 1
   right: 0

indirect::tests::warp_batch_charges_every_execution
  panicked at crates\victory-gpu\src\indirect.rs:3196:13
  (the `spent` assert; expected `BUDGET.min(...)`)

The first: three records of 65,535 x 16 groups spend the budget (each about half of 2^27, REST takes the rest), and the small record after them must come out empty — on this card it runs (hits == 1), so its clamp read a budget the big records' clamps had not charged. The second: a batch record executed several times must charge the budget for each execution; fewer charges landed.

Environment

Windows 11, GeForce RTX 4060 Ti (driver 32.0.15.9579), Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC. No game files, plain cargo test -p victory-gpu --lib --locked.

What I ruled out

  • The D3D12 debug layer is clean (--features diagnostics, VICTORY_D3D12_DEBUG=1; the tests' own host.log_messages() check passes before the failing assert).
  • VICTORY_INDIRECT_CARD_BUDGET=0 (the CPU-mapped budget): both tests fail the same way, so it is not the card's copy or its zeroing (WriteBufferImmediate).
  • The clamp records a UAV barrier before and after every dispatch (record_clamp_as), so the big clamps' charges are ordered before the small clamp's read as far as the recorded commands go.
  • The math by hand with REST = 1 says the three big records saturate the budget and the small record does not fit; the test's premise is achievable, and the same build passes the other 418 tests.

What it smells like

Two clamp dispatches of one list racing on the budget word — the barriers only order them, and this driver (or this card) schedules the small record's clamp group against the big records' one where the machine the fork was developed on does not. I cannot confirm it from here; I have no capture of the shader's per-group view of the budget word.

Reproduction: cargo test -p victory-gpu --lib --locked indirect:: on an RTX 40 series card. I can run any probe or extra isolation you want on this machine — say the word.

**@⁠Cannnabis** on GitHub · 2026-11-27 19:49 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/211) ## Summary Two `victory-gpu` tests fail on this machine, both about a list's budget: a clamp's charge is not seen where the test says it must be. Everything else passes (418 of 420; no debug-layer messages). ``` indirect::tests::host_list_budget_starts_empty_at_each_submission panicked at crates\victory-gpu\src\indirect.rs:2745:13: assertion `left == right` failed: round 0: the spent budget empties the record after it left: 1 right: 0 indirect::tests::warp_batch_charges_every_execution panicked at crates\victory-gpu\src\indirect.rs:3196:13 (the `spent` assert; expected `BUDGET.min(...)`) ``` The first: three records of 65,535 x 16 groups spend the budget (each about half of 2^27, `REST` takes the rest), and the small record after them must come out empty — on this card it runs (`hits == 1`), so its clamp read a budget the big records' clamps had not charged. The second: a batch record executed several times must charge the budget for each execution; fewer charges landed. ## Environment Windows 11, **GeForce RTX 4060 Ti** (driver 32.0.15.9579), Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC. No game files, plain `cargo test -p victory-gpu --lib --locked`. ## What I ruled out - The D3D12 debug layer is clean (`--features diagnostics`, `VICTORY_D3D12_DEBUG=1`; the tests' own `host.log_messages()` check passes before the failing assert). - `VICTORY_INDIRECT_CARD_BUDGET=0` (the CPU-mapped budget): both tests fail the same way, so it is not the card's copy or its zeroing (`WriteBufferImmediate`). - The clamp records a UAV barrier before and after every dispatch (`record_clamp_as`), so the big clamps' charges are ordered before the small clamp's read as far as the recorded commands go. - The math by hand with `REST = 1` says the three big records saturate the budget and the small record does not fit; the test's premise is achievable, and the same build passes the other 418 tests. ## What it smells like Two clamp dispatches of one list racing on the budget word — the barriers only order them, and this driver (or this card) schedules the small record's clamp group against the big records' one where the machine the fork was developed on does not. I cannot confirm it from here; I have no capture of the shader's per-group view of the budget word. Reproduction: `cargo test -p victory-gpu --lib --locked indirect::` on an RTX 40 series card. I can run any probe or extra isolation you want on this machine — say the word.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 19:52:59 +00:00
Author
Owner

@⁠jarvixaiassistant-glitch on GitHub · 2026-11-27 20:30 UTC · original

On current main (e69e39c) this is the old default, not a clamp that fails to charge.

rest() has been off since 545f890 (VICTORY_INDIRECT_REST=1 turns it back on). A record that does not fit takes nothing, so a later record that does fit still runs. record_clamp_as already puts a UAV barrier on both sides of every clamp dispatch, so the next clamp on the same list sees the charge.

host_list_budget_starts_empty_at_each_submission submits three 65,535 x 16 dispatches against a 2^27 budget. Two fit and 2,048 threads remain. The third does not fit and, with the default, does not take the rest. The 1x1x1 record after it is 64 threads, so it runs and the hit count is 1. The assert still expects 0.

warp_batch_charges_every_execution is one dispatch. Three executions of a 2^22 x 16 draw are 3 x 2^26, which does not fit, so the shader charges 0. The assert still expects the budget to saturate at 2^27. The 1x3, 2x1, and 1x1 cases still match.

Pull request #67 only rebuilds these two tests with the rest-taking clamp. That matches the old rule and not the default that lets a later valid draw run. Pull request #72, raising the budget from 2^27 to 2^30, is a separate change about lists running out in play.

**@⁠jarvixaiassistant-glitch** on GitHub · 2026-11-27 20:30 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/211#issuecomment-7227572801) On current main (`e69e39c`) this is the old default, not a clamp that fails to charge. `rest()` has been off since `545f890` (`VICTORY_INDIRECT_REST=1` turns it back on). A record that does not fit takes nothing, so a later record that does fit still runs. `record_clamp_as` already puts a UAV barrier on both sides of every clamp dispatch, so the next clamp on the same list sees the charge. `host_list_budget_starts_empty_at_each_submission` submits three 65,535 x 16 dispatches against a 2^27 budget. Two fit and 2,048 threads remain. The third does not fit and, with the default, does not take the rest. The 1x1x1 record after it is 64 threads, so it runs and the hit count is 1. The assert still expects 0. `warp_batch_charges_every_execution` is one dispatch. Three executions of a 2^22 x 16 draw are 3 x 2^26, which does not fit, so the shader charges 0. The assert still expects the budget to saturate at 2^27. The 1x3, 2x1, and 1x1 cases still match. Pull request #67 only rebuilds these two tests with the rest-taking clamp. That matches the old rule and not the default that lets a later valid draw run. Pull request #72, raising the budget from 2^27 to 2^30, is a separate change about lists running out in play.
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-27 21:08 UTC · original

Closing: these two tests already fail on fork main and come from the old default explained above (VICTORY_INDIRECT_REST is off), not from your machine. They don't affect playing.

**@⁠trustno1-coder** on GitHub · 2026-11-27 21:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/211#issuecomment-7228179055) Closing: these two tests already fail on fork main and come from the old default explained above (`VICTORY_INDIRECT_REST` is off), not from your machine. They don't affect playing.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA#211
No description provided.