D3D12.X: the shared view heap logs how full it gets #1244
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by not-rex on 2026-11-24T13:47:34Z.
Diagnostics 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
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-24T14:00:30Z.
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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T14:02:12Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T04:32:22Z.
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
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:31:27Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:15:07Z.
Triage (#1607) – head
d88c2aaThe core of this PR, logging when the shared view heap passes fill levels, is already on main: commit
02a834aaddsFILL_MARKS(50/75/90 %),marks_passedandPAGES_PLACEDin console_heap.rs:reserve_global, with descriptors in use and pages placed in the message. The PR now conflicts with that code.What main does not have is the 25 % level and the per-heap "N of M pages in the shared heap" field in
census(); if that is still wanted, it would be a small separate PR on top of main's counters.Recommendation: close (superseded by main commit
02a834a).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:43:52Z.
Closing as superseded: this change is already on
main(02a834a3). main console_heap.rs reserve_global logs 50/75/90 % fill with pages placed; remainder of PR is the 25 % level and a placed-pages detail in the frame-trace log line (log-only)Two independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed