Repository navigation
Conversation
On the newer console command-list layout (real::QUEUE_SHIFTED), titles reset pooled lists through slot #139 Reset(allocator, initial_pso, flags), which real.rs routes to list_x::reset_x. title_list's wrapper vtable only overrode slots 0, 1, 2, 9, and 10, leaving slot #139 as a raw forwarder to F_BACKING. Once a mid-list Wait64 split switched F_BACKING to a continuation segment, #139 reset only that continuation segment and never ran title_list::reset: F_PRIMARY stayed bound to the previous recording/allocator, F_BACKING was never restored to F_PRIMARY, and extra_active kept accumulating split segments across frames. On pre-xcl-dev#897 main that caused D3D12 device removal (0x887a0001 / debug-layer id 541) as soon as the old allocator was reused; even with xcl-dev#897/xcl-dev#907 allocator pooling, stale primary/prior segments continue to be resubmitted and extra_active grows until MAX_EXTRA_SEGMENTS. The wrapper's #139 is now a guard::make_layout_split of its own: a title on the newer layout goes to a four-argument adapter that runs wrapper reset, while a title on the older layout and the runtime take the generated forwarder. The forwarder's tail jump keeps the caller's return address and arguments, which the backing list's own layout guard at #139 needs to tell a title from the runtime; calling the backing slot from Rust would hide it and send an older-layout title to the PC method. Tests: one covers the forwarder and the newer-layout reset on fake lists; one calls the slot from a caller in a registered mapped image, with the backing slot behind a layout guard as real.rs installs it and a test-local layout flag (flag clear: the older handler with the title's arguments; flag set: the primary is reset and the split segment reclaimed). Co-Authored-By: Antigravity <noreply@google.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Upstream PR xcl-dev#929 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the newer console command-list layout (
real::QUEUE_SHIFTED), titles reset pooled command lists through slot#139(Reset(allocator, initial_pso, flags)), whichreal.rsmaps tolist_x::reset_x.title_list's wrapper vtable only overrode slots0, 1, 2, 9, 10, leavingv[139]as a raw forwarder toF_BACKING. Once a mid-listWait64split switchedF_BACKINGto a continuation segment,#139reset only that continuation segment and never rantitle_list::reset:F_PRIMARYkept its old recording/allocator,F_BACKINGwas never restored toF_PRIMARY, andextra_activekept accumulating split segments across frames. Before#897that caused0x887a0001device removals (ID3D12CommandAllocatorreset while still referenced by an un-reset primary list); even with#897/#907allocator pooling, stale primary and prior split segments stay attached and get resubmitted untilextra_activehitsMAX_EXTRA_SEGMENTS.The wrapper's
v[139]is now aguard::make_layout_splitof its own: a title on the newer layout (real::QUEUE_SHIFTED) goes to a four-argument adapter that runstitle_list::reset; a title on the older layout and the runtime keep the generated forwarder toF_BACKING, whose tail jump preserves the caller's return address for the backing list's own layout guard at#139(review finding by @ettehn: a Rust call into the backing slot hid the title caller, so an older-layout title reached the PC method).What is in it
crates/xcl/src/hle/d3d12x/title_list.rs: vtable slot#139becomesslot_139(forwarder, &QUEUE_SHIFTED), amake_layout_splitwith the generated forwarder asolderandpcand the adapterreset_139(runstitle_list::reset) asnewer. Unit tests:newer_layout_slot_139_resets_primary_and_reclaims_split_segments(forwarder and newer-layout reset on fake lists) andslot_139_keeps_the_title_caller_for_the_backing_layout_guard(a caller in a registered mapped image calls the slot with the backing slot behind a layout guard asreal.rsinstalls it; flag clear reaches the older handler with the title's arguments, flag set resets the primary and reclaims the split segment). Both use a test-local layout flag, not the globalQUEUE_SHIFTED.Tested
32.0.21045.29003), AMD Ryzen 9 7950X3D, Windows 11 Pro10.0.26300(Build26300),rustc 1.100.0 (0ef1bc386 2026-11-09), debug (cargo test) and release (cargo build --release -p xcl).cargo test --workspace --no-fail-fast -- --test-threads=4: 715 passed, 3 failed, 41 ignored on headb3a969b(integration test binaries: 41 passed, 0 failed, 20 ignored;cargo test -p xcl --lib title_listin release and in debug: 3 passed, 0 failed, 0 ignored;d3d12x::guardtests in debug: 4 passed, 0 failed).title_list.rs:hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixelsfails (3D 64x64x64 4 mips: subresource 2 mismatch) when preceded in-process bygpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes(reproduces when running onlyhle::d3d12x::title_textureswith--test-threads=1), poisoning the shared lock forhle::d3d12x::title_textures::tests::transitions_apply_when_their_list_is_submittedandhle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory. Each of the 3 passes individually (1 passed, 0 failedwith--test-threads=1).SKIPPEDGPU tests on this adapter: none (0 skipped).Wait64splits and newer-layout slot#139resets; previously hit0x887a0001device removals after the first mid-list split, and with the newer-layout part of this fix (first revision of this PR, release build) survived 64+ mid-list splits with 0 device removals. That retail run has not been repeated on the current head.Regression run
Not tested
QUEUE_SHIFTED == false) on a real title (covered by unit test only). The second unit test fails on this PR's first revision only in a debug build; in release that call was compiled as a tail jump.Wait64splits (which happen later in loading).AI use
#139bypass, write the fix and unit test intitle_list.rs, run the test and smoke commands, and draft this description; diff and test outputs reviewed by the author.make_layout_splitchange and the second unit test, rerun the suite and the smoke run, and update this description.Mirror of xcl-dev#929 (auto-synced, do not edit).