D3D12.X: the shared view heap logs how full it gets #1254
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!1254
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1254"
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?
@not-rex on GitHub · 2026-11-24 13:47 UTC · original
not-rex:heap-fill-diag→main· +50 −3 · 1 files · 1 commits · openDiagnostics only. All console view heaps share one shader-visible PC heap (1 000 000 descriptors on NVIDIA, 512 per page of 256 slots), and today the only line about its fill is the warning when it is completely full. This logs the fill at 25 / 50 / 75 / 90 %, once each, so a log shows how close a title gets.
Why now: the newer retail title makes a view heap of 1 245 184 slots, and another project (VIctory #747, RTX 4070 Ti; an observation only, no code from it) measured about 1.1M of its slots written, with its descriptor tables reaching the top of the heap. Whether that costs XCL any pages depends on whether those slots are written by device calls or as memory copies, which nothing in XCL's log shows. No behaviour change.
What is in it
crates/xcl/src/hle/d3d12x/console_heap.rs: the shared heap (Global) counts the descriptors and pages it has given out (reserve_globaladds,release_globalsubtracts). When a page is placed and the count first reaches 25, 50, 75 or 90 % of the heap, onexlog_info!line: (format example: the numbers are what an NVIDIA heap of whole 512-descriptor pages would print at 25 % with nothing released, not from a run)The levels are of the descriptors given out. The high-water mark is there because the "is full" warning comes from it: released ranges go to a first-fit list that is not merged, so the heap can be full before every descriptor is given out. Each level is logged once per run (the highest level logged is a field of the shared heap, under its lock). The check is a multiply and compare when a page is placed; nothing per slot.
XCL_TRACE_FRAMEview-heap census line also gives each heap's placed pages:frame trace: view heap 0x... (1245184 slots, shader visible, P of 4864 pages in the shared heap): ...(not in the shared heapfor a heap that has no pages there).shared_heap_fill_levels(unit, no GPU): the levels reached at and just below each boundary, the 489th NVIDIA page as the first 25 % one, and no overflow atu32::MAX.Rebased on
maincbc296ab(headd88c2aa): main now merges released ranges inrelease_globaland reserves 20 descriptors before the first page; the fill counters update after the merge, and the comment and the commit message's example (high-water mark 250,388) follow that.Tested
cargo test --workspace -- --test-threads=4at the headd88c2aa: 1155 passed, 0 failed, 46 ignored; the SKIPPED lines are main's lower/lower_dxil GPU agreement tests, the two no-wave64 tests andpso_measurement_compiles_an_exact_synthetic_record.stable-x86_64-pc-windows-msvc; tests in the default (debug) profile, smoke runs in release.cargo test --workspace -- --test-threads=4: 738 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_maskandgpu::recomp::tests::gpu_wave32_program_in_wave64_hardware, both "no wave64").main384f7f7on the same machine: 737 passed, 0 failed, 41 ignored, the same two SKIPPED.console descriptor heaps: one shader-visible PC heap of 1000000 view descriptors for all of themand its view heap of 1 245 184 slots; it stayed in its first-run screens and menus (no world loading), and the shared heap stayed under 25 %, so no fill line was written.Regression run
RTX 3080,
scripts/smoke.ps1, 300 s each, menus only (fresh data):main8f5fca5band then this PR's headd88c2aa(rebased onmaincbc296ab):Not tested
reserve_global/release_globaland the once-per-level logging have no test of their own: they need the process-wide shared heap, which needs a device. Only the level function is unit-tested.AI use
@Aniseto on GitHub · 2026-11-24 14:00 UTC · original
Ran the new fill-level test and the
console_heapunit set at7bf6c2a:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
shared_heap_fill_levelspasses and the rest of the heap tests are unaffected. This is a debug build on a Blackwell part with driver 32.0.16.2124; the author's run was an RTX 3080 on the same Windows build.Not tested: retail titles, RDNA2/RDNA4 and Intel GPUs, Wine, release profile.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified.
@DavidM1911 on GitHub · 2026-11-24 14:02 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
@DavidM1911 on GitHub · 2026-11-26 04:32 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:The PR's
Globalliteral predates fields thatmainadded; needs a rebase that fills them in.— Devin
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.