Repository navigation
fix(gpu): respect indirect count buffer and bind null root views - #583
matheusfrta wants to merge 1 commit into
Conversation
LAKSHYA-cmd-tech
left a comment
There was a problem hiding this comment.
Tested and verified on Windows 11 x64 (D3D12 WARP + Hardware).
- Confirmed indirect argument clamp properly honors count_buffer (via count_arg), preventing trailing unreferenced garbage beyond the valid count from depleting execution budget.
- Confirmed budget accumulation saturation preventing uint32 overflow.
- Confirmed host.null_root_view() safely binds a 64 KiB zero-initialized buffer on unbound root views instead of undefined GPU address references.
- cargo test -p victory-gpu: 45 passed, 0 failed.
- cargo clippy -p victory-gpu --lib -- -D warnings: 0 warnings.
- cargo xtask policy: 151 files clean.
|
Hardware data point on the budget loop, RTX 4080, Windows 11. I added one test to this branch: N draw records of one vertex instance each (kind 0, stride 16, no count buffer), which all fit the budget, clamp alone, timing
When many records fit, each successful compare-exchange makes the other threads retry, so the work grows roughly with the square of the record count. 4,096 small records already sit at the host's 2 s time-out. Each device loss came with an nvlddmkm event 153. WARP does not show this (no time-out), and the garbage-record tests don't either, because the budget saturates after a few reservations and everything else exits early. main does not have the problem but still wraps. A single thread walking the records with a saturating count avoids both (27 ms for 65,536 records here): https://github.com/rouges78/VIctory/tree/fix/indirect-budget-wrap, test AI-assisted; the numbers are from real runs on the card. |
DenRakEiw
left a comment
There was a problem hiding this comment.
Tested merged cleanly onto main (ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC) with NVIDIA GeForce RTX 5090 (Blackwell) and WARP (VICTORY_D3D12_WARP=1):
cargo test -p victory-gpu(RTX 5090): 52 passed, 0 failed, 1 ignored (includinghost::tests::null_root_view_is_alignedandindirect::tests::clamp_honours_count_buffer_and_does_not_wrap_budget)VICTORY_D3D12_WARP=1 cargo test -p victory-gpu(WARP): 52 passed, 0 failed, 1 ignoredcargo clippy -p victory-gpu --all-targets: 0 warningscargo xtask policy: ok
Both new indirect-clamp and aligned null-root-view tests pass cleanly on RTX 5090 and WARP with zero warnings. Approving.
AI-assisted (Gemini 4 Neon).
|
Automated triage for the maintainers. Needs work. This PR now does two separate things, and only one of them is ready.
Suggestion: split part 1 into its own PR, which could go forward as is. For part 2, give evidence that the dropped draws should run, for example a diagnostics run listing the shaders and slots and an A/B of the frame. Also clear or size the null UAV for its use. On your reply: thanks for the rebase that moves the count buffer to SRV CI: passing. Generated by Claude Code |
07bae5d to
844c962
Compare
844c962 to
586d7da
Compare
|
Rebased onto Regarding the failing CI check: both |
|
Thanks for this one. One gap I noticed while reading the diff (code reading only, I have not reproduced it in a title): With
On the base, A possible fix: in Happy to test a rebased version on an RTX 4070 (NVIDIA) if useful. AI-assisted review, read against 586d7da and current main (940d32f). |
|
@Mericas77 Thanks for pointing this out! Feel free to test the rebased version on your RTX 4070. I’ll test it on my PC as well to verify the behavior. I’ll submit an updated PR with any necessary fixes as soon as I can. |
47167d2 to
3969828
Compare
|
@Mericas77 Rebased onto current
CI is green and |
3969828 to
f99ec1b
Compare
|
Thanks, the rebased version (f99ec1b) looks right to me: Tested on an RTX 4070 (Windows), plain debug
No regressions on NVIDIA from what I can see. Me and AI-assisted. (Gemini+Claude) |
f99ec1b to
33f61e5
Compare
|
Rebased onto |
…null root views
Rebased shadow.rs cleanly onto main so null addresses skip loose shadow allocation, and updated State::root_view and ROOT_VIEW_OFFSET to bind a cached null raw view with offset 0 when a root view is null or unset instead of dropping the draw or dispatch.