D3D12: cover indirect budget resets and rejected batches in both modes #2537
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2537"
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?
Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-28T01:17:58Z.
D3D12-INDIRECT-BUDGET-REGRESSION. Claim.
Three indirect tests failed on
431ceba4fon 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).
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T02:02:37Z.
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.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T02:19:28Z.
Review: COMMENTED
Verified at head
6ff203098on Windows 11 with NVIDIA GeForce RTX 3090 (driver610.88) D3D12 and WARP (--features diagnostics,LEONIDA_D3D12_WARP=1), including negative controls onmain(431ceba4f):host_list_budget_starts_empty_at_each_submission:[32768u32, 32, 1]hits32768 * 32 == 1 << 20 == GROUPS(staying within bothGROUPS / g.yandWIDEST = 65535) and charges32768 * 32 * 64 == 1 << 26 == BUDGET / 2per record, so the first two records exhaustBUDGET(1 << 27) identically under bothLEONIDA_INDIRECT_REST=0andLEONIDA_INDIRECT_REST=1(on431ceba4f,2 * 65535 * 16 * 64left2,048unspent threads underREST=0, letting the1x1x1trailing dispatch run).batch_tables: matchesTable::newinitializing dword 1 tobatch::experiments()(0without active experiment switches, and dynamically matchingLEONIDA_ABunderdiagnostics).warp_batch_charges_every_execution:(times = 3, records = 1)charges3 * 2^26 > BUDGET, whichbatch::SOURCEleaves at0whenREST == 0and clamps toBUDGETwhenREST == 1;rejected = if rest() != 0 { BUDGET } else { 0 }matchesmake_fromin both modes.431ceba4f(LEONIDA_INDIRECT_REST=0): reproduced all three failures (host_list_budget_starts_empty_at_each_submission1 != 0,batch_tables[3, 0, ..] != [3, 0xffffffff, ..],warp_batch_charges_every_execution0 != 134217728).6ff203098:LEONIDA_INDIRECT_REST=0(RTX 3090 D3D12):cargo test -p leonida-gpu indirect::tests:: -- --test-threads=1->19 passed; 0 failed.LEONIDA_INDIRECT_REST=0(WARP,--features diagnostics+LEONIDA_D3D12_WARP=1):19 passed; 0 failed.LEONIDA_INDIRECT_REST=1(RTX 3090 D3D12):19 passed; 0 failed.LEONIDA_INDIRECT_REST=1(WARP,--features diagnostics+LEONIDA_D3D12_WARP=1):19 passed; 0 failed.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T09:20:49Z.
Review: APPROVED
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).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T11:24:10Z.
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.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T20:21:07Z.
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.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T22:04:28Z.
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).