Fresh VRAM heaps shorten the 64 KiB title-buffer allocation burst #404
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 TaynanGT/Vice-Tay. Originally posted by NotADonky43 on 2026-11-28T10:15:48Z.
Experimental follow-up to #196/#199, tested separately on Vice-Tay
fe7c6e52198f2070805ffafc4e55a7163291bad0. #199 reduces time holding the global buffer-table lock. This experiment reduces the number of D3D12 heap creation and residency calls instead. It applies only to the device-local side of registered title buffers, not the shared backing prepared by #178.On an RTX 5070 Ti, the Series X opening allocated thousands of registered device-local buffers smaller than or equal to 64 KiB. In a title-free D3D12 benchmark (3,246 × 64 KiB buffers; six interleaved trials per path), median creation/residency/mapping time was 1,079 ms with one committed heap per buffer, 518 ms with committed residency in groups of 32, and 24 ms with 26 placed heaps. These figures describe allocation and mapping in the fixture, not the cost of the production allocator's additional initialization or the game's loading time.
The production prototype (
b446069e) only issues never-used slots. It activates and zeros every slot, confirms the direct-queue fence before publication, and ties whole-heap ownership and budget charge to resource/heap lifetimes. It keeps the original committed allocator as a fallback and never returns an issued slot to the allocator. The native registered-path test passed byte-exact cross-queue readback before and after a 256-byte update and checked the budget charge while an independent resource reference outlived buffer unregister.Game A/B: Same release executable, RTX 5070 Ti, Series X, 64 KiB registered-buffer placement profile and 4 GiB BAR, same precompiled shaders and initial D3D12 pipeline library. Only the fresh-heap switch changed. Enabled: 3,282 buffers issued from 31 heaps. The elapsed time between logged creation of the 500th and 3,200th small card copies fell from 4.24 s to 1.75 s. Both runs reached heavy rendering and exited normally with no logged device loss. This is one allocation-burst comparison, not a matched cutscene, steady FPS result, or claim of lower memory use. Both runs still had pipelines pending during heavy rendering. Long-run heap retention and visually matched load times remain unverified.
The source-only diff includes the native regression; no game files or game-derived artifacts are needed for that test. I’m sharing this as an experiment for review, not proposing it as a default yet.
Source-only patch against
fe7c6e52(includes native regression)Imported from TaynanGT/Vice-Tay. Originally posted by NotADonky43 on 2026-11-28T12:00:36Z.
One follow-up to the allocator above: the pressure sweep dropped every never-issued resource in the current batch, even when an issued resource still held the underlying heap. The next request then started another heap without reclaiming the first one.
The attached delta keeps the active batch’s never-issued resources when an issued resource still pins it. COM destruction notifications track issued resource lifetime independently of
Shadow; the actual heap destructor still releases the budget charge. Once no issued resource remains, a pressure sweep can release the ready batch. This does not recycle issued slots or change initialization, queue ordering, admission, or the committed fallback. Keeping the ready resources retains their CPU/driver-side objects while the heap is pinned; it does not itself free an otherwise unused heap earlier.b446069ebecause the next allocation after trim doubled the charge from 8 MiB to 16 MiB. With the delta, the second allocation stayed at 8 MiB; after the final independent resource reference was released and pressure swept again, the charge returned to zero. The production registered-allocation test still passes exact cross-queue readback before and after a partial write. Release build, mapping-fence tests and the isolated serial workspace suite passed.b446069evs pressure follow-upd2a376bc, both onfe7c6e52. At reports with exactly 3,465 buffers issued, the original logged 57 heaps created / 416 MiB charged, versus 28 / 224 MiB with the fix. The new run supplied 320 buffer requests from slots retained after a pressure sweep. The 500th-to-3,200th initial allocation span was essentially unchanged (2.16 vs. 2.22 s).This is a source-only delta on top of the original patch in this issue, including the native regression; no title files or caches are needed for the fixture.
Source-only delta against b446069e (includes native regression)
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T11:35:58Z.
Thanks for the independent resource-lifetime regression and pinned-heap accounting. The 416 vs 224 MiB result at the same issued-buffer count is useful allocator evidence, not a total VRAM or FPS claim. Please keep the follow-up separately reviewable and retain the final-reference-release test.
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:00:35Z.
mainhas moved to a new line of the code and everything is now named Vice-Tay:vice-tay.exe play, andVICE_TAY_*switches instead ofVICTORY_*(details in #468). Could you check whether this still happens on the currentmainand say so here, with a log if you can?