Repository navigation
D3D12.X: add an opt-in two-tier texture budget - #3682
jeroenhaentjens wants to merge 10 commits into
Conversation
|
Review (head 5a89516, diff read, not a merge-check; draft, checks red):
Not reviewed line by line because of the size. Fine: the allocation routing and promotion gate are behind AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
@Foniass Both review fixes are in |
|
Follow-up review (head d58531c, since 5a89516, diff read, not a merge-check; draft, conflicts): Earlier points:
New:
Fine: AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
Route eligible sampled backing through non-local memory under DXGI pressure. Keep render targets, depth and UAV backing local, promote overlapping tile aliases after the GPU completes, and report individual allocation routes. Assisted-by: Codex (GPT-6, specific model version not exposed)
d58531c to
d7ddf34
Compare
|
@Foniass I rebased the draft on main |
|
Follow-up review (head d7ddf34, since d58531c, diff read, not a merge-check; draft): Earlier points:
New:
Fine: the snapshot still blocks sealing while a retirement is AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
Keep the last resource reference and tile users until the submit queues and the NULL mapping are complete. Include stopping queues, reject the device-removed fence sentinel, and signal outside the release lock. Exercise a blocked L0 upload and mapping on the selected GPU. Assisted-by: OpenAI Codex (GPT-6, exact variant unavailable) (cherry picked from commit 00dfacb)
Check available physical memory in the common non-local reservation before calling the driver. Charge concurrent L0 requests, retain a configurable floor, and report denials. Assisted-by: OpenAI Codex (GPT-6, exact variant unavailable) (cherry picked from commit 9ce27a1)
Query DXGI on the selected adapter with the Debug Layer and assert a clean diagnostic queue. Keep the fixture out of the process-owned title backend and isolate the Debug Layer from other tests. Assisted-by: OpenAI Codex (GPT-6, exact variant unavailable) (cherry picked from commit 93d613f)
Distinguish a temporary retirement from a failed, pinned queue. Let later batches finish on the remaining queues while older fences and unproven reserved backing stay protected. Test the failure and recovery with a native fence on a healthy queue. Assisted-by: OpenAI Codex (GPT-6, specific revision unavailable)
For backing eligible on both segments, reuse the hard local admission limit after a non-local reservation is denied. Charge the allocation to the same DXGI sample and verify that the next request cannot exceed the remaining headroom. Assisted-by: OpenAI Codex (GPT-6, specific revision unavailable)
Use the configured adapter and verify its debug info queue. This allows the fixture to run with D3D12 validation enabled on a multi-adapter host. Assisted-by: OpenAI Codex (GPT-6, specific revision unavailable)
Keep a separate completion dependency for each failed queue. A deferred texture on another device can recycle immediately. Same-device work can keep referencing bindless descriptors until the stopped queue has a proven completion marker. Retry that marker on the retirement worker and recheck held backing when it completes. Assisted-by: OpenAI Codex (GPT-6, specific revision unavailable)
Use automatic adapter selection in the six new GPU tests while retaining the XCL_ADAPTER override and the existing feature checks. Assisted-by: OpenAI Codex (GPT-6, specific revision unavailable)
d7ddf34 to
0877fa9
Compare
|
@Foniass I folded |
|
Follow-up review (head 0877fa9, since d7ddf34, diff read, not a merge-check; draft, checks red): Earlier points:
New: none. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
Above the pool spill threshold, keep the L0 preference and retry the remaining sampled tiles locally if the pool cannot grow in L0. Reuse compatible tiles and admit any new heap under DXGI budget minus 8 MiB. Count the fallback heaps so retail runs can verify the route. Test the fallback on a discrete GPU with a full synthetic non-local budget, verify reuse, and reject a second heap beyond the local ceiling. Assisted-by: OpenAI Codex (GPT-6, specific revision unavailable)
|
Follow-up review of In short: The only change since High
Medium
Checked and fine
Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point. |
What & Why
On a discrete adapter, sampled backing can consume local memory that render targets, depth buffers and UAVs require. Overlapping aliases need GPU-ordered moves and reserved backing must outlive both GPU use and tile updates. L0 growth also uses physical system memory and needs its own admission check.
What is in it
XCL_TEXTURE_BUDGET=1. Admit eligible sampled texture backing toCUSTOM/L0and retain local headroom for required resources up to the DXGI budget minus 8 MiB.XCL_TEXTURE_SOFT_CAP_MIB,XCL_BUDGET_L0_PHYS_HEAPS,XCL_BUDGET_L0_TILEPOOLSandXCL_BUDGET_L0_COMMITTED. Report memory by allocation owner.XCL_LATE_RELEASE=0when the texture budget is active.GlobalMemoryStatusExbefore admitting new L0 backing. Allow growth only if the request and in-flight L0 reservations leave at least 3,072 MiB of available physical RAM. Override the floor withXCL_L0_MIN_FREE_PHYS_MIB. Count refusals inl0_phys_ram_guard_denials.local_tilepool_fallback_heaps.Tested
0877fa974041d32ba4f8f52250c149698ce1dbc9rebased onorigin/mainat817eb1fc9fb0763008ae5d8de1f7f586f442b51d. The rebase preserves the upstream mapping Signal retry and reserved-spare logic.git diff --checkandgit diff --check origin/main...HEADpassed.cargo check --locked -p xcl --testspassed on all nine commits. The reserved-spare compatibility changes were folded intofd938727.autoadapter selection, withXCL_ADAPTERstill available to select a specific adapter.cargo test --locked -p xcl --lib -- --test-threads=1 --nocapture --skip hle::d3d12x::vram::tests::reserved_resource_with_private_data_is_excluded_from_recycle hle::d3d12x::vram::tests hle::d3d12x::vram_promotion hle::d3d12x::late_release::tests· 106 passed, 0 failed, 1 existing ignored timing test, 0SKIPPEDnotices.cargo test --locked -p xcl --lib -- --test-threads=1 --nocapture --exact hle::d3d12x::vram::tests::reserved_resource_with_private_data_is_excluded_from_recycle· 1 passed, 0 failed, 0 ignored, 0SKIPPEDnotices. The fixture passed in its own process on retry after exit code 2173.cargo test --locked -p xcl --lib -- --test-threads=1 --nocapture hle::d3d12x::memory_report gpu::uma· 26 passed, 0 failed, 0 ignored, 0SKIPPEDnotices.XCL_ADAPTER=nvidiaandXCL_D3D12_DEBUG=1. The new regression uploaded a mapped texture on the Quadro, recycled it while a second device's queue stayed failed, and checked that a same-device dependency was held until its recovery fence completed. It reported 0 D3D12 Debug Layer messages, as did the other instrumented probes in their checked categories.XCL_ADAPTERunset selected the Quadro automatically and passed all six updated fixtures with zero Debug Layer diagnostics in the checked categories.0877fa974041d32ba4f8f52250c149698ce1dbc9.cargo build --locked --releasecompleted in 4m 03s with 39 compiler warnings. One retail start on the Quadro RTX 3000 with the existing DXIL cache,XCL_ADAPTER=nvidia,XCL_DEVICE_TYPE=lockhart,XCL_TEXTURE_BUDGET=1,XCL_L0_MIN_FREE_PHYS_MIB=3072,XCL_GFX_PSO_WAIT_MS=8000, andXCL_CS_PSO_WAIT_MS=35000.0x80000003around +145 s. The launcher exited 303.4 s after start, 264.2 s after the first input attempt and about 153 s after loading began. No 3D world was observed and the log reported no DXGI device removal.l0_phys_ram_guard_denialsrecorded three denials (192 MiB across the retries). Two committed allocations used the required local reserve (2.25 MiB). DirectStorage activity samples recorded 50,966 requests and zero failures.TileSegments::NonLocalabove its 4,000 MiB soft limit, which excludes the local-reserve retry inreserve_texture_backing. OpenAI Codex (GPT-6, specific revision unavailable) ran and reported this verification.b647ecab63afb4616d7908f005e818ecf1ed3701passedgit diff --checkandcargo build --locked --release(3m 01s, 39 warnings).XCL_ADAPTER=nvidiaandXCL_D3D12_DEBUG=1.cargo test --locked -p xcl --lib hle::d3d12x::vram::tests -- --test-threads=1 --nocapture --skip hle::d3d12x::vram::tests::reserved_resource_with_private_data_is_excluded_from_recyclereported 97 passed, including 10SKIPPEDnotices, 0 failed and 1 ignored. The same selection with--releasereported the same counts. The new fallback regression passed on the hardware in both profiles with 0 Debug Layer messages. The isolated private-data fixture exited with2173on both the archived0877fa97build and the new build.XCL_TEXTURE_BUDGET=1,XCL_L0_MIN_FREE_PHYS_MIB=3072,XCL_GFX_PSO_WAIT_MS=8000, andXCL_CS_PSO_WAIT_MS=35000. It entered the loading phase. A texture placement ran out of memory after its retries near +117 s from estimated loading start and was followed by breakpoint0x80000003. The launcher exited at +125.1 s from estimated loading start and 166.4 s total, before the +145 s capture. No 3D world or DXGI device removal was observed.local_tilepool_fallback_heapsrecorded 9 new local heaps (576 MiB). At the final denied 64 MiB request, DXGI reported 5,176.8 MiB in use against a 5,187.0 MiB local budget, leaving about 2.2 MiB under the budget minus 8 MiB ceiling. Peak sampled DXGI was 5,176 MiB local and 7,266 MiB non-local. Minimum sampled available physical RAM was 2,831.4 MiB.l0_phys_ram_guard_denialsrecorded 312 denied 64 MiB attempts including retries. DirectStorage activity samples recorded 52,867 requests and 0 failures. OpenAI Codex (GPT-6, specific revision unavailable) implemented and ran this verification.b647ecab63afb4616d7908f005e818ecf1ed3701release binary on the Quadro RTX 3000 with the existing DXIL cache. It used Lockhart,XCL_TEXTURE_BUDGET=1,XCL_TEXTURE_SOFT_CAP_MIB=3400,XCL_L0_MIN_FREE_PHYS_MIB=2304,XCL_GFX_PSO_WAIT_MS=8000, andXCL_CS_PSO_WAIT_MS=35000. Closing 19 Chrome processes and waiting five seconds raised available physical RAM from 16.77 to 20.21 GiB. The Codex host remained running. Minimum sampled available physical RAM was 1,590.9 MiB.0x80000003. The last failed request had 38.8 MiB available under the local DXGI budget minus 8 MiB ceiling. The launcher exited at 240.6 s total and +199.2 s from estimated loading start, ahead of the +250 s capture. No 3D world or DXGI device removal was observed.local_tilepool_fallback_heapsrecorded 12 heaps (768 MiB) andl0_phys_ram_guard_denialsrecorded 3,539 denied attempts including retries. DirectStorage activity samples recorded 77,990 requests and 0 failures. C: had a sampled minimum of 4.89 GiB free and 5.53 GiB free after verified archival. OpenAI Codex (GPT-6, specific revision unavailable) ran and reported this verification.b647ecab63afb4616d7908f005e818ecf1ed3701release binary on the Quadro RTX 3000 with the existing DXIL cache. It used Lockhart,XCL_TEXTURE_BUDGET=1,XCL_TEXTURE_SOFT_CAP_MIB=3000,XCL_L0_MIN_FREE_PHYS_MIB=1024,XCL_GFX_PSO_WAIT_MS=8000, andXCL_CS_PSO_WAIT_MS=35000. Closing 13 Chrome processes and waiting five seconds raised available physical RAM from 17.98 to 19.60 GiB.local_tilepool_fallback_heapsrecorded zero new heaps andl0_phys_ram_guard_denialsrecorded 62 denied attempts including retries. DirectStorage activity samples recorded 75,646 requests and 0 failures. C: had a sampled minimum of 5.52 GiB free and 5.86 GiB after verified archival. OpenAI Codex (GPT-6, specific revision unavailable) ran and reported this verification.Regression run
The paired
mainand exact-head smoke runs remain pending.Not tested
Full workspace suite, AMD, Linux, paired smoke runs, transition into the 3D world and sustained workload behavior remain unverified on
b647ecab. On the earlier combined integration head9f9bc9b8f, Run 16 faulted indxgmms2.sysduring VidMm eviction (0x7E). Run 17 faulted in the Windows compressed-memory store (0x154,0xC0000005inStDmpSinglePageLookup) with around 474 MiB of available physical RAM. The dump showed 9.51 GiB of system commit headroom and 15.95 GiB free in the disk pagefile. The synthetic regression verifies the corrected release sequence. The effect on the earlier kernel crashes remains unverified.AI use
OpenAI Codex (GPT-6, specific revision unavailable) assisted with the review fixes, rebase, regression tests, test execution and this update. Author review of this revision is pending.