Repository navigation
Conversation
A superseded target bound through a descriptor table is remapped when a draw or dispatch binds the table (xcl-dev#3179), but only the first 256 slots of each table were read. A view further in – a bindless SRV range, or a range at an explicit offset past slot 256 – was never seen: the target kept no tiles, its writes were dropped and its reads returned zeros. The root signature's SRV and UAV ranges of each descriptor table (RTS0 1.0 and 1.1, appended and unbounded ones included) are now kept in the layout, and the scan reads those ranges and nothing else. An unbounded range ends with the view heap the table lies in (console_heap::view_heap_remaining_slots); outside any view heap it has no known extent and is not read. CBV and sampler ranges cannot name a placed target and are skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I tested the descriptor scan on
I repeated the CPU comparison in three fresh processes with the XCL crate compiled at I ran |
Keep XCL_LAZY_TARGETS opt-in. Defer shared video-memory tiles for GPU-owned placed targets and map them before command-list or upload use. Track copied RTV and DSV handles while mapping is pending. Reject a command list if first use cannot allocate its tiles. Unmapped targets remain eligible for a retry after reset. Cover deferred allocation, first use, and submission refusal. Views bound through descriptor tables are looked for in every SRV/UAV range the root signature declares, with the range walk of xcl-dev#3443 (now for_each_declared_table_slot), not only in the first 64 slots of each table: a target bound further in would otherwise keep no tiles. Related to xcl-dev#3211 and xcl-dev#1773. Assisted-by: Antigravity (Gemini 4 Neon) Assisted-by: Codex (GPT-6) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
No open or merged PR makes the same change. #3395 shares most of these lines because it is stacked on this PR (its description says only its top commit AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
…eads view heaps in place)
…ed targets While any target is superseded, every draw and dispatch bound on XCL's ABI scans the descriptor ranges its layout declares for views of superseded targets (note_superseded_in_tables, xcl-dev#3443). A table outside the committed window, such as the title's view heaps in sparse window 0, was read with read_committed_into, one read for each declared range (about 41 a bind in that run), and under Wine each read asks VirtualQuery first (Windows reads it with one ReadProcessMemory). In a run in the title's world that VirtualQuery was the first call site of all, about 17 µs a call for a 32-byte slot. A range inside a registered view heap is already cut to the heap's end, and the heap's slots are committed while it is registered (XCL commits a heap it places in the sparse windows; one in the title's memory was committed when it was made): such a range is now copied where it is, under HEAPS as view_slot_words copies, so a heap unregistered on another thread since its lookup is not freed under the copy; it is then read with read_committed_into, as a range outside any view heap is. Measured with two other changes (one read of a few resident pages in read_committed_into under Wine, and the memory report reusing its commit sum) on a tree carrying other unmerged work, RTX 4060 Ti, Wine 11.21, 1 run each with the same options, the title in its world: 1.19 -> 3.70 frames a second. What each change gives on its own was not measured. Test: in-heap ranges are found without read_committed (red without the change); a bounded range outside any heap, or in one unregistered since its lookup, is read through it; a view heap's slots are copied only while it is registered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A superseded target bound through a descriptor table is remapped when a draw or dispatch binds the table (#3179), but only the first 256 slots of each table were read. A view further in – a bindless SRV range, or a range at an explicit offset past slot 256 – was never seen, so that target kept no tiles: its writes were dropped and its reads returned zeros. This reads the SRV and UAV ranges each table's root signature declares instead, wherever they lie in the table, and only those. Follow-up to #3179.
What is in it (one commit)
crates/xcl/src/hle/d3d12x/console_list.rs:Layout::table_ranges, the SRV / UAV ranges of each descriptor-table parameter (RTS0 1.0 and 1.1 range layouts,OFFSET_APPENDand unbounded ranges). CBV and sampler ranges cannot name a placed target and are left out.crates/xcl/src/hle/d3d12x/bind.rs:note_superseded_in_tablesscans those ranges in chunks of 256 slots. An unbounded range ends with the view heap the table lies in; outside any view heap it has no known extent and is not read. The scan isscan_superseded_in_tables_with, with the memory and heap lookups passed in so it can be tested without a device.crates/xcl/src/hle/d3d12x/console_heap.rs:view_heap_remaining_slots, the slots from an address to the end of its view heap (no shared-heap page is allocated by asking).descriptor_tables_keep_their_srv_and_uav_ranges(both RTS0 versions: appended, unbounded and explicit-offset ranges, CBV / sampler ranges skipped) andsuperseded_targets_are_found_in_every_declared_table_range(a target at slot 300 is found – the old 256-slot scan never read it –, slots between declared ranges are not read, unbounded ranges stop at the view heap's end, and are not read outside one).Tested
cargo test --release --workspace --no-fail-fast -- --test-threads=4on7afecf84: the integration harnesses 139 passed, 0 failed, 20 ignored (4 e2e tests first failed only becausexcl_testtitle.exewas not built; aftercargo build --release --workspace,cargo test --release -p xcl --test e2e: 5 passed, 0 failed).main0fe06eb0alike: two tests end the process (0x80004005):gpu::recomp::dxc::private_heap_tests::failed_private_heap_compiler_falls_back_to_dxc_create_instance, and one whose title reachesend_title("sparse upload preparation still failed after bounded retries"). Counts before they do:--test-threads=1: 962 passed, 0 failed, 24 ignored, on this PR and onmain;--test-threads=4 --skip failed_private_heap_compiler_falls_back_to_dxc_create_instance: 1078 passed, 0 failed on this PR, 1070 passed, 0 failed onmain.cargo test --release -p xcl --lib -- hle::d3d12x::console_list:: hle::d3d12x::console_heap:: hle::d3d12x::placements:: hle::d3d12x::bind::: 166 passed, 0 failed, 0 ignored, the two new tests among them.SKIPPEDon this adapter: 25 lines, the same on both: 22 "no wave64", 3 per-lane f16 / f32 forms refused (gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics). None is a test of this PR.Regression run
scripts/smoke.ps1 -Game <retail title> -Seconds 600, each tree's own script and release build, the same environment for both (the title's Series S profile,XCL_DIRECT_DXIL=1,XCL_SPARSE_LAZY=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_PREPARE=1with a warm cache, scripted A presses). A run of this PR's head came first to fill the translation cache (cold); not pasted.main:
this PR's head:
Not tested
mainrun stopped presenting at world loading (frame ~2,000, video memory over budget) until its time ran out; this PR's run stayed in the intro video and menus at 30 fps for its 600 s. Both ended without a crash or device removal. They check that nothing breaks, not the change itself.AI use
🤖 Generated with Claude Code