D3D12.X: size two-pass indirect buffers from GPU feedback and finer buckets #2816
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2816
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2816"
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?
@coolpersonnn on GitHub · 2026-11-26 14:22 UTC · original
coolpersonnn:ws2/two-pass-feedback-sizing→nvidia-dev· +1038 −83 · 2 files · 2 commits · openStacked on #2815; only the top commit belongs here.
Size two-pass indirect
DispatchMeshrecord buffers from observed GPU feedback and tighten bucket rounding so indirect mesh draws do not reserve worst-case multi-MiB buffers on every cold recording.Part of #2688
What is in it
SCALE_ARGS_HLSLwith an uncappedRawBufferLoadfeedback UAV (encoded asraw_n + 1) and add per-device async readback/clear inIndirectFeedback, committed on submit intwo_pass_submittedand polled with cross-queue waits inalloc_pool::executed.4 MiBcap (INDIRECT_COLD_CAP), grow immediately when GPU feedback shows clamping over the 250 ms history window, decay slowly downward when bursts subside, and round record/scratch allocations in256 KiBhalf-steps (bucket_bytes).SCALE_ARGS_HLSLfeedback, clamp growth/decay across windows, and submit-before-copyback ordering.Tested
26200/26300), Ryzen 9 9950X3D, 95,800 MB RAM, NVIDIA GeForce RTX 5090 (32 GB, driver621.01, DXC1.8.2502.11),rustc 1.100.0, release + test builds.cargo test --workspace --no-fail-fast -- --test-threads=4: 1,748 passed, 10 failed, 48 ignored across 41 test binaries; 27 explicitSKIPPEDGPU tests (hle::d3d12x::bind: 41 passed incl. 1SKIPPED two_pass_binds_set_the_shared_view_heap: no heap windows;hle::d3d12x::alloc_pool: 8 passed). All 10 failures are pre-existing failures also present on unmodifiednvidia-dev(af2cecc4).cargo build --release -p xcl --bin xcl: exited 0.#2688WS2, measured through PR 3 ontitle: a93b40d7over warm-cache 120 s runs): drops world-entry two-pass alive memory from998 MiB(598 MiBwaiting for allocator resets) to129 MiB(0 MiBwaiting), eliminating73past-cap skips with0device removals and0crashes.Regression run
Not tested
nvidia-devaf2cecc4by pre-existing multi-minute compute-PSO driver compiles at world entry when the full world shader cache is absent).XCL_HEAP_WINDOWS=1heap-window test (two_pass_binds_set_the_shared_view_heapskipped by default).AI use
@jeremiahmvze on GitHub · 2026-11-26 14:54 UTC · original
Test note from porting this onto another
nvidia-dev-based branch (the code applied cleanly after #2815): the new feedback tests are not safe to run in parallel.cargo test -p xcl --lib bind:: -- --test-threads=1: 40 passed.indirect_feedback_waits_for_submit_before_copybackindirect_feedback_copyback_grows_on_clamp_and_decays_over_windowsgpu_scale_args_reports_uncapped_group_count_feedback(a panic on theFEEDBACKlock)They all use the process-wide
FEEDBACK/FEEDBACK_ACTIVEstatics, so one test's entries and on/off state leak into another's. Holding one shared test mutex (or resettingFEEDBACKunder a guard) in each of these tests should fix it.Caveat: this was on our port, not on
f163cdc0itself, and on an RTX 4090. The runtime path isn't affected; it's only the tests.@DarkPanda69 on GitHub · 2026-11-26 14:56 UTC · original
AMD run (listed as untested), with an RTX 3060 in the same PC. Two of the new tests fail now and then on both cards when the tests run in parallel.
Tested: head
f163cdcapplied on its basenvidia-devaf2cecc, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, card picked withXCL_ADAPTER.cargo test -p xcl --lib -- hle::d3d12x::bind hle::d3d12x::alloc_pool --test-threads=4, repeated:gpu_scale_args_reports_uncapped_group_count_feedbackandgpu_two_pass_pooled_scratch_respects_remaining_budgetpass by name on both cards.The two are
indirect_feedback_waits_for_submit_before_copyback(bind.rs,assertion failed: !fb.dirty && !fb.copy_in_flight) andindirect_feedback_copyback_grows_on_clamp_and_decays_over_windows, which then panics on the poisonedFEEDBACKmutex. They fail more often on #2817, and the details are in my comment there. On one thread, #2817 passed 10 of 10 runs.As on #2817,
XCL_ADAPTER=radeon(lowercase) skipsgpu_scale_args_reports_uncapped_group_count_feedbackon this card withno D3D12 hardware adapter, because the name match is case-sensitive;Radeonruns it.Not tested: a title run, release,
XCL_HEAP_WINDOWS=1, Intel.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@ettehn on GitHub · 2026-11-26 14:58 UTC · original
Confirmed the parallel test failure on the exact head
f163cdc0290ff3079e8a507f74ee11f24a4edad2and checked a test-only fix. RTX 5070 Ti Laptop (12 GB, 621.24), Windows 11 x64 build 26200, Rust 1.97.1 MSVC, DXC 1.8.2502.11.bind::tests: 41 reported passed on one thread, including the default heap-window capability skip. In eight fresh runs at four threads, 3 aborted:indirect_feedback_waits_for_submit_before_copybackfirst asserted!fb.dirty && !fb.copy_in_flight, then the other feedback tests hit the poisoned mutex.lock_warp_tests()at the start ofindirect_feedback_copyback_grows_on_clamp_and_decays_over_windowsandgpu_scale_args_reports_uncapped_group_count_feedback; the submit-order test already takes it. With those two guards plus the separate fixture below, the four-thread bind suite passed 16/16 fresh runs (42 reported passed, 0 failed, 0 ignored each, including one default capability skip). The skippedtwo_pass_binds_set_the_shared_view_heapalso passed separately withXCL_HEAP_WINDOWS=1, with no skip.poll_two_pass_feedbackscheduled the readback on a secondDIRECTqueue. Its copy fence stayed pending until the producer was released. After release, the existing clamped, zero-count and disabled cases read back encoded values501,1, and0. The focused run passed 1/0/0 with no capability skips.Base command:
cargo test --locked --offline -p xcl --lib -j 2 hle::d3d12x::bind::tests -- --test-threads=1 --nocapture; repeats used the same harness with--test-threads=4. Synthetic tests only. OpenAI Codex (6.2sol) assisted with verification.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.