Skip to content

D3D12.X: spill overflow two-pass UAV buffers to L0 system memory - #3614

Open
saintwolf wants to merge 1 commit into
xcl-dev:mainfrom
saintwolf:d3d12x/two-pass-l0-spillover
Open

saintwolf wants to merge 1 commit into
xcl-dev:mainfrom
saintwolf:d3d12x/two-pass-l0-spillover

Conversation

@saintwolf

@saintwolf saintwolf commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

When local-VRAM two-pass UAV buffers reach XCL_TWO_PASS_MB (or the dynamic DXGI headroom floor), two-pass draws spin-wait up to FENCE_WAIT_LIMIT and then shrink or skip draws once the local cap is saturated. On 12 GiB non-UMA cards during heavy mesh-shader world loads, this caused heavy draw skipping and multi-millisecond fence-wait stalls.

This PR adds a bounded D3D12_MEMORY_POOL_L0 (system-memory) spillover pool for full-size overflow two-pass record and argument-scratch UAV buffers, tracked separately from the local VRAM cap (TWO_PASS_L0_ALIVE and FREE_L0_RES), while preserving the original local FENCE_WAIT_LIMIT wait and shrink/refusal fallback whenever L0 spillover is disabled, full, or unsupported by the adapter.

Complementary to #3165 (draft).

What is in it

  • crates/xcl/src/hle/d3d12x/bind.rs:
    • XCL_TWO_PASS_L0_MB (default 512 MiB; 0 disables spillover) and TWO_PASS_L0_ALIVE / FREE_L0_RES tracking (TwoPassBuf::is_l0).
    • uav_buffer_in_pool creates D3D12_HEAP_TYPE_CUSTOM + D3D12_MEMORY_POOL_L0 + D3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLE buffers for L0 spillover and caches non-OOM adapter refusals (L0_UNSUPPORTED).
    • acquire_res_buf_or_l0 and scratch_args: try full-size local (0 ms, no shrink), spill full-size to L0 on local-cap miss, and fall back to the original local FENCE_WAIT_LIMIT wait + shrink/refusal path if L0 is full or unsupported.
    • trim_idle_l0_free: trims idle FREE_L0_RES entries older than FREE_RES_IDLE from release_allocator_res and take_free as well as put_free_bufs.
    • Unit tests: two_pass_l0_spillover_tracks_and_reuses_separately_from_local and two_pass_l0_fallback_spills_on_local_cap_and_refuses_when_l0_full (caps computed relative to TWO_PASS[TP_ALIVE] / TWO_PASS_L0_ALIVE).

Tested

  • Hardware: NVIDIA GeForce RTX 4070 SUPER (12 GiB, driver 32.0.16.2140), AMD Ryzen 7 7800X3D, 31.1 GB RAM, Windows 11 build 26300, rustc 1.100.0, DXC 1.8.2502.11.
  • cargo test -p xcl --lib hle::d3d12x::bind::tests::two_pass_l0 -- --nocapture --test-threads=1 on 4179a5a5: 2 passed, 0 failed, 0 skipped.
  • cargo test -p xcl --lib hle::d3d12x::bind::tests -- --test-threads=4: 117 passed, 0 failed.

Regression run
Matched 60 s smoke runs with identical settings (XCL_DIRECT_DXIL=1, default XCL_PSO_PRELOAD, smoke.ps1 default XCL_PREPARE=0):

main (f07e426d):

xcl-smoke v1
commit: f07e426dade72aa7112cf6bfe08ca6f6ff5a9d5c
gpu: NVIDIA GeForce RTX 4070 SUPER
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1668 (PresentX 1668)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 16731 MB

this PR (4179a5a5):

xcl-smoke v1
commit: 4179a5a59e50520bab7f0be8b608a0e8625a2db1
gpu: NVIDIA GeForce RTX 4070 SUPER
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1685 (PresentX 1685)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 17117 MB

Not tested

  • AMD / Intel GPUs, Linux / Wine (vkd3d-proton), and full workspace test suite locally (covered by CI).
  • Note that the 60 s menu smoke does not saturate the local two-pass cap; the spillover, local-shrink fallback, and L0-full refusal paths are exercised by the two unit tests on hardware D3D12.

AI use

  • Antigravity (Gemini 4 Neon) assisted with diagnosing the two-pass cap exhaustion, writing the L0 spillover + fallback/trimming fixes and unit tests, running tests and matched smokes, and drafting this description. Reviewed by me.

@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) labels Dec 1, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Review (head 19fc7dd, diff read, not a merge-check):

  • The fence wait is gone on the default path, even when L0 cannot help. ensure_res_buffer_with_cap (bind.rs ~3087) and scratch_args (~3297) now pass a zero wait whenever XCL_TWO_PASS_L0_MB is non-zero, which is the default. When try_make_l0 then returns None (the 512 MiB L0 cap is full, or CreateCommittedResource on the L0 heap fails, ~285-301), the draw is refused at once instead of waiting up to FENCE_WAIT_LIMIT as on main, so under the heaviest load more draws can be skipped than before. A failed L0 creation is not remembered and is retried on every miss. "Fall back cleanly to the existing refusal path" does not hold, because that path used to wait.
  • On by default with no like-for-like evidence. With the default 512 MiB, any local-cap miss moves record and argument buffers to system memory, even when in-flight fences are about to free local ones, and the L0 attempt comes before the existing-buffer shrink path (~3091). The PR-head smoke run used XCL_DIRECT_DXIL=1, XCL_PREPARE=0 and XCL_PSO_PRELOAD=0, but no settings are given for the main run, so 1045 → 1658 frames does not isolate this change; the retail numbers were measured together with other local L0 testing, and the full suite was not run.
  • Idle L0 buffers stay allocated after spilling stops. FREE_L0_RES is trimmed only when L0 buffers are put back (put_free_bufs, ~491); release_allocator_res (~737) and take_free trim only FREE_RES, and try_make_l0 only runs when the local cap is full. After a spill burst up to 256 MiB of system-memory buffers stay committed until the next spill instead of going after FREE_RES_IDLE.
  • The test does not cover the fallback wiring. two_pass_l0_spillover_tracks_and_reuses_separately_from_local (~10294) calls try_make_l0 and put_free_bufs directly; nothing tests that ensure_res_buffer_with_cap or scratch_args fall back to L0 after a local refusal, the L0-full case, or the zero-wait change.

Fine: TWO_PASS_L0_ALIVE and the is_l0 drop path keep L0 bytes out of the local TP_ALIVE cap, and the reserve calls are rolled back when L0 creation fails. Draft #3165 tackles the same skipped draws by letting buffers exceed the local cap; a maintainer may want only one of the two.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

@saintwolf

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review — addressed all four points in 1aa29c4:

  1. Preserved local fence-wait fallback: \�cquire_res_buf_or_l0\ and \scratch_args\ now try fast local (0 ms) -> L0 spillover -> if L0 is full or unsupported, fall back to the original local \FENCE_WAIT_LIMIT\ wait before shrinking/refusing, so it cannot skip more draws than \main. Non-OOM L0 creation failures are cached in \L0_UNSUPPORTED\ so subsequent misses go straight to the local wait path.
  2. Idle L0 buffer trimming: Added \ rim_idle_l0_free\ (older than \FREE_RES_IDLE) called from
    elease_allocator_res\ and \ ake_free\ as well as \put_free_bufs, so idle L0 buffers are released after a spill burst ends.
  3. Fallback wiring test: Added \ wo_pass_l0_fallback_spills_on_local_cap_and_refuses_when_l0_full\ exercising \�cquire_res_buf_or_l0\ on both local-cap-full -> L0 spillover and L0-full -> clean \Ok(None)\ fallback (2/2 passed on RTX 4070 SUPER).
  4. Matched smoke: Replaced the regression section with matched 60 s runs of \main\ (\ 07e426d) and \1aa29c4d\ under identical settings (\XCL_DIRECT_DXIL=1, default \XCL_PSO_PRELOAD).

AI use: Antigravity (Gemini 4 Neon) assisted with implementing the fixes, running the tests and matched smokes, and drafting this reply.

@github-actions github-actions Bot added gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) and removed gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) labels Dec 1, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Follow-up review (head 1aa29c4, since 19fc7dd, diff read, not a merge-check):

  • The fence wait is gone on the default path, even when L0 cannot help: fixed. acquire_res_buf_or_l0 (bind.rs ~3105-3124) and scratch_args (~3345-3359) try local with no wait, then L0, then the old FENCE_WAIT_LIMIT wait when L0 returns None; adapter refusals other than out-of-memory are remembered in L0_UNSUPPORTED (~304-308).
  • On by default with no like-for-like evidence: partly fixed. The smoke runs now use the same settings, but the description says the 60 s run never fills the local cap, so the spill path is not measured in a game, and the full suite was not run on a GPU.
  • Idle L0 buffers stay allocated after spilling stops: fixed. trim_idle_l0_free (~743) is also called from release_allocator_res (~751) and take_free (~771).
  • The test does not cover the fallback wiring: partly fixed. two_pass_l0_fallback_spills_on_local_cap_and_refuses_when_l0_full (~10392) goes through acquire_res_buf_or_l0, but with min_fit == need, so the shrink case below is not covered, and the L0 fallback in scratch_args is not tested.

New:

  • Under cap pressure the record buffer shrinks before any wait or spill. acquire_res_buf_or_l0 first calls acquire_res_buf_with_cap with a zero wait (~3115), and that function still runs its shrink loop (~666-690), down to one record (min_fit is record_bytes, ~3579, ~3846). With the default XCL_TWO_PASS_L0_MB=512, a draw that hits the local cap gets a smaller local buffer at once and is sliced or has groups cut (record_groups, ~3580), where main first waits up to FENCE_WAIT_LIMIT for a full-size buffer. L0 is tried only when even the smallest size fails, so "spill to L0 on a local-cap miss" does not hold for record buffers.
  • Fixup commit not squashed. 1aa29c4d fixes 19fc7dd3, whose message still says overflow buffers spill "instead of spin-waiting and skipping draws".

Fine: L0 bytes stay out of the local cap (TWO_PASS_L0_ALIVE, is_l0 on drop); reserve is rolled back when L0 creation fails; XCL_TWO_PASS_L0_MB=0 gives back the main path.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

@saintwolf
saintwolf force-pushed the d3d12x/two-pass-l0-spillover branch from 1aa29c4 to 344962b Compare December 1, 2026 21:48
@saintwolf

Copy link
Copy Markdown
Contributor Author

Thanks for catching the shrink-before-spill bug — fixed and squashed into a single clean commit (344962b9) on main (f07e426d):

  1. No shrink before L0 spill: acquire_res_buf_or_l0 now calls acquire_two_pass_buf_with_cap for the full need size with Duration::ZERO (no shrink loop), then spills the full-size buffer to L0 via TwoPassBuf::try_make_l0_with_cap, and only falls back to acquire_res_buf_with_cap(..., FENCE_WAIT_LIMIT) (wait + shrink) if L0 is disabled, full, or unsupported.
  2. Expanded fallback test: two_pass_l0_fallback_spills_on_local_cap_and_refuses_when_l0_full now uses min_fit < local_cap < need to assert all three transitions: full-size L0 spill without shrinking, local-shrink fallback when L0 is full, and Ok(None) when both caps are full (2/2 passed on RTX 4070 SUPER).
  3. Squashed: Combined into one commit (344962b9) with an accurate commit message.

AI use: Antigravity (Gemini 4 Neon) assisted with fixing the shrink-before-spill path, updating the unit test, squashing, and drafting this reply.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Follow-up review (head 344962b, since 1aa29c4, diff read, not a merge-check; checks red):

  • Under cap pressure the record buffer shrinks before any wait or spill: fixed. acquire_res_buf_or_l0 (bind.rs ~3106-3123) now tries acquire_two_pass_buf_with_cap at full size with no wait and no shrink loop, then L0, and only then acquire_res_buf_with_cap with FENCE_WAIT_LIMIT.
  • The test does not cover the fallback wiring: partly fixed. The shrink case is covered (~10409-10423: full-size L0 buffer, then a local shrink once L0 is full); the L0 fallback in scratch_args (~3344-3358) is still untested.
  • Fixup commit: fixed; one commit, with a message that no longer claims draws stop being skipped.
  • No like-for-like evidence on the spill path: partly fixed. The smoke blocks name 1aa29c4d, not the head 344962b9, so PR description fails; the description still says the 60 s run never fills the local cap, and the full suite was not run on a GPU.

New:

  • The new test steps use absolute local caps. Steps 2 and 3 (~10421, ~10426) pass budget_cap as 2 << 20 and 1, but TWO_PASS[TP_ALIVE] counts every live local two-pass buffer in the process, so if earlier tests still hold more than 1 MiB (fenced or awaiting an allocator reset) the shrink in step 2 cannot fit and the test fails depending on order. The other cap tests compute their cap from TWO_PASS[TP_ALIVE].load(..) (~10001, ~10123, ~10330).

Fine: the record path no longer shrinks before spilling; XCL_TWO_PASS_L0_MB=0 (or an adapter that refuses L0) keeps main's wait-and-shrink path; L0 bytes stay out of the local cap; reserve is rolled back when L0 creation fails.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

When local-VRAM two-pass UAV buffers reach XCL_TWO_PASS_MB (or the dynamic DXGI headroom floor), spill full-size overflow record and argument-scratch buffers to D3D12_MEMORY_POOL_L0 (up to XCL_TWO_PASS_L0_MB, default 512 MiB; 0 disables) tracked separately in TWO_PASS_L0_ALIVE and FREE_L0_RES (trimmed on idle from put_free_bufs, release_allocator_res, and take_free). When L0 spillover is disabled, full, or unsupported by the adapter, fall back to the original local FENCE_WAIT_LIMIT wait + shrink/refusal path.

Complementary to xcl-dev#3165 (draft).
@saintwolf
saintwolf force-pushed the d3d12x/two-pass-l0-spillover branch from 344962b to 4179a5a Compare December 1, 2026 21:59
@github-actions github-actions Bot added the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Dec 1, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Follow-up review (head 4179a5a, since 344962b, diff read, not a merge-check; checks red):

  • The new test steps use absolute local caps: fixed. two_pass_l0_fallback_spills_on_local_cap_and_refuses_when_l0_full (bind.rs ~10404-10431) now takes its local and L0 caps relative to TWO_PASS[TP_ALIVE] and TWO_PASS_L0_ALIVE at the start, like the other cap tests, so it no longer depends on what earlier tests still hold.
  • The L0 fallback in scratch_args is untested: still open (~3344-3358).
  • Evidence: still open. The smoke block still names 1aa29c4d, not the head 4179a5a5 (the reason PR description is red), the spill path is not reached in the 60 s run, and the test counts are from 1aa29c4d / 19fc7dd3 with no full-suite run on a GPU.

New: none. Since 344962b9 only the test changed.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

@saintwolf

Copy link
Copy Markdown
Contributor Author

@Foniass Let your bot take a breath bro. I haven't even had a chance to post the smoke results yet.

@saintwolf

Copy link
Copy Markdown
Contributor Author

Fixed the relative local/L0 caps in two_pass_l0_fallback_spills_on_local_cap_and_refuses_when_l0_full (local_before + ... / l0_before + ...), amended to 4179a5a5, and updated the PR description with a fresh 60 s head smoke (1685 frames, 60 61 60, 0 removals/crashes).

All substantive review points are now addressed and tested (2/2 L0 unit tests passed on hardware D3D12, single clean commit, matched head smoke). Leaving this ready for human maintainer review.

AI use: Antigravity (Gemini 4 Neon) applied the relative-cap test fix, ran the head smoke, and drafted this reply.

@github-actions github-actions Bot removed the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Dec 1, 2026
saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM, never share L0-backed pages (isolated via ExtraKey = (va, tile_index, local_only)), and keep_pools skips L0 heaps. Non-OOM adapter refusals of custom L0 heaps are cached per heap class so subsequent allocations go straight to DEFAULT.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), and xcl-dev#3039 (unconditional streamed texture sysmem).
@github-actions github-actions Bot added needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU needs:nvidia-test Needs a test report or merge-check on an NVIDIA GPU labels Dec 1, 2026
@jsalzy

jsalzy commented Dec 1, 2026

Copy link
Copy Markdown

merge-check claim
head: 4179a5a

saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM, never share L0-backed pages (isolated via ExtraKey = (va, tile_index, local_only)), and keep_pools skips L0 heaps. Non-OOM adapter refusals of custom L0 heaps are cached per heap class so subsequent allocations go straight to DEFAULT.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), and xcl-dev#3039 (unconditional streamed texture sysmem).
@jsalzy

jsalzy commented Dec 1, 2026

Copy link
Copy Markdown

merge-check
base: 1c8b551
head: 4179a5a
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2911 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none
review: whole diff read (bind.rs, +270/-23). Both new GPU tests ran and passed on this NVIDIA card (not skipped: the driver made the CUSTOM / MEMORY_POOL_L0 / NOT_AVAILABLE UAV buffers): two_pass_l0_spillover_tracks_and_reuses_separately_from_local, two_pass_l0_fallback_spills_on_local_cap_and_refuses_when_l0_full. L0 buffers are counted in TWO_PASS_L0_ALIVE and FREE_L0_RES only, and Drop subtracts from the right counter. Foniass's points look addressed at this head: with L0 full or unsupported, the original FENCE_WAIT_LIMIT wait and shrink path runs as before. Behaviour change to note: it is on by default (XCL_TWO_PASS_L0_MB=512), and while L0 has room a full local cap now spills at once instead of waiting up to 10 ms for in-flight buffers, so up to 512 MiB alive plus a 256 MiB free pool go to system commit, which matters on 32 GB machines near their commit limit. Minor: the adapter-refusal test in try_make_l0_with_cap matches the error text ("0x8007000E"); #3620 checks err.code() instead, which is sturdier. Overlaps draft #3165 in the same two-pass cap code (the author calls them complementary); not a duplicate.
performance: not measured.
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build and suite run on this PC with git and cargo only; diff review by Claude Opus 5.5.

@github-actions github-actions Bot added needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) and removed needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:nvidia-test Needs a test report or merge-check on an NVIDIA GPU labels Dec 1, 2026
saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range promotes the page in-place to a local VRAM tile, cools the old L0 tile, and remaps any live mapped aliases in Pages::targets onto the promoted local tile so aliased reads never observe stale data. Non-OOM adapter refusals of custom L0 heaps are cached per heap class.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
saintwolf added a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
…re pools to L0

Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget.

Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range promotes the page in-place to a local VRAM tile, cools the old L0 tile, and remaps any live mapped aliases in Pages::targets onto the promoted local tile so aliased reads never observe stale data. Non-OOM adapter refusals of custom L0 heaps are cached per heap class.

Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
@vasanex

vasanex commented Dec 2, 2026

Copy link
Copy Markdown

merge-check claim
head: 4179a5a

@vasanex

vasanex commented Dec 2, 2026

Copy link
Copy Markdown

merge-check
base: 1c8b551
head: 4179a5a
merge: clean (merged tree f0185483, git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2911 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache), the same set as on the base; failing: none. Base alone, same machine: 2909 passed, 0 failed, 51 ignored. Both new tests pass and did not skip (two_pass_l0_spillover_tracks_and_reuses_separately_from_local, two_pass_l0_fallback_spills_on_local_cap_and_refuses_when_l0_full), so this card and driver accept a custom L0 UAV buffer without CPU access.
review: whole diff read (bind.rs), in the merge result. No blocking finding; three points for whoever merges, most serious first. (1) It is on by default (512 MiB) and it changes what happens at a full local cap: main waits up to 10 ms on the oldest fences for local memory and then shrinks; with this the first try has no wait, the buffer goes to system memory at once, and the wait and shrink come only when L0 is full or refused. Draws are kept instead of cut, at the price of record and argument buffers the GPU writes and reads over PCIe. Neither side of that is measured: the description's smoke and mine do not reach the cap (no two-pass buffers: line in either of my logs). (2) two_pass_cap is derived from the adapter's local budget. On an adapter with one memory segment (integrated GPUs) an L0 heap is the same memory, so there the default raises the two-pass ceiling by up to 512 MiB instead of moving anything; nothing in the diff tells the two kinds apart. Reasoned from the code, not run on such an adapter. (3) L0_UNSUPPORTED is set for good by any creation error whose text does not hold 0x8007000E, a lost device included; harmless (it only turns the spill off), but the log does not say so. Otherwise: L0 buffers are counted and freed apart from the local ones (TWO_PASS_L0_ALIVE, FREE_L0_RES, Drop), a buffer cannot change pools on reuse, idle L0 buffers are trimmed on the same paths as local ones, and XCL_TWO_PASS_L0_MB=0 gives main's path exactly. The tests compute their caps from the live counters, as the file's other cap tests do. No README line for XCL_TWO_PASS_L0_MB. Duplicates: none; #3165 (draft, lets a draw's buffer go past the cap) and #3620 (same author, texture pools) are other changes.
performance: 60 s smoke of the same title, release, default settings, same machine, one run each. Base 1c8b551: 1608 frames shown, presents per 2 s (last 3) 60 60 61, 0 device removals, 0 crashes, peak commit 19911 MB. Merge result (local merge commit of the two commits above): 1616 frames shown, 61 60 60, 0 device removals, 0 crashes, peak commit 18794 MB. No difference outside the run-to-run spread, and the run does not saturate the cap, so this shows only that the default path is unharmed when the cap is not reached. By default it can add up to 512 MiB of system memory once the cap is full.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 9 7950X, Windows 11 Pro 26200, rustc 1.100.0, debug suite and release smoke / Claude Code with Claude Fable 5.2. Run and posted without a human check of each point.

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) ready-to-merge Has 2 independent safe merge-checks on current head (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants