D3D12.X: newer list layout #139 Reset goes through title_list::reset #929
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!929
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/929/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@shelbykb2 on GitHub · 2026-11-24 08:33 UTC · original
shelbykb2:pr/title-list-reset-139→main· +167 −0 · 1 files · 1 commits · merged 2026-11-25 13:42 UTCOn 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.@ettehn on GitHub · 2026-11-24 08:40 UTC · original
The newer-layout reset works in my native Windows probe on
5df36d1: the RTX 5070 Ti Laptop completed 16 split/submit cycles per run and reused the same continuation in five separate runs. I found an older-layout dispatch regression that the direct fake-vtable test misses.The adopted backing list also routes slot 139 through
guard::make_layout_splitinreal.rs. That guard uses the caller's return address to distinguish a title from PC code. The original wrapper tail-jumps into the backing slot. In my Windows debug build,reset_newer_with(..., false)makes a fresh Rust call instead, so the backing guard sees an XCL caller.I tested a synthetic caller registered in the module table, with distinct older/PC marker handlers behind the real layout guard. With
QUEUE_SHIFTED=false, the originalforward(139)reached the older handler (0), while the PR's public wrapper reached the PC handler (77). Those numbers are test markers. I haven't measured the impact on an older retail title.A local fix reused the existing
make_layout_splitat the wrapper: capture the generatedv[139]as botholderandpc, and havenewerpoint to a four-argument adapter calling wrapperreset. The original forwarder then retains the caller and arguments. With that change the same mapped caller reached the older marker with the flag clear and reset the primary with the flag set. All three focused wrapper tests passed.OpenAI Codex (GPT-6.2 Astra) assisted with verification.
@dcastell1 on GitHub · 2026-11-24 08:40 UTC · original
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean
main@beaa245(713 passed, 0 failed, 41 ignored on this box):One more passing test than main: the newer list layout's Reset through
title_listis covered and green; nothing else changes verdict.Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
@shelbykb2 on GitHub · 2026-11-24 09:21 UTC · original
@ettehn Thanks for testing this and for tracing the older-layout path. I checked it in the code: the backing list's #139 sits behind
make_layout_split, so a Rust call from the wrapper hides the title's return address and an older-layout title lands on the PC method.The fix uses your suggested shape and is squashed into the PR's commit (head is now
b3a969b). The wrapper's #139 is its ownmake_layout_split: the generated forwarder is botholderandpc, andneweris a four-argument adapter that runs wrapperreset.The new test
slot_139_keeps_the_title_caller_for_the_backing_layout_guardcalls the slot from a caller registered as a mapped image, with the backing slot behind a real layout guard and a test-local layout flag. With the flag clear it reaches the older handler with the title's arguments; with the flag set it resets the primary. It fails on the previous revision in a debug build only; in release that call was compiled as a tail jump, which is why my release runs did not show it.The suite and the smoke run were repeated on the new head and the description is updated (715 passed, 3 failed as before, 41 ignored). Not tested: an older-layout retail title.
Claude Code (Claude Opus 5.5) assisted with the change and the test.
@ettehn on GitHub · 2026-11-24 09:27 UTC · original
Verified the fix on
b3a969bwith the same independent Windows probe that failed on5df36d1. The older-layout call through slot 139 previously returned the PC marker (77) instead of the original handler result (0). It now returns 0, and the newer-layout call still resets the primary list with the expected allocator and PSO. All four targeted title-list tests passed, including the PR’s new caller-routing test. This resolves my earlier finding.Verification assisted by OpenAI Codex (GPT-6.2 Astra).
@SlopTart on GitHub · 2026-11-24 10:37 UTC · original
Linux / AMD RDNA3 datapoint.
Merged state: head
b3a969bonto main9aec53d, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 715 passed, 11 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). list layout #139 Reset-through-title_list green.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@3L1A5-1 on GitHub · 2026-11-24 20:13 UTC · original
Test report for
b3a969bon an 8 GB NVIDIA card in the retail title: with it, the false GPU-cycle signals and the device removal at ~200 s are gone in 3 of 3 runs, and the runs get 65–165 s further. They end on three later stops.Follow-up to @not-rex's note on #505, where they suggested this PR as the cause of the stale counter writes I reported there.
Tested
XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50 XCL_PAGE_BUDGET_MB=3072, A pressed byXCL_PRESS_A_AT=40,45,…,120, 600 s runs.main930e8b4+ #1182, #1055, #1102, #759, #1273, #1278, #562, #1288, #1515, #640 (5d6fac8), revert ofb8b1f49(#1307), plus local logging diagnostics. The A/B is that tree with and without this PR (b3a969b, merged cleanly).Write64 Signal … would close a GPU cycle0x887a0006at 197.6 s#101+0x2474606after the removal0xc0000005inxboxbvhbuilder.dll+0x15078(read)+0x4da6315(#1164)+0x23cf683xboxbvhbuilder.dllaccess violation in run 1, XCL logged the exception but the process didn't end; the log stopped and I had to kill it. I found no report of that address.cargo test --workspace -- --test-threads=4on this tree: 773 passed, 0 failed, 41 ignored, SKIPPED the 2 wave64 tests. That needs a local one-line fix in areal.rstest that calls the removedSlots::acquire; the failure comes from the #1273 stack, not from this PR.Not tested: this PR alone on
main; more than one run without it; AMD; Linux.AI use: Claude Code (Claude Opus 5.5) ran the runs, compared the logs and wrote this.
@pvfreis on GitHub · 2026-11-25 03:16 UTC · original
Test report for
b3a969bmerged ontomaincbc296a(clean, treebdb5a3c): nothing new fails, both new tests pass, and I found no defect reading the diff. One optional note, not a reason to push to this PR: the new tests don't exercise the line that installs the fix (:73).Tested
cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4, one run each, passed / failed / ignored:mainThe shared failure is
test_title_runs_and_game_folder_is_untouched(presents0; it fails the same way onmainhere). 24 SKIPPED lines in each run, mostly wave64.The note: the first test calls
slot_139(forward(139), &NEWER)(:510) andreset_139(:517), the secondslot_139(forward(139), &NEWER)(:569); neither reads entry 139 of the wrapper's table. Withv[139] = slot_139(...)deleted both still pass (rustc only warns thatslot_139andreset_139are never used). With the change below,slot_139_keeps_...fails without that line (left: 2, right: 0: the call reaches the backing list's handler) and passes with it. It touches non-test code (vtable()'s body moves toslots(flag), same behaviour), so it fits a follow-up PR better.Not tested: a retail title, AMD. CI is
action_requiredon this head, so it hasn't run.Run and written with Claude Code (Claude Opus 5.5); counts rechecked by a second agent (Claude Opus 5.5), text reviewed with Claude Fable 5.2; checked by a person before posting.
Change
@Pipodi on GitHub · 2026-11-25 06:14 UTC · original
Test report for
b3a969b(this PR's head), merged ontomaincbc296a(local merge65511ac, no conflicts), on the retail title. It was suggested on #1269 as the fix for the reset half of the split-recording bug.Tested
xcl runof the retail title for 300 s, with A pressed at 16 s and then every 15 s up to 225 s. Each run used a new emptyXCL_DXIL_CACHEand no other variables.maincbc296amain+ this PR (65511ac)main(0 presents from 74 s to 300 s). On its own the change does not get this title past the world-load stop. That is expected: it fixes the reset, and it has no pipeline wait budget.Not tested
XCL_PSO_FRAME_WAIT_MS), and a warm cache.AI use: Claude Code. A Claude Sonnet 5.5 session ran the title runs and collected the counts; Claude Opus 5.5 wrote this report.
@Dezmonius on GitHub · 2026-11-25 09:06 UTC · original
Follow-up to Pipodi's #1931 + #929 comparison, on Windows 10 19045, RTX 5070 / 610.88, i7-7700K, 32 GiB RAM. I applied #929 head
b3a969bcleanly to mycbc296ab+ #1931 test tree (same local #1464 adaptation and activity counters). Offline Series X, direct DXIL, same input/profile and reused cache location,XCL_PSO_WAIT_MS=1000andXCL_PSO_FRAME_WAIT_MS=500in all runs.The first patched run still had sporadic presents at the timer. The last captured image was loading artwork. Its watchdog lines no longer included the five q1-waiting-on-q3 entries in the earlier control. Queue IDs are local to a run. The longer repeat used a different frame capture interval (every 100 rather than 60). It reset the D3D12 device before reaching the earlier watchdog phase, with 28.11 GiB of minimum system commit headroom. DRED did not identify an allocation. This shows a later, clean exit in one patched run, with stability still unconfirmed.
cargo test --locked --offline -j 4 -p xcl --lib title_list:: -- --test-threads=1: 3 passed, 0 failed or ignored. No game data included. AI-assisted (OpenAI Codex, GPT-6).@DavidM1911 on GitHub · 2026-11-25 09:17 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@Dezmonius on GitHub · 2026-11-25 09:39 UTC · original
Capture-off follow-up to my previous #929 report. Same RTX 5070, driver 610.88,
cbc296ab+ #1931 + #929 + local #1464, offline Series X, direct DXIL, DRED and warm XCL cache. Disabling the runtime frame dump entirely (zero captures) still gaveDXGI_ERROR_DEVICE_RESETat 164.3 s, compared with 170.3 s in the prior 420 s run with capture. It had 745 activity-sampled presents and no queue-watchdog releases before reset. DRED reported no matching allocation. Minimum system commit headroom was 29.39 GiB.A separate 300 s run with capture still off and the D3D12 debug layer enabled exited at the timer (830 PresentX calls, four GPU queue watchdog releases). XCL logged that the debug layer was enabled, but its log contained no warning/error callback lines. The observed window near the end was dark. Different diagnostic mode and timing mean this run does not establish an effect of the debug layer on stability. The reset can occur without frame capture. No game data or raw logs included. AI-assisted (OpenAI Codex, GPT-6).
@ivall on GitHub · 2026-11-25 13:42 UTC · original
Merged as part of
main, thanks – and it looks like the fix for a hang here.Tested on the merged tree (
mainafc5ee8+ this): AMD RDNA4, Windows, DXC 1.8.2502.11, debug.cargo test --workspace --no-fail-fast -- --test-threads=4: 1263 passed, 2 failed (fuzz_validate_and_gpu_1/_3, #2115, as onmain), 46 ignored.Why it looked related: on a retail title's world load (newer layout, other open PRs on the tree, without this one) two runs hung the GPU (0x887a0006). Both had three mid-list splits (
split command list (type 2) around mid-list Wait after Write64), and the hang came about 5 s after the third; two runs with one split went on for 366 s and 699 s. That is a pattern, not a proof: I have not yet run the title with this PR.Read before the merge: the whole diff.
AI use: Claude Code (Claude Opus 5.5) merged it, ran the tests and wrote this on the maintainer's behalf.
@ivall on GitHub · 2026-11-25 13:51 UTC · original
Correction to my comment: a run with this PR still hung, so it was not the fix for that hang.
On the same retail title and tree as before plus this PR (and page aliasing, #2308), the GPU hung again (0x887a0006), in the same list of 1 366 operations, at the same draw (operation 408,
DrawIndexedInstanced, a light's pixel shader), where it had hung without this PR. The run had two splits this time, not three. So the pattern I saw (hangs after the third split) was a coincidence and I should not have suggested it.The PR stays merged: what it fixes is real (the #139 Reset not reaching the wrapper), it is covered by its own tests, and the suite is clean with it. It just has nothing to do with this hang.
AI use: Claude Code (Claude Opus 5.5) ran this and wrote the comment on the maintainer's behalf.