Skip to content

xcl run: the sync-state dump names the list behind a Wait64 cell - #2718

Open
Kalmarv wants to merge 4 commits into
xcl-dev:mainfrom
Kalmarv:sync-dump-recording-list
Open

Kalmarv wants to merge 4 commits into
xcl-dev:mainfrom
Kalmarv:sync-dump-recording-list

Conversation

@Kalmarv

@Kalmarv Kalmarv commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #2244; only the top two commits belong here (590fb10, and ceb7bc2 from luckyteagirl's review).

#2244's sync-state dump shows a Wait64BitValueX cell recorded and never submitted (rec 0x619, sub 0x0@qNone in #1452 (comment)), but not which list recorded the value or what became of that list. Each such cell entry now names the PC list that recorded its highest value, and says whether that recording was later executed, or ended by a Reset or a Release, with each as its time after the recording:

0x70417fe08: mem 0x0 done 0x0 sub 0x0@qNone rec 0x619 by 0x1e2c4a0 41250 ms ago (executed no, reset no, released no) cpu 0x0 armed []

That tells apart the ways a recorded Write64 goes missing:

  • reset or released with no execute: the recording was thrown away; a release here can also be D3D12.X: forget a command list before the runtime frees it #2691's case, where a new list at a freed list's address loses its state;
  • executed: the write went out, and the miss is on the submit side;
  • none of the three: the list is still open or closed and waiting, so the title holds it.

#2717 (a mid-list split that cannot make its next segment no longer closes the list) is one fix for the first case. Part of #1452.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: SyncCell::recorded_by (list and time of the recording that set recorded_max, and that recording's trace). Each recording that records a Write64 has a trace of its last execute and the Reset or Release that ended it, held by the cells it recorded; WRITE64_LISTS maps each list to the recording it has open. They are filled in by signal_write64_fences, the KickoffX submit, reset_pc, clear_segment_state and on_release. cells_behind_summary prints them (try_lock, as for the graph).
  • ceb7bc2 (review): the trace was kept per list address, so after a Reset, or a Release and a new list at the same address, another recording's execute showed on the old cell as executed. A Reset or Release now ends the recording, and what comes to the list after is the next one's.
  • Test the_cells_behind_summary_names_the_recording_list_and_what_came_to_it.

Tested

  • NVIDIA GeForce RTX 5070 Ti, driver 610.74; AMD Ryzen 9 9950X; Windows 11 (10.0.26200.9711); Rust 1.99.0, debug
  • cargo test --workspace --no-fail-fast -- --test-threads=4 at ceb7bc24 (on xcl run: XCL_THREAD_DUMP_AT also logs the fences and queue waits behind #2244's 97e22f64, main 72f848ca): 1415 passed, 0 failed, 46 ignored
  • SKIPPED (142): 117 validator 1.7 < 1.8 (validation step only), 21 no wave64, 3 wave32 per-lane form refused (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
  • The test checks the entry of a cell recorded on a list: by <list> … (executed no, reset no, released no), then reset +… ms after a Reset. Then the review's two cases: a Reset, an unrelated recording on the list and its execute; and a Release, then a list at the same address that records and is executed. In both the old cell stays at executed no and the new recording's cell reads executed +…. With 590fb10's trace the first case fails: the reset cell reads executed +0 ms.
  • emirduran707 ran ceb7bc2 on an AMD Radeon RX 9060 XT (driver 32.0.31044.16), xcl run: the sync-state dump names the list behind a Wait64 cell #2718 (comment): 1413 passed, 2 failed (fuzz_validate_and_gpu_1 and _3, which fail on unmodified main on that card, per the report), 46 ignored; both the_cells_behind_summary_* tests passed; a 60 s smoke of another title: 1600 frames against main's 1603, no device removal, no crash.
  • Tested by others, GodlyBDS (xcl run: the sync-state dump names the list behind a Wait64 cell #2718 (comment)): ports of xcl run: XCL_THREAD_DUMP_AT also logs the fences and queue waits behind #2244 97e22f6 and ceb7bc2 on another branch (nvidia-dev af2cecc), RTX 3090 Ti, driver 621.40. Both the_cells_behind_summary_* tests passed. In a title run at 105.056 s, q3 waited on a cell for 0x5e4, recorded up to 0x5e5, with nothing submitted. Its line named the recording list with executed no, reset no, released no: a recorded producer that was never seen submitted, not a recording thrown away by a Reset or Release. The run does not show that this wait caused the q2 stall they saw later (146.6 to 152.6 s).

Regression run
main (b49be18):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1225 (PresentX 1226)
presents per 2 s (last 3): 5 40 42
device removals: 0
crashes: 0
peak commit: 25991 MB

this PR (ceb7bc2):

xcl-smoke v1
commit: ceb7bc24288c46453ae3819b4b85378daf9184e1
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1229 (PresentX 1229)
presents per 2 s (last 3): 19 45 50
device removals: 0
crashes: 0
peak commit: 25959 MB

Not tested

  • A run that shows a stuck cell (the reporter's card and route); the smoke runs do not set XCL_THREAD_DUMP_AT, so no dump is logged in them
  • Intel GPUs

AI use

  • Claude Code, Claude Opus 5.5: wrote the change, the test and this description.

🤖 Generated with Claude Code

jackowatts and others added 3 commits November 25, 2026 20:35
A retail title's world load can stop with no GPU-wait time-out: presents,
submits and DirectStorage requests go to 0 and every thread waits. The
watchdog's summaries of pending title fences and of XCL's own unmet queue
waits are only logged at a time-out, so such a stop did not say whether
a fence or a queue was behind.

At each XCL_THREAD_DUMP_AT dump XCL now logs the two summaries and the
number of armed GPU waits, on a thread of its own so that a lock the
stall holds cannot hold up the next dump. On xcl-dev#2057's tree this showed
every fence and queue caught up at 135, 200 and 300 s after a stop at
110 s (xcl-dev#2057 (comment)).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
The three lines of the first commit read "none / none / 0" in runs where
the title had stopped after its first xcl-dev#101: no fence and no queue was
behind, yet nothing was presented. What showed the stop was a SYNC_GRAPH
cell whose recorded value is above what was submitted and completed,
with no GPU wait armed: a list that writes the value was recorded and
never submitted, so the submitting thread is held (GreemSC's runs, RX
7900 XT; the thread dump then named that thread).

cells_behind_summary lists such cells, and those with armed waits:
memory, completed, submitted (and on which queue), recorded and CPU
values, and the armed waits with their age. It takes the graph with
try_lock, since a dump can come while a submitting thread holds it.
The cell is read with ReadProcessMemory (dstorage::read_own), since
the title can decommit its page at any time; an unreadable cell shows
"mem unreadable" (bmjask's review).
The function is GreemSC's, from the review of this PR.

Co-authored-by: GreemSC <57862153+GreemSC@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
A cell recorded and never submitted (xcl-dev#1452: rec 0x619, sub 0x0@qNone)
did not say which list recorded the value or what became of that list.
Each cell now keeps the PC list and time of the recording that set its
recorded_max, and each list that recorded a Write64 keeps its last
execute, Reset and Release (signal_write64_fences, the KickoffX submit,
reset_pc, clear_segment_state, on_release). The cell entry in
cells_behind_summary prints them as their time after the recording, or
"no": reset or released with no execute is a recording thrown away
(xcl-dev#2691's address reuse shows as a release), executed is a miss on the
submit side, and none of the three a list the title still holds.

Part of xcl-dev#1452.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@luckyteagirl luckyteagirl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At exact head 590fb10 (stacked on 97e22f6, current main b49be18), the new trace can label a discarded Write64 as executed. This is a source-derived review; I did not run a title reproduction.

SyncCell::recorded_by saves only the raw PC-list address and a timestamp, while WRITE64_LISTS has one mutable trace per address. For example, record a Write64 for a cell, Reset that list before submission, then record an unrelated Write64 and execute the new recording on the same list. reset_pc notes Reset, but the later signal_write64_fences/KickoffX updates executed on the same trace. recording_trace accepts that later timestamp, so the old cell reports executed +… even though its recording was discarded. This conflicts with the PR's interpretation that “executed” means the write went out. Releasing the original list and reusing its address for a different list can produce the same attribution, since the address entry remains after on_release.

Could the trace be tied to a recording lifetime, so a Reset/Release closes the old recording and a later execution on the same address belongs to a new one? Extending the_cells_behind_summary_names_the_recording_list_and_what_came_to_it with Reset, an unrelated new recording, and Execute should leave the old cell at executed no; a release/address-reuse case would cover the other path.

AI assistance: GPT-6.2 Sol agents independently found the Reset and address-reuse cases; GPT-6.2 Astra verified the exact-head source and combined the report.

The trace was kept per list address: after a Reset, or a Release and a
new list at the same address, a later execute of another recording
showed on the old cell as "executed", though its write was thrown away.
Each recording that records a Write64 now has a trace of its own, which
the cells it recorded hold; a Reset or Release ends it, and what comes
to the list after belongs to the next one.

The test adds both cases: Reset, an unrelated recording and its execute
leave the old cell at "executed no", and so do a Release and a list at
the same address that records and is executed.

Part of xcl-dev#1452.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@emirduran707

Copy link
Copy Markdown
Contributor

Independent AMD RDNA4 (native wave64) verification of exact PR head ceb7bc24288c46453ae3819b4b85378daf9184e1 on Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver 32.0.31044.16, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC 1.9.2602.17).

Tested

  • cargo build --workspace (debug): passed (0 errors).
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1413 passed, 2 failed, 46 ignored (8 SKIPPED: 6 per-lane DXIL forms refused by host adapter/driver, 1 heap_window_out_of_memory_falls_back_to_the_switch_form no heap windows, 1 pso_measurement_compiles_an_exact_synthetic_record Windows Developer Mode off).
    • Both new tests passed:
      • hle::d3d12x::list_x::tests::the_cells_behind_summary_names_the_recording_list_and_what_came_to_it
      • hle::d3d12x::list_x::tests::the_cells_behind_summary_reads_a_decommitted_or_protected_cell_without_faulting
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 and fuzz_validate_and_gpu_3) are pre-existing on unmodified main on this RX 9060 XT / driver 32.0.31044.16.
  • cargo build --release -p xcl + 60 s retail-title smoke test (scripts/smoke.ps1, offline):
xcl-smoke v1
commit: ceb7bc24288c46453ae3819b4b85378daf9184e1
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1600 (PresentX 1600)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18658 MB

(Compare against main b49be183 on this machine: 1603 frames, 18576 MB peak, 0 device removals, 0 crashes.)

Not tested

  • NVIDIA / Intel GPUs, Linux / Wine.

AI use

  • Verification run and report prepared with Antigravity (Gemini 4 Neon); all build, test, and smoke results are from live runs on this machine.

@Kalmarv

Kalmarv commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@luckyteagirl Thanks, confirmed and fixed in ceb7bc2, a commit on top of 590fb10, so that commit is the whole change since your review. Each recording that records a Write64 now has a trace of its own, held by the cells it recorded. A Reset or a Release ends it, and what comes to the list, or to a list at its address, after that belongs to the next recording. the_cells_behind_summary_names_the_recording_list_and_what_came_to_it now has both your cases: a Reset, an unrelated recording and its Execute; and a Release, then a list at the same address that records and is executed. In both the old cell stays at executed no. With 590fb10's trace the Reset case fails (the cell reads executed +0 ms). Suite at ceb7bc2 on an RTX 5070 Ti: 1415 passed, 0 failed, 46 ignored. The new smoke pair is in the description.

Thanks @emirduran707 for the RX 9060 XT run of ceb7bc2 (suite, both the_cells_behind_summary_* tests, and a smoke); it is in Tested now.

AI use: Claude Code, Claude Opus 5.5 wrote the fix, the test and this reply.

@GodlyBDS

GodlyBDS commented Nov 26, 2026 •

Copy link
Copy Markdown

Independent Ampere run with the #2244/#2718 diagnostics

RTX 3090 Ti 24 GiB, driver 621.40, Windows 10, 32 GiB RAM. Release nvidia-dev af2cecc40886a8682ecf3267f5328c6dc4b66ad7, with local Agility/XG startup adapters, #2697 memory diagnostics and the NVIDIA #2549 backport. Ports of #2244 97e22f64 and #2718 ceb7bc24 adapt list-state tracking to the NVIDIA branch. Same starting 11,721 native PSOs, level pages enabled, app-only 1 GiB shader-heap reserve, no fixed timeout. Both cells_behind_summary regressions passed (2 passes, 0 failures or skips).

At 105.056 s, q3 had an unmet Wait64 at value 0x5e4. The cell's last recorded value was 0x5e5; CPU-backed memory, fence completion, and submitted value were all zero. The reported recording list had executed no, reset no, released no. The diagnostic distinguishes a recorded producer without an observed submission from a list discarded by a Reset or Release. This is consistent with the missing-producer state discussed in #2719, with a different integration branch.

The later allocator-level samples from 146.573 to 152.594 s showed q2 submitted 19, completed 18, with the four other tracked queues caught up. That is a distinct interval and queue. This run does not establish that the q3 wait caused the later q2 stall. The external RAM guard ended the run at 378 MiB available physical RAM and 11.12 GiB commit headroom, with no DXGI removal logged before the stop.

Recording-time PSO wait follow-up. The only deliberate scheduling change was to let pending compute Dispatch and ExecuteIndirect calls use the existing recording-time PSO wait rather than enqueue a deferred segment. The application kept its original synchronization and required pipeline waits. The manifest matched all 11,721 starting native PSOs, and the effective environment differed only by the opt-in switch and run paths. In one run, submissions and streaming resumed. All five tracked allocator queues were caught up at 295.229 s, and two had one pending submit each at 297.237 s. Presentation had resumed at least once by 265.092 s. The device was then removed at 298.847 s (0x887a0005), with 12,011 MiB system commit headroom, local usage 17,631 MiB against a 23,541 MiB budget in the last sample, and no 4101/153 in the matching Windows event window. DRED had no breadcrumbs and no allocation for VA zero. This supports separating the earlier submit-time Reset stall from the later device removal. It does not establish which GPU workload caused the removal or prove stable rendering.

AI use: Codex (GPT-6) adapted the diagnostics, ran the tests and compared the logs.

@Kalmarv

Kalmarv commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @GodlyBDS for the RTX 3090 Ti run with #2244 and this PR ported to nvidia-dev af2cecc. Both tests passed. At 105.056 s the q3 cell's line read executed no, reset no, released no: a recorded producer that was never seen submitted, not a recording thrown away by a Reset or Release. As you say, the run does not show that this wait caused the later q2 stall. That part is in Tested now. Your recording-time PSO wait follow-up is your own opt-in switch, not this PR's code, so I've left it out of this PR's description.

AI use: Claude Code, Claude Opus 5.5 wrote this reply.

@Decodere

Copy link
Copy Markdown
Contributor

Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2718 at ceb7bc24288c46453ae3819b4b85378daf9184e1 (parent 590fb10fcccaa382bc102d5bd6fb045989b10be8; merge-base 72f848cabfa588201554c1c01c9406a73fe7e964, MERGEABLE against origin/main b49be183). Measurements and targeted test results only; not a full source review.

Setup

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200
  • Toolchain / caches: rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs)
  • Workload: Retail workload title: 29640639 via scripts/smoke.ps1 -Seconds 60 (XCL_NETWORK=0 XCL_ACTIVITY=1, default flags, no input)

Targeted Win11 / RTX 4060 release unit tests (ceb7bc24)

  • cargo test --release -p xcl --lib the_cells_behind_summary_reads_a_decommitted_or_protected_cell_without_faulting -- --nocapture: 1 passed, 0 failed, 0 ignored (0.00 s, exit 0).
  • cargo test --release -p xcl --lib the_cells_behind_summary_names_the_recording_list_and_what_came_to_it -- --nocapture: 1 passed, 0 failed, 0 ignored (0.00 s, exit 0).
  • cargo test --release -p xcl --lib hle::d3d12x::list_x:: -- --test-threads=4: 40 passed, 0 failed, 0 ignored (0.51 s, 0 skipped, exit 0).
  • cargo test --release -p xcl --lib hle::dstorage:: -- --test-threads=4: 31 passed, 0 failed, 0 ignored (0.11 s, 0 skipped, exit 0).

Observations

  • Both sync-cell lifecycle diagnostic tests (the_cells_behind_summary_reads_a_decommitted_or_protected_cell_without_faulting and the_cells_behind_summary_names_the_recording_list_and_what_came_to_it) plus all 71 targeted list_x:: and dstorage:: tests passed cleanly in --release on native Windows 11 / RTX 4060 with 0 skips.
  • Quiet 60 s retail smoke ran cleanly (exit: 0x0, 1562 frames shown, 60 60 60 steady-state presents per 2 s, 0 device removals, 0 crashes, 13969 MB peak commit vs reference origin/main b49be183's 14018 MB / 1518 frames).

Paired 60 s RTX 4060 smoke (b49be183 vs ceb7bc24)

Reference origin/main (b49be183):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB

PR #2718 head (ceb7bc24):

xcl-smoke v1
commit: ceb7bc24288c46453ae3819b4b85378daf9184e1
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1562 (PresentX 1562)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13969 MB

Limits of coverage

  • Full workspace test suite was not re-run on ceb7bc24 (only targeted hle::d3d12x::list_x:: and hle::dstorage:: release tests plus paired quiet 60 s smoke).
  • Tested at exact PR head ceb7bc24 (whose merge-base 72f848ca sits below current origin/main b49be183), without triggering a live Wait64BitValueX hang/sync-state dump during the 60 s retail smoke (sync-cell summary formatting and protected-cell safety are covered by the two unit tests above).
  • Native Windows 11 (26200) / discrete RTX 4060 only; no AMD, Intel, or Wine/Linux run on this host.

AI use

Ran the targeted release unit tests and paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts and smoke blocks were taken directly from cargo test and scripts/smoke.ps1 outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants