D3D12: cover indirect budget resets and rejected batches in both modes #2537
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2537
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/d3d12-indirect-budget-tests"
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?
Pull request successfully merged and closed
D3D12-INDIRECT-BUDGET-REGRESSION. Claim.
Three indirect tests failed on 431ceba4f on Windows. The table header now contains the experiment mask in its second dword. Two 65535-by-16 dispatches also leave enough budget for a small dispatch under the default skip-on-overflow policy. The reset test now spends exactly half the budget per large record, proving a small dispatch runs empty before reset and runs after reset in both modes. The WARP batch test checks the amount actually charged for a job too large to fit, alongside the record output and the exact-fit cases.
Verification:
cargo test --manifest-path d3d12/Cargo.toml --locked -p leonida-gpu --lib indirect::tests:: -- --test-threads=1in separate Windows processes with LEONIDA_INDIRECT_REST=0 and =1. Each passed 19 tests with 7 ignored. The original full GPU library run had 479 passed, 4 failed, 46 ignored. The fourth failure in descriptor/host.rs is independent. Diff whitespace and no-game-data checks passed.GPUs tested: Windows D3D12 test harness and WARP on an RTX 4070 Laptop GPU system (NVIDIA 610.74). Synthetic records only. No retail frame timing. No dependencies on other PRs. AI-assisted with OpenAI Codex (GPT-6).
Static review at head
6ff203098(Rust toolchain is not installed in this local environment, socargo testwas not executed locally).Notes (non-blocking)
32,768 × 32 = 2^20groups (2^26credits each, exhausting2^27in two records instead of leaving 2,048 spare credits) fixes the default-policy probe assertion, and the batch header / rejected-job WARP assertions cleanly distinguish zero-charge vs. full-budget policies (d3d12/crates/leonida-gpu/src/indirect.rs:71-75,125-195,2779-2843,3115-3128,3424-3474).indirect.rs:317-326,3428-3436): Becausewarp_batch_charges_every_executionreadsLEONIDA_INDIRECT_RESTfrom the process environment for both shader define and expected result, a single test run exercises only one REST policy (unlike the adjacent single-clamp tests at2660-2689that parameterize both explicitly). Parameterizing both policies in-test (or invoking twice in CI) ensures routine coverage of both modes.Approve.
AI-assisted static review.
Reviewed the diff and tested merged onto
main(493867366) on Windows 11 with Rust 1.100.1 (MSVC).The three indirect test updates (
[32768, 32, 1]exact half-budget records,batch::experiments()header dword, andrest()-awareexpected_spent) cleanly cover both overflow policies.Tests run
cargo test --manifest-path d3d12/Cargo.toml --locked -p leonida-gpu --lib indirect::tests:: -- --test-threads=1:LEONIDA_INDIRECT_REST=0: 19 passed, 0 failed (7 ignored, 4.61 s).LEONIDA_INDIRECT_REST=1: 19 passed, 0 failed (7 ignored, 4.59 s).GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88) + WARP.
AI-assisted (Antigravity, Gemini).
VERIFY-2537-D3D12— verified head6ff2030983merged cleanly withmainc7f5330e0on Windows 11 Pro (build 26200), NVIDIA GeForce RTX 3090 (driver 610.88) + D3D12 WARP, synthetic indirect dispatch/draw records only.Red (
mainc7f5330e0) -> Green (c7f5330e0+6ff2030983)main:LEONIDA_INDIRECT_REST=0 cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib indirect::tests:: -- --test-threads=1-> FAILED (16 passed; 3 failed; 7 ignored:indirect::tests::batch_tablesheader word 10 != 0xffff_ffff,indirect::tests::host_list_budget_starts_empty_at_each_submissionleft: 1, right: 0, andindirect::tests::warp_batch_charges_every_executionleft: 0, right: 134217728).LEONIDA_INDIRECT_REST=1 cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib indirect::tests:: -- --test-threads=1-> FAILED (18 passed; 1 failed; 7 ignored:indirect::tests::batch_tables).LEONIDA_INDIRECT_REST=0 cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib indirect::tests:: -- --test-threads=1-> 19 passed; 0 failed; 7 ignored (4.62s, RTX 3090 D3D12 + WARP).LEONIDA_INDIRECT_REST=1 cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib indirect::tests:: -- --test-threads=1-> 19 passed; 0 failed; 7 ignored (5.00s, RTX 3090 D3D12 + WARP).AI-assisted.
Red/green: On main three indirect::tests assertions fail against the current budget semantics, and with the PR cargo test -p leonida-gpu --lib -- indirect::tests passes (3 OK) on Windows 11 at OreoFR's (RTX 4070).
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.
Verified by OreoFR
54d27d988+ PR head6ff203098; green run in a merge package of 5 PRs, no new ctest failure vs maincargo test -p leonida-gpu --lib --locked -- indirect::testsAI-assisted (Claude Code, Claude Opus 5.5).