Repository navigation
D3D12.X: pool small fallback placements in placed heaps and deduplicate xg::Texture - #2985
Saksukella wants to merge 1 commit into
Conversation
|
Independent NVIDIA check of 321e1eba on Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC:
Two allocation-lifetime points need correction before the pool can safely serve title traffic:
I did not run a title smoke test or a multi-hour soak. AI use: Codex (GPT-6.2 Sol) ran the tests and traced the release path; Codex (GPT-6.2 Astra) reviewed the allocator and proposed the regressions. |
|
I ran a native WARP queue control for the early slot reuse raised above, using the allocator extracted from In three fresh processes, an immediate allocation got the next slot. After 2,100 ms the allocator handed out the original slot on the same heap, while the submitted copy's completion fence remained 0. The fence reached 1 after I opened the gate. This gives a native queue control for returning the slot at fence retirement rather than on elapsed cooldown alone. The probe called the extracted allocator directly. It did not invoke XCL's release hook or submit work using the replacement slot. No physical GPU or title run. AI use: OpenAI Codex (GPT-6) prepared and ran the probe and drafted this report. |
Port #2985 so supported fallback resources can share backing heaps and reuse the decoded layout. Assisted-by: Codex (exact model identifier unavailable)
|
Independent test report under Wine/Proton (not native Windows) for head Setup
Tests (debug,
Retail title, 300 s (release;
Not tested
AI use
|
|
Review of
AI use: Gemini 4 Hydrogen High (agy2 for #2981, agy3 for #2985 and #2989; Antigravity) read the PR diff, its comments and the touched code and wrote the report; Claude Code (Claude Sonnet 5.5, coordinator) spot-checked the points marked "checked" against |
|
NVIDIA run (listed as untested), with the RX 9070 XT from the same PC: the new tests pass on both. There's also a note on flaky Tested: at the PR head
Not tested: Tier-1-only devices, a soak beyond 60 s, a title, Intel. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
|
Closing as superseded on |
Pools eligible non-reservable fallback
CreatePlacedResourceXallocations into 16 MiBD3D12_HEAP_TYPE_DEFAULTplaced heaps (42.12xfaster thanCreateCommittedResourcein the D3D12 microbenchmark) and eliminates duplicatexg::Texture::newlayout computation on every texture registration (2.70xfaster).Root cause & summary of changes
During streaming and 3D rendering,
CreatePlacedResourceX(placements) spent80% of its wall time on fallbackCreateCommittedResourcecalls (0.40–0.56 msper call forTEXTURE1D, 3D packed-mip textures, and small non-UMA buffers that bypassvram_small::placeandvram::place_on_pages) and recomputingxg::Texture::new(&x)twice per texture (once indevice_x.rsforconsole_bytes, then dropped and recomputed insidetitle_textures::register).xg::Texture::new(&x)(device_x.rs,title_textures.rs):Arc::new(xg::Texture::new(&x))once increate_placed_resource_x, reuses viaArc::cloneforwater_tex, and passesOption<Arc<xg::Texture>>intotitle_textures::register.CreatePlacedResource(vram_small.rs,device_x.rs,vram.rs):DefaultFallbackPoolsinvram_small.rs: sub-allocates non-reservable fallback resources up to 4 MiB (TEXTURE1D, non-reservable non-RT/DS textures, and small non-UMA buffers) in 64 KiB units inside 16 MiBD3D12_HEAP_TYPE_DEFAULT(D3D12_HEAP_FLAG_NONE, cachedResourceHeapTier >= 2check per device) heaps.!is_placed_texture), rolls back offsets immediately onCreatePlacedResourcefailure, cools freed ranges for 2 s before reuse via size-class free lists, and uses a lock-freeFALLBACK_LIVEfast-path fromvram::forget_for_recycle->vram_small::forget_fallback.XCL_VRAM_FALLBACK_POOL=0kill-switch (default enabled) for easy A/B comparison.Tested
amd-dev(bf7c82ee+321e1eba,--test-threads=1, 0 new warnings):cargo test -p xcl --lib hle::d3d12x::vram_small -- --nocapture --test-threads=1:6 passed; 0 failed; 1 ignored(includingfallback_pool_packs_cools_recycles_and_rolls_back,fallback_candidate_filters_msaa_and_oversized_buffers, and live GPU testgpu_fallback_pool_places_texture1d_and_small_buffers_cleanly).cargo test -p xcl --lib hle::d3d12x::title_textures::tests::register_reuses_precomputed_xg_texture_arc:1 passed; 0 failed.cargo test -p xcl --release --lib hle::d3d12x::vram_small::tests::bench_fallback_pool_vs_committed_and_xg_dedup -- --ignored --nocapture --test-threads=1):TEXTURE1D+ 4 KiB buffer):CreateCommittedResource102.17 ms(399.12 us/op) vsplace_fallback2.43 ms(9.48 us/op) ->42.12xspeedup.xg::Texture::newdedup (2000x 1024x1024 10-mip BC1): double1.36 ms(0.68 us/op) vs dedup0.50 ms(0.25 us/op) ->2.70xspeedup.Not tested
D3D12_RESOURCE_HEAP_TIER_2).Regression run
Baseline (
main,b49be183):This PR (
321e1ebaonamd-devbf7c82ee):AI use