Repository navigation
Conversation
|
Review (head 19fc7dd, diff read, not a merge-check):
Fine: AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
Thanks for the thorough review — addressed all four points in 1aa29c4:
AI use: Antigravity (Gemini 4 Neon) assisted with implementing the fixes, running the tests and matched smokes, and drafting this reply. |
|
Follow-up review (head 1aa29c4, since 19fc7dd, diff read, not a merge-check):
New:
Fine: L0 bytes stay out of the local cap ( AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
1aa29c4 to
344962b
Compare
|
Thanks for catching the shrink-before-spill bug — fixed and squashed into a single clean commit (
AI use: Antigravity (Gemini 4 Neon) assisted with fixing the shrink-before-spill path, updating the unit test, squashing, and drafting this reply. |
|
Follow-up review (head 344962b, since 1aa29c4, diff read, not a merge-check; checks red):
New:
Fine: the record path no longer shrinks before spilling; 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).
344962b to
4179a5a
Compare
|
Follow-up review (head 4179a5a, since 344962b, diff read, not a merge-check; checks red):
New: none. Since AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
@Foniass Let your bot take a breath bro. I haven't even had a chance to post the smoke results yet. |
|
Fixed the relative local/L0 caps in All substantive review points are now addressed and tested ( AI use: Antigravity (Gemini 4 Neon) applied the relative-cap test fix, ran the head smoke, and drafted this reply. |
…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).
|
merge-check claim |
…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).
|
merge-check |
…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).
…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).
|
merge-check claim |
|
merge-check |
When local-VRAM two-pass UAV buffers reach
XCL_TWO_PASS_MB(or the dynamic DXGI headroom floor), two-pass draws spin-wait up toFENCE_WAIT_LIMITand 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_ALIVEandFREE_L0_RES), while preserving the original localFENCE_WAIT_LIMITwait 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(default512MiB;0disables spillover) andTWO_PASS_L0_ALIVE/FREE_L0_REStracking (TwoPassBuf::is_l0).uav_buffer_in_poolcreatesD3D12_HEAP_TYPE_CUSTOM+D3D12_MEMORY_POOL_L0+D3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLEbuffers for L0 spillover and caches non-OOM adapter refusals (L0_UNSUPPORTED).acquire_res_buf_or_l0andscratch_args: try full-size local (0 ms, no shrink), spill full-size to L0 on local-cap miss, and fall back to the original localFENCE_WAIT_LIMITwait + shrink/refusal path if L0 is full or unsupported.trim_idle_l0_free: trims idleFREE_L0_RESentries older thanFREE_RES_IDLEfromrelease_allocator_resandtake_freeas well asput_free_bufs.two_pass_l0_spillover_tracks_and_reuses_separately_from_localandtwo_pass_l0_fallback_spills_on_local_cap_and_refuses_when_l0_full(caps computed relative toTWO_PASS[TP_ALIVE]/TWO_PASS_L0_ALIVE).Tested
32.0.16.2140), AMD Ryzen 7 7800X3D, 31.1 GB RAM, Windows 11 build 26300,rustc 1.100.0, DXC1.8.2502.11.cargo test -p xcl --lib hle::d3d12x::bind::tests::two_pass_l0 -- --nocapture --test-threads=1on4179a5a5: 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, defaultXCL_PSO_PRELOAD,smoke.ps1defaultXCL_PREPARE=0):main(f07e426d):this PR (
4179a5a5):Not tested
vkd3d-proton), and full workspace test suite locally (covered by CI).AI use