Repository navigation
D3D12.X: eliminate multi-heap UpdateTileMappings and per-texture Signal stalls in vram::Pages - #1747
Conversation
|
Corrected head I compared clean exact parent The existing title-texture test selects DXGI adapter 0 internally, so its full-suite run is not specific 3090 evidence. I therefore ran a local test-only fixture on this exact corrected head: AI use: Codex (GPT-6) prepared and ran the exact-revision Windows comparison and synthetic GPU fixture, checked hashes and logs, and drafted this update.RTX 3090 parent/head test follow-up — 24 November: I tested exact parent For an explicit NVIDIA check of the changed AI use: Codex (GPT-6) ran the exact-revision Windows comparisons and synthetic 3090 fixture, verified source hashes and logs, and prepared this update. I checked the exact head I am running a separate exact-parent/head Windows RTX 3090 comparison now. The existing AI use: Codex (GPT-6) reviewed the PR call site against the Microsoft reference, inspected the test log, and prepared this comment. The source/API finding was checked before posting. |
6b5c030 to
39e5f31
Compare
|
Thank you for catching the Updated in commit
|
|
Test report for
Tested: AMD RDNA4, Windows, DXC 1.8.2502.11, debug, adapter default. 1. The failure.
Our own test title ends with
The test is skipped where 2. Cause. The 3. Fix checked here: signal after each mapping again (as - self.dirty = true; // in map() and in unmap()
+ self.signal();
+ unsafe fn signal(&mut self) {
+ self.value += 1;
+ let _ = self.queue.Signal(&self.fence, self.value);
+ }plus removing 4. It costs almost nothing.
So the gain comes from one heap per texture and fewer 5. Whole suite ( I also read the whole diff. Not tested: AI use: Claude Code (Claude Opus 5.5) ran the tests, found the cause, wrote the fix and this report. |
|
NVIDIA test report for Tested
So the submit is 60–82x and gpu_done 42–51x faster here (29.4x / 17.4x in the description on the RX 9070 XT). The old path is slower on this driver to begin with (1.2 s vs 0.78 s). Regression run ( base ( this PR: Not tested: the world load (where placed textures churn the most), so no in-game timing of the change; AMD; the earlier AI use: Claude Code (Claude Opus 5.5) built and ran the tests, the timing test and the smoke runs on my machine and wrote this report; I checked it. |
|
Independent Windows 11 + NVIDIA GeForce RTX 3070 Ti (8 GB VRAM, wave32) A/B verification of exact PR head Short summary: the tile-pool and signal-batching speedups replicate strongly on 8 GB NVIDIA (45.0x faster Debug-layer regression (
|
39e5f31 to
3bc7143
Compare
|
Thank you both (@ivall and @KarolKurzyna) for tracking down the Updated in commit
|
|
Tested I checked the final merge I ran the ignored Not tested This covers texture mapping churn and the synthetic D3D12 debug-layer title. Retail world loading was outside this check. AI-assisted. Codex (GPT-6 family, exact variant unavailable) ran the stock tests and drafted this report. |
…v#1791, xcl-dev#605, xcl-dev#1806, xcl-dev#1745) Merges 60 upstream commits through c4d37be, incorporating: - PR xcl-dev#1747 (raylitebull): eliminate multi-heap UpdateTileMappings and per-texture Signal stalls in vram::Pages via contiguous TilePool - PR xcl-dev#1791 (wondercrash): D3D12.X an ExecuteIndirect reads arguments written before it - PR xcl-dev#605 (0x6461726B): promote R9G9B9E5_SHAREDEXP render/UAV targets to R11G11B10_FLOAT - PR xcl-dev#1806 (bmjask): Direct DXIL image_get_lod accepts static samplers - PR xcl-dev#1745 (gefydev): direct per-lane DXIL recompiler lowering backend Assisted-by: Antigravity
Conflicts: - build.rs: upstream's per-lane source hash kept; integ's second copy of the /HIGHENTROPYVA:NO link argument dropped (upstream's xcl-dev#631 copy at the top of main() stays). - gpu/recomp/mod.rs: integ's loop budget kept next to upstream's xcl-dev#1321 fallback, then xcl-dev#1321 left out: integ's one skip variable (c70c9f0) removes the quadratic guards it bounds. With it, no retail program comes near 128 B per byte (95cc13288a27a96e: 18.9 MB structured), and the bound would only move memory-dense programs (S_BUFFER_LOAD / BUFFER_LOAD runs at 4 windows: 250-300 B per byte, structured no larger than the pc form) to the pc form. Its test is left out with it; c70c9f0's crossing_forward_jumps_keep_the_guards_short covers that layout. - hle/d3d12x/bind.rs: xcl-dev#1791 is upstream's copy of d2d8c93 / 923c3f8: integ's call sites (gpu_profile, breadcrumbs, XCL_SKIP_SHADERS) kept around upstream's identical fresh_indirect_arguments; the test that both sides added is kept once, at upstream's place. - hle/d3d12x/vram.rs: xcl-dev#1747 as ported on try-1747 (11a9069): the PR's side of place_on_pages, with integ's pages() at its two PAGES.lock() sites so releases deferred while PAGES was held still run. Assisted-by: omp (Claude Opus 5.5)
Keep the per-heap batching, rollback, and mapping fences from xcl-dev#1747. Pass the per-device heap properties to the new pool allocation and verify that a two-tile batch uses the selected heap and returns its tiles after unmapping. Assisted-by: OpenAI Codex (gpt-6.2-sol)
Brings xcl-dev#1747, xcl-dev#1791, xcl-dev#605, xcl-dev#1679, xcl-dev#1806, xcl-dev#1745, xcl-dev#1307, xcl-dev#1321 among others. Resolutions: - dxil/kernel.rs: upstream's Lw::new / Lw::finish; the safe s_barrier state and policy and xcl-dev#1741's single-wave bounded exchange move into Lw::new, with a safe_barrier flag (false for the per-lane lowering). - dxil/lower.rs: VAR_BAR_DEAD moves to VAR_BUDGET + 6 (+5 is VAR_F32_MODE). - TRANSLATOR_VERSION 9. - d3d12x/bind.rs: the bounded ExecuteIndirect call runs inside fresh_indirect_arguments. - d3d12x/list_x.rs: tracked_list_type, and transition (pub(super)) over the batched transitions. - recomp/mod.rs: compact backend and per-lane modules both kept; the oversized-structured-code fallback applies to translate after prepare. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
NVIDIA/Proton result on merged main The Windows MSVC release library tests filtered to A separate offline Series X run on the same build reached loading artwork. The final report recorded 2,321 shown frames and 2,321 PresentX calls. Activity samples recorded 62,502 DirectStorage requests and zero failures. The run ended at the title watchdog with no logged D3D12 device removal or NVIDIA Xid. The host had 16 GiB of RAM and 32 GiB of NVMe swap plus zram. World entry remains unverified on this configuration. OpenAI Codex (GPT-6.2-astra) built the Windows target, ran the tests under Proton, and prepared this report. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Independent NVIDIA Ampere benchmarkTested the merged implementation on commit Hardware and environment:
Ran the following benchmark: cargo test --locked --release -p xcl churn_update_tile_mappings_timing -- --ignored --test-threads=1 --nocaptureResults256 x 2 MiB textures:
Test result: 1 passed, 0 failed (0.93s). The complete sequential workspace test suite also completed successfully on this commit:
The contiguous tile allocation and sparse VRAM descriptor/buffer tests also passed. This provides independent synthetic validation of the optimization on NVIDIA Ampere. No device hangs or device removal errors were observed during this benchmark. AI disclosure: ChatGPT assisted with diagnostic analysis and preparation of this comment. |
|
A possible regression after this PR, for whoever owns Setup: RTX 3070 Ti 8 GB, driver 621.24, Ryzen 9 7900X, 32 GB, Windows 11 26300, release Both runs, from the Aftermath dump:
So a copy into a reserved title texture writes to a 64 KiB tile in its range that has no mapping at that moment. That could be from the trimmed mapped ranges, or from tiles taken back to the pool / Logs (user name removed) are runs G and H in the zip on #675 (gta6-hbo.zip). I can run a build with extra logging on this card if that would help. AI use: Claude Code (Claude Opus 5.5) read the Aftermath dumps and logs and wrote this; I checked it before posting. |
Pass per-device heap properties when the batched allocator grows. Keep xcl-dev#1747 batching and xcl-dev#1985 heap slot reuse and fence-delayed retirement for both heap types. Verify the selected backing with a two-tile GPU copy/readback. Assisted-by: OpenAI Codex (GPT-6)
Eliminates multi-heap
UpdateTileMappingsstalls invram::Pagesby keeping tile allocations contiguous within a single heap, trimming mapped tile ranges, and movingCreateReservedResource/GetResourceTilingoutsidePAGES.lock().What is in it
crates/xcl/src/hle/d3d12x/vram.rs: add per-heap contiguousTilePool(pick_heap,take_batch,heap_ranges_trimmed), moveCreateReservedResource/GetResourceTilingoutsidePAGES.lock(), cachereservable(), useD3D12_TILE_MAPPING_FLAG_NONE, keep immediatequeue.Signal(&self.fence, self.value)inPages::mapandPages::unmapso tile-mapping operations are always fenced before resource release, and addtile_pool_keeps_churned_allocations_in_single_heap_and_contiguous+churn_update_tile_mappings_timing.Tested
10.0.22631.0),rustc 1.99.1 (58cf8f9c3 2026-10-13), release & debug builds, based on7f7e768.cargo test -p xcl --test e2e test_title_draws_with_a_root_signature_under_the_debug_layer -- --test-threads=1: 3 passed, 0 failed (2.89 s,1.88 s,2.15 s; 0 D3D12 debug-layer errors).cargo test -p xcl --lib hle::d3d12x::vram::tests -- --test-threads=1: 10 passed, 0 failed (2.30 s).churn_update_tile_mappings_timing(--release, 256 x 2 MiB tiled textures across 64 pools on RX 9070 XT,D3D12_TILE_MAPPING_FLAG_NONE+ 256Signals in both arms):8,192UpdateTileMappings+256Signals):submit = 951.18 ms,gpu_done = 987.70 ms256UpdateTileMappings+256Signals):submit = 43.54 ms(21.8xfaster),gpu_done = 69.03 ms(14.3xfaster)Regression run
main:
PR:
Not tested
3bc7143.cargo test --workspacerun on3bc7143, and deeper world-streaming heap churn beyond the 60 s Account Picker smoke window.AI use