xcl run: XCL_THREAD_DUMP_AT also logs the fences and queue waits behind #2234

Closed
kole07139 wants to merge 2 commits from upstream-pr/2244 into main
kole07139 commented 2026-11-25 11:10:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by kole07139 on 2026-11-25T11:10:37Z.


At each XCL_THREAD_DUMP_AT dump, XCL now also logs four things:

  • the pending title fences;
  • XCL's own unmet queue waits;
  • how many GPU waits are armed;
  • the Wait64BitValueX cells that are behind what was recorded for them.

The first three are the summaries the GPU-wait watchdog logs at a time-out. The fourth is @GreemSC's diagnostic from this PR's review. Part of #1452.

A world load can stop with no time-out: presents, submits and DirectStorage requests go to 0, and every thread waits. Until now the thread dump of such a stop did not say whether a fence, a queue or a Wait64 cell was behind, because these summaries were only logged at a time-out.

What is in it

  • 06f9df8:
    • crates/xcl/src/hle/d3d12x/list_x.rs: log_sync_state(at) logs fence_x::pending_summary(), internal_waits_summary() and ARMED_GPU_WAITS, on a thread of its own, so a lock that the stall holds cannot hold up the next dump.
    • crates/xcl/src/host.rs: the XCL_THREAD_DUMP_AT thread calls it after each eh::dump_threads(). Without the variable nothing changes.
  • 97e22f6 (co-authored by @GreemSC), crates/xcl/src/hle/d3d12x/list_x.rs: cells_behind_summary() lists the SYNC_GRAPH cells below their recorded value, or with armed waits:
    • memory, completed, submitted (with the queue), recorded and CPU values;
    • the armed waits and their age.
    • It takes the graph with try_lock and logs (sync graph locked) when it cannot get it.
    • It reads each cell with ReadProcessMemory (dstorage::read_own, now pub(crate), in crates/xcl/src/hle/dstorage.rs): the title can decommit the page at any time. An unreadable cell shows mem unreadable (@bmjask's review). The test the_cells_behind_summary_reads_a_decommitted_or_protected_cell_without_faulting covers it.

The four lines, from a 60 s run of this head with XCL_THREAD_DUMP_AT=45 (the title was not stalled, so all four are empty):

D3D12.X: sync state at 45 s: pending title ID3D12Fences: none
D3D12.X: sync state at 45 s: XCL's own queue waits unmet: none
D3D12.X: sync state at 45 s: 0 GPU waits armed
D3D12.X: sync state at 45 s: Wait64 cells behind: none

Tested

  • Hardware and software:
    • RTX 3070 8 GB (NVIDIA 617.42, 32-lane waves), i9-9900K, 32 GB RAM;
    • Windows 11 Pro N 26200, Rust 1.99.0, DXC 1.8.2502.11.
  • Rebased onto main 72f848c.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on 97e22f6: 1414 passed, 0 failed, 46 ignored. 26 SKIPPED:
    • 21 no wave64 on this 32-lane card;
    • 3 per-lane forms refused;
    • 1 needs Windows Developer Mode to turn the driver cache off;
    • 1 no heap windows.
  • The diagnostic on this head: the 60 s run above logged the four lines after the thread dump, and the dump came out as before (147 thread lines).
  • The first commit's lines on #2057's tree are in the runs linked above. The fourth line is @GreemSC's function as used in his RX 7900 XT runs.

Regression run (scripts/smoke.ps1 -Game <retail title> -Seconds 60, the same title for both)

main 72f848c:

xcl-smoke v1
commit: 72f848cabfa588201554c1c01c9406a73fe7e964
gpu: NVIDIA GeForce RTX 3070
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1396 (PresentX 1396)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14927 MB

This PR, 97e22f6:

xcl-smoke v1
commit: 97e22f64949d02d4cbbcce2bc6f0e2a703a09166
gpu: NVIDIA GeForce RTX 3070
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1551 (PresentX 1551)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14809 MB

Not tested

  • A stalled title on this exact head with XCL_THREAD_DUMP_AT: the 60 s run did not stall.
  • AMD, Intel; Linux / Wine.

AI use

  • Claude Code (Claude Opus 5.5) wrote the first commit, folded in @GreemSC's function as the second, ran the tests and the smoke runs, and wrote this description.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW

<!-- greyfinch-sync:ivall/xcl:issue:5490191097 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244). Originally posted by [kole07139](https://github.com/kole07139) on 2026-11-25T11:10:37Z. --- At each `XCL_THREAD_DUMP_AT` dump, XCL now also logs four things: - the pending title fences; - XCL's own unmet queue waits; - how many GPU waits are armed; - the `Wait64BitValueX` cells that are behind what was recorded for them. The first three are the summaries the GPU-wait watchdog logs at a time-out. The fourth is @GreemSC's diagnostic from this PR's review. Part of #1452. A world load can stop with no time-out: presents, submits and DirectStorage requests go to 0, and every thread waits. Until now the thread dump of such a stop did not say whether a fence, a queue or a `Wait64` cell was behind, because these summaries were only logged at a time-out. - On #2057's tree the first three lines showed every fence and queue caught up at 135, 200 and 300 s after a stop at 110 s (https://github.com/xcl-dev/xcl/pull/2057#issuecomment-7160090884). - In @GreemSC's runs (https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7171273089) those three lines read "none" while the title was stopped. The stop showed in a cell recorded above what was submitted, with no GPU wait armed: a list that writes the value was recorded and never submitted, so the submitting thread is held. **What is in it** - `06f9df8`: - `crates/xcl/src/hle/d3d12x/list_x.rs`: `log_sync_state(at)` logs `fence_x::pending_summary()`, `internal_waits_summary()` and `ARMED_GPU_WAITS`, on a thread of its own, so a lock that the stall holds cannot hold up the next dump. - `crates/xcl/src/host.rs`: the `XCL_THREAD_DUMP_AT` thread calls it after each `eh::dump_threads()`. Without the variable nothing changes. - `97e22f6` (co-authored by @GreemSC), `crates/xcl/src/hle/d3d12x/list_x.rs`: `cells_behind_summary()` lists the `SYNC_GRAPH` cells below their recorded value, or with armed waits: - memory, completed, submitted (with the queue), recorded and CPU values; - the armed waits and their age. - It takes the graph with `try_lock` and logs `(sync graph locked)` when it cannot get it. - It reads each cell with `ReadProcessMemory` (`dstorage::read_own`, now `pub(crate)`, in `crates/xcl/src/hle/dstorage.rs`): the title can decommit the page at any time. An unreadable cell shows `mem unreadable` (@bmjask's review). The test `the_cells_behind_summary_reads_a_decommitted_or_protected_cell_without_faulting` covers it. The four lines, from a 60 s run of this head with `XCL_THREAD_DUMP_AT=45` (the title was not stalled, so all four are empty): ``` D3D12.X: sync state at 45 s: pending title ID3D12Fences: none D3D12.X: sync state at 45 s: XCL's own queue waits unmet: none D3D12.X: sync state at 45 s: 0 GPU waits armed D3D12.X: sync state at 45 s: Wait64 cells behind: none ``` **Tested** - Hardware and software: - RTX 3070 8 GB (NVIDIA 617.42, 32-lane waves), i9-9900K, 32 GB RAM; - Windows 11 Pro N 26200, Rust 1.99.0, DXC 1.8.2502.11. - Rebased onto `main` `72f848c`. - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` on `97e22f6`: **1414 passed, 0 failed, 46 ignored**. 26 SKIPPED: - 21 `no wave64` on this 32-lane card; - 3 per-lane forms refused; - 1 needs Windows Developer Mode to turn the driver cache off; - 1 `no heap windows`. - The diagnostic on this head: the 60 s run above logged the four lines after the thread dump, and the dump came out as before (147 thread lines). - The first commit's lines on #2057's tree are in the runs linked above. The fourth line is @GreemSC's function as used in his RX 7900 XT runs. **Regression run** (`scripts/smoke.ps1 -Game <retail title> -Seconds 60`, the same title for both) `main` `72f848c`: ``` xcl-smoke v1 commit: 72f848cabfa588201554c1c01c9406a73fe7e964 gpu: NVIDIA GeForce RTX 3070 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1396 (PresentX 1396) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14927 MB ``` This PR, `97e22f6`: ``` xcl-smoke v1 commit: 97e22f64949d02d4cbbcce2bc6f0e2a703a09166 gpu: NVIDIA GeForce RTX 3070 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1551 (PresentX 1551) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14809 MB ``` **Not tested** - A stalled title on this exact head with `XCL_THREAD_DUMP_AT`: the 60 s run did not stall. - AMD, Intel; Linux / Wine. **AI use** - Claude Code (Claude Opus 5.5) wrote the first commit, folded in @GreemSC's function as the second, ran the tests and the smoke runs, and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
ClosetPie107 commented 2026-11-25 14:09:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T13:09:26Z.


Linux / AMD RDNA4 (RADV) test report for head 8eaad18 merged locally onto main 1a0bbe3 (clean merge).

Environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton v3.1 (#257 + dxil-spirv master 694cc674), DXVK v3.1.1-209, DXC 1.9.2609.5, x86_64-pc-windows-gnu cross-compile

Tested (debug test binary under Wine, XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64, --test-threads=1 --nocapture)

  • hle::d3d12x::list_x: 34 passed, 0 failed, 0 ignored, 0 skipped (0.32 s).
  • hle::d3d12x::real: 56 passed, 0 failed, 0 ignored, 0 skipped (1.31 s).

Not tested: full workspace suite, live XCL_THREAD_DUMP_AT output in a retail run, native Windows.

AI use: T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests on this machine, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7163371678 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7163371678). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-25T13:09:26Z. --- Linux / AMD RDNA4 (RADV) test report for head `8eaad18` merged locally onto `main` `1a0bbe3` (clean merge). **Environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS - Proton Experimental (`experimental-11.0-20261112`), vkd3d-proton v3.1 (`#257` + `dxil-spirv` `master` `694cc674`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, `x86_64-pc-windows-gnu` cross-compile **Tested** (debug test binary under Wine, `XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64`, `--test-threads=1 --nocapture`) - `hle::d3d12x::list_x`: **34 passed, 0 failed, 0 ignored, 0 skipped** (0.32 s). - `hle::d3d12x::real`: **56 passed, 0 failed, 0 ignored, 0 skipped** (1.31 s). **Not tested:** full workspace suite, live `XCL_THREAD_DUMP_AT` output in a retail run, native Windows. **AI use:** T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests on this machine, and drafted this report.
DavidM1911 commented 2026-11-25 17:07:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T16:42:03Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 2 real failures, deterministic (also fail --test-threads=1):
gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator
  assertion failed — left: 68, right: 1 (pso.rs:1360)
hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa
  assertion failed: format 85 kept — left: 28, right: 85 (device_x.rs:1376)

Same pair of failures across this batch of PRs — looks like a shared feature area with two broken assertions. Needs fixes before merge.

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7168396448 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7168396448). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T16:42:03Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: **2 real failures**, deterministic (also fail `--test-threads=1`): ``` gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator assertion failed — left: 68, right: 1 (pso.rs:1360) hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa assertion failed: format 85 kept — left: 28, right: 85 (device_x.rs:1376) ``` Same pair of failures across this batch of PRs — looks like a shared feature area with two broken assertions. Needs fixes before merge. — Devin
kole07139 commented 2026-11-25 18:04:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by kole07139 on 2026-11-25T17:10:05Z.


@DavidM1911 thanks for the run. I could not reproduce either failure. This PR only adds logging in list_x.rs and host.rs, and neither test goes through those files.

On an RTX 3070, Windows 11, debug, with cargo test -p xcl --lib -- rerouted_disk_entries_follow_the_direct_translator pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa --test-threads=1, both tests pass, 2 passed, 0 failed, on each of these:

tree result
main 55d64c2 alone 2 passed
this PR merged with main 55d64c2 2 passed
this PR merged with main 68a284a 2 passed
  • pc_resource_desc_strips_uav… failed on main itself after #1991, until #2245 (11:19 UTC). A main from before that would show it with or without this PR.
  • rerouted_disk_entries_follow_the_direct_translator reads the translated-shader disk cache. Your left: 68 may come from an XCL_DXIL_CACHE or XCL_DIRECT_DXIL set in that shell, or from a cache folder earlier runs filled. That is a guess: I have not checked what the test reads.
  • Could you say which main commit you merged, and whether either variable was set?

AI use: Claude Code (Claude Opus 5.5) ran the three checks and wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7169105628 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7169105628). Originally posted by [kole07139](https://github.com/kole07139) on 2026-11-25T17:10:05Z. --- @DavidM1911 thanks for the run. I could not reproduce either failure. This PR only adds logging in `list_x.rs` and `host.rs`, and neither test goes through those files. On an RTX 3070, Windows 11, debug, with `cargo test -p xcl --lib -- rerouted_disk_entries_follow_the_direct_translator pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa --test-threads=1`, both tests pass, 2 passed, 0 failed, on each of these: | tree | result | |---|---| | `main` `55d64c2` alone | 2 passed | | this PR merged with `main` `55d64c2` | 2 passed | | this PR merged with `main` `68a284a` | 2 passed | - `pc_resource_desc_strips_uav…` failed on `main` itself after #1991, until #2245 (11:19 UTC). A `main` from before that would show it with or without this PR. - `rerouted_disk_entries_follow_the_direct_translator` reads the translated-shader disk cache. Your `left: 68` may come from an `XCL_DXIL_CACHE` or `XCL_DIRECT_DXIL` set in that shell, or from a cache folder earlier runs filled. That is a guess: I have not checked what the test reads. - Could you say which `main` commit you merged, and whether either variable was set? AI use: Claude Code (Claude Opus 5.5) ran the three checks and wrote this reply.
GreemSC commented 2026-11-25 19:09:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by GreemSC on 2026-11-25T18:42:02Z.


A suggestion for this PR's sync-state lines, from runs where they would not have shown what held the title.

On our runs of the retail title after the first #101, the three lines this PR prints would read pending title ID3D12Fences: none, XCL's own queue waits unmet: none, 0 GPU waits armed while nothing was presented any more. What showed the stop was the SYNC_GRAPH cells that are behind their recorded value:

sync state at the thread dump: 0 armed GPU waits; cells behind:
  0x42437fe00: mem 0x0 done 0x0 sub 0x0@qNone rec 0x620 cpu 0x0 armed [];
  0x42437fe08: mem 0x0 done 0x0 sub 0x0@qNone rec 0x620 cpu 0x0 armed []

rec > sub with nothing armed means a list that writes the value was recorded and never submitted: the submitting thread is stuck. Here the thread dump showed it: a title thread in bind::execute_indirect → dispatch_chain::whole → driver_pso (the case #2404 removes), and with #2404 a title thread in pso_async::resolve_for_bind instead. The five bridged prod=qNone waits of the same runs (≥ 0x620 on 0x42437fe10…fee8) were already met, so they were not the block.

The function we used (in list_x.rs, next to internal_waits_summary), if you want to fold it in:

/// the Wait64BitValueX cells not at their highest recorded value, or with armed GPU waits
fn cells_behind_summary() -> String {
    let mut parts = Vec::new();
    if let Ok(g) = SYNC_GRAPH.try_lock() {
        for (&va, c) in g.iter().flat_map(|gr| gr.cells.iter()) {
            let done = c.fence.as_ref().map_or(0, |f| unsafe { f.GetCompletedValue() });
            if c.armed_waits.is_empty() && done >= c.recorded_max {
                continue;
            }
            let mem = if crate::gpu::shader::readable(va as usize, 8) { unsafe { *(va as *const u64) } } else { 0 };
            let armed: Vec<String> = c.armed_waits.iter().map(|a| format!("{:#x}@q{} {} ms", a.val, queue_id(a.waiting_queue), a.armed_at.elapsed().as_millis())).collect();
            parts.push(format!("{va:#x}: mem {mem:#x} done {done:#x} sub {:#x}@q{:?} rec {:#x} cpu {:#x}{} armed [{}]",
                c.submitted_max, c.submitted_queue.map(queue_id), c.recorded_max, c.cpu_signaled_max,
                if c.non_monotonic { " non-monotonic" } else { "" }, armed.join(", ")));
        }
    } else {
        parts.push("(sync graph locked)".into());
    }
    if parts.is_empty() { "none".into() } else { parts.join("; ") }
}

(try_lock, because a thread dump can come while a submitting thread holds the graph.) Two more things that helped: unwinding 28 frames instead of 14 (with 14, the title-thread callers under XCL's frames were cut off, and we first read the stop wrongly), and dumping again on its own after N seconds with no present.

Setup: RX 7900 XT, Mesa 26.2.5 RADV, Linux, Proton-CachyOS Wine 11, a local vkd3d-proton build; XCL main 68a284a + #1732 + #684 + #1860 + part of #203 (+ #2404 + #2097 for the second reading); XCL_DIRECT_DXIL=1; retail 1.0.2.1; 180 s runs: 4 on the first tree (12 thread dumps, all with the three lines at none / none / 0 and the two cells behind), 1 so far with #2404 + #2097. This is not a PR of ours: no point in a second one next to yours.

AI use: Claude Code (Claude Opus 5.5) wrote the diagnostic, ran the builds and runs, read the logs and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7171273089 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7171273089). Originally posted by [GreemSC](https://github.com/GreemSC) on 2026-11-25T18:42:02Z. --- A suggestion for this PR's sync-state lines, from runs where they would not have shown what held the title. On our runs of the retail title after the first `#101`, the three lines this PR prints would read `pending title ID3D12Fences: none`, `XCL's own queue waits unmet: none`, `0 GPU waits armed` while nothing was presented any more. What showed the stop was the `SYNC_GRAPH` cells that are **behind their recorded value**: ``` sync state at the thread dump: 0 armed GPU waits; cells behind: 0x42437fe00: mem 0x0 done 0x0 sub 0x0@qNone rec 0x620 cpu 0x0 armed []; 0x42437fe08: mem 0x0 done 0x0 sub 0x0@qNone rec 0x620 cpu 0x0 armed [] ``` `rec > sub` with nothing armed means a list that writes the value was recorded and never submitted: the submitting thread is stuck. Here the thread dump showed it: a title thread in `bind::execute_indirect → dispatch_chain::whole → driver_pso` (the case #2404 removes), and with #2404 a title thread in `pso_async::resolve_for_bind` instead. The five bridged `prod=qNone` waits of the same runs (≥ 0x620 on 0x42437fe10…fee8) were already met, so they were not the block. The function we used (in `list_x.rs`, next to `internal_waits_summary`), if you want to fold it in: ```rust /// the Wait64BitValueX cells not at their highest recorded value, or with armed GPU waits fn cells_behind_summary() -> String { let mut parts = Vec::new(); if let Ok(g) = SYNC_GRAPH.try_lock() { for (&va, c) in g.iter().flat_map(|gr| gr.cells.iter()) { let done = c.fence.as_ref().map_or(0, |f| unsafe { f.GetCompletedValue() }); if c.armed_waits.is_empty() && done >= c.recorded_max { continue; } let mem = if crate::gpu::shader::readable(va as usize, 8) { unsafe { *(va as *const u64) } } else { 0 }; let armed: Vec<String> = c.armed_waits.iter().map(|a| format!("{:#x}@q{} {} ms", a.val, queue_id(a.waiting_queue), a.armed_at.elapsed().as_millis())).collect(); parts.push(format!("{va:#x}: mem {mem:#x} done {done:#x} sub {:#x}@q{:?} rec {:#x} cpu {:#x}{} armed [{}]", c.submitted_max, c.submitted_queue.map(queue_id), c.recorded_max, c.cpu_signaled_max, if c.non_monotonic { " non-monotonic" } else { "" }, armed.join(", "))); } } else { parts.push("(sync graph locked)".into()); } if parts.is_empty() { "none".into() } else { parts.join("; ") } } ``` (`try_lock`, because a thread dump can come while a submitting thread holds the graph.) Two more things that helped: unwinding 28 frames instead of 14 (with 14, the title-thread callers under XCL's frames were cut off, and we first read the stop wrongly), and dumping again on its own after N seconds with no present. **Setup:** RX 7900 XT, Mesa 26.2.5 RADV, Linux, Proton-CachyOS Wine 11, a local vkd3d-proton build; XCL `main` 68a284a + #1732 + #684 + #1860 + part of #203 (+ #2404 + #2097 for the second reading); `XCL_DIRECT_DXIL=1`; retail 1.0.2.1; 180 s runs: 4 on the first tree (12 thread dumps, all with the three lines at none / none / 0 and the two cells behind), 1 so far with #2404 + #2097. This is not a PR of ours: no point in a second one next to yours. **AI use:** Claude Code (Claude Opus 5.5) wrote the diagnostic, ran the builds and runs, read the logs and wrote this comment.
kole07139 commented 2026-11-25 20:08:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by kole07139 on 2026-11-25T19:35:18Z.


Thanks, @GreemSC. In something like 1-2 hours i will implement the suggestions and a Claude Reply will come right after.

<!-- greyfinch-sync:ivall/xcl:comment:7172503742 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7172503742). Originally posted by [kole07139](https://github.com/kole07139) on 2026-11-25T19:35:18Z. --- Thanks, @GreemSC. In something like 1-2 hours i will implement the suggestions and a Claude Reply will come right after.
kole07139 commented 2026-11-25 21:05:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by kole07139 on 2026-11-25T20:56:11Z.


@GreemSC thank you. That is the case these three lines cannot see. Your cells_behind_summary is folded in as the second commit, 944dc85, with you as co-author: each XCL_THREAD_DUMP_AT dump now also logs Wait64 cells behind: ….

  • It is the function as you posted it. I only wrapped the long format call.
  • It takes SYNC_GRAPH with try_lock and logs (sync graph locked) when it cannot get the lock.
  • I left out the other two points, because open PRs already cover them: the deeper unwind is #1734 and the dump after N seconds without a present is #1656.

Retested on the new head (RTX 3070 8 GB, Windows 11):

  • the PR is rebased onto main 72f848c; the suite gives 1413 passed, 0 failed, 46 ignored;
  • scripts/smoke.ps1: the description has the new block;
  • a 60 s run with XCL_THREAD_DUMP_AT=45 logged the four lines, the last Wait64 cells behind: none (the title was not stalled).

AI use: Claude Code (Claude Opus 5.5) folded the function in, ran the checks and wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7174389405 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7174389405). Originally posted by [kole07139](https://github.com/kole07139) on 2026-11-25T20:56:11Z. --- @GreemSC thank you. That is the case these three lines cannot see. Your `cells_behind_summary` is folded in as the second commit, `944dc85`, with you as co-author: each `XCL_THREAD_DUMP_AT` dump now also logs `Wait64 cells behind: …`. - It is the function as you posted it. I only wrapped the long format call. - It takes `SYNC_GRAPH` with `try_lock` and logs `(sync graph locked)` when it cannot get the lock. - I left out the other two points, because open PRs already cover them: the deeper unwind is #1734 and the dump after N seconds without a present is #1656. Retested on the new head (RTX 3070 8 GB, Windows 11): - the PR is rebased onto `main` `72f848c`; the suite gives 1413 passed, 0 failed, 46 ignored; - `scripts/smoke.ps1`: the description has the new block; - a 60 s run with `XCL_THREAD_DUMP_AT=45` logged the four lines, the last `Wait64 cells behind: none` (the title was not stalled). AI use: Claude Code (Claude Opus 5.5) folded the function in, ran the checks and wrote this reply.
bmjask commented 2026-11-25 21:11:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:11:31Z.

Review: COMMENTED


P1 diagnostic crash hazard: cells_behind_summary calls readable(va,8) then directly dereferences *(va as *const u64) for persistent SYNC_GRAPH cells. readable is only a VirtualQuery/working-set preflight and does not pin the allocation; a title can decommit/reuse a recorded Wait64 address before XCL_THREAD_DUMP_AT runs, changing protection between check and dereference. Use ReadProcessMemory/fault-safe read or omit mem when it cannot be safely snapshotted, and add a recorded-cell -> decommit/protect -> summary regression.

<!-- greyfinch-sync:ivall/xcl:review:6065043058 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#pullrequestreview-6065043058). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T21:11:31Z. **Review:** COMMENTED --- P1 diagnostic crash hazard: cells_behind_summary calls readable(va,8) then directly dereferences *(va as *const u64) for persistent SYNC_GRAPH cells. readable is only a VirtualQuery/working-set preflight and does not pin the allocation; a title can decommit/reuse a recorded Wait64 address before XCL_THREAD_DUMP_AT runs, changing protection between check and dereference. Use ReadProcessMemory/fault-safe read or omit mem when it cannot be safely snapshotted, and add a recorded-cell -> decommit/protect -> summary regression.
kole07139 commented 2026-11-25 22:06:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by kole07139 on 2026-11-25T21:30:55Z.


@bmjask thank you, you are right. readable is only a preflight: the title can decommit or protect a recorded cell's page between the check and the read, and the dump would then fault.

Fixed in 97e22f6, folded into the second commit:

  • The cell is now read with ReadProcessMemory on the own process. That is dstorage::read_own, the helper DirectStorage already uses for title memory, made pub(crate). The kernel catches the fault, so the read cannot crash the dump.
  • An unreadable cell is logged as mem unreadable instead of 0, so it cannot be mistaken for a zero.
  • New test the_cells_behind_summary_reads_a_decommitted_or_protected_cell_without_faulting:
    • it records two cells, decommits the first page and sets the second to PAGE_NOACCESS;
    • it checks that the summary lists both as mem unreadable.
    • It fails on the previous head, which printed mem 0x0. The race itself cannot be forced in a test; the test covers the state the race leaves.

Retested on 97e22f6 (RTX 3070 8 GB, Windows 11):

  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1414 passed, 0 failed, 46 ignored;
  • scripts/smoke.ps1 again: the new block is in the description.

AI use: Claude Code (Claude Opus 5.5) made the change, wrote the test, ran the checks and wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7175178464 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7175178464). Originally posted by [kole07139](https://github.com/kole07139) on 2026-11-25T21:30:55Z. --- @bmjask thank you, you are right. `readable` is only a preflight: the title can decommit or protect a recorded cell's page between the check and the read, and the dump would then fault. Fixed in `97e22f6`, folded into the second commit: - The cell is now read with `ReadProcessMemory` on the own process. That is `dstorage::read_own`, the helper `DirectStorage` already uses for title memory, made `pub(crate)`. The kernel catches the fault, so the read cannot crash the dump. - An unreadable cell is logged as `mem unreadable` instead of `0`, so it cannot be mistaken for a zero. - New test `the_cells_behind_summary_reads_a_decommitted_or_protected_cell_without_faulting`: - it records two cells, decommits the first page and sets the second to `PAGE_NOACCESS`; - it checks that the summary lists both as `mem unreadable`. - It fails on the previous head, which printed `mem 0x0`. The race itself cannot be forced in a test; the test covers the state the race leaves. Retested on `97e22f6` (RTX 3070 8 GB, Windows 11): - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1414 passed, 0 failed, 46 ignored; - `scripts/smoke.ps1` again: the new block is in the description. AI use: Claude Code (Claude Opus 5.5) made the change, wrote the test, ran the checks and wrote this reply.
DavidM1911 commented 2026-11-26 01:05:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:59:29Z.


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7179315554 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7179315554). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T00:59:29Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
xpatfussy69x commented 2026-11-26 07:03:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-26T06:08:19Z.


Test run on exact head 97e22f6 merged into main b49be18 (with #1580; merges without conflicts), retail title 1.0.2.1, at the stop in its story load on a 12 GB card: the new summary names what is behind where nothing else did.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, wave32), Ryzen 5 7500F, 32 GB RAM, Windows 11 (26300), release build.
  • XCL_THREAD_DUMP_AT=150,180, XCL_NETWORK=0, A every 4 s from 20 s, compute pipelines built ahead; presents, submits and DirectStorage go to 0 at ~86–140 s, no time-out.
  • At both dumps: pending title ID3D12Fences: none, XCL's own queue waits unmet: none, 0 GPU waits armed, and Wait64 cells behind: 0x70417fe08: mem 0x0 done 0x0 sub 0x0@qNone rec 0x619 cpu 0x0 armed []; 0x70417fe00: … – a list that writes the cells recorded and never submitted. A second run gave the same pattern on other cells (rec 0x647). Details on #1452.
  • The dumps at 150 s and 180 s came out complete in both runs; no fault from the new lines.

Not tested

  • The PR's unit tests and the whole suite on this head (only the title runs); AMD; a third dump time (on main, a third XCL_THREAD_DUMP_AT dump once faulted in ntdll on the dump thread, 0xc0000005 … read at 0xacf, before this PR).

AI use

  • Claude Code (Claude Opus 5.5) ran the merge and the title runs on the machine above, read the logs and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7184128771 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7184128771). Originally posted by [xpatfussy69x](https://github.com/xpatfussy69x) on 2026-11-26T06:08:19Z. --- Test run on exact head `97e22f6` merged into `main` `b49be18` (with #1580; merges without conflicts), retail title 1.0.2.1, at the stop in its story load on a 12 GB card: **the new summary names what is behind where nothing else did.** **Tested** - NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, wave32), Ryzen 5 7500F, 32 GB RAM, Windows 11 (26300), release build. - `XCL_THREAD_DUMP_AT=150,180`, `XCL_NETWORK=0`, A every 4 s from 20 s, compute pipelines built ahead; presents, submits and DirectStorage go to 0 at ~86–140 s, no time-out. - At both dumps: `pending title ID3D12Fences: none`, `XCL's own queue waits unmet: none`, `0 GPU waits armed`, and `Wait64 cells behind: 0x70417fe08: mem 0x0 done 0x0 sub 0x0@qNone rec 0x619 cpu 0x0 armed []; 0x70417fe00: …` – a list that writes the cells recorded and never submitted. A second run gave the same pattern on other cells (`rec 0x647`). Details on #1452. - The dumps at 150 s and 180 s came out complete in both runs; no fault from the new lines. **Not tested** - The PR's unit tests and the whole suite on this head (only the title runs); AMD; a third dump time (on `main`, a third `XCL_THREAD_DUMP_AT` dump once faulted in ntdll on the dump thread, `0xc0000005 … read at 0xacf`, before this PR). **AI use** - Claude Code (Claude Opus 5.5) ran the merge and the title runs on the machine above, read the logs and wrote this report.
kole07139 commented 2026-11-28 15:59:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by kole07139 on 2026-11-28T15:59:34Z.


Both commits of this PR are in main since #2959 (merged 2026-11-27), with the same code:

  • 60a90b12 is this PR's 06f9df8 (the pending fences, XCL's own queue waits and the armed GPU waits at each XCL_THREAD_DUMP_AT dump);
  • 3caff9ef is 97e22f6 (@GreemSC's cells_behind_summary and the decommitted / protected cell test).

@bmjask's bff80f9b then added the list that recorded each cell to that line ("the sync-state dump names the list behind a Wait64 cell"). The conflict with main is this PR's own code, so nothing is left to merge. I am closing it as landed through #2959. Thanks to @GreemSC for the function and to @bmjask for carrying it and extending it.

<!-- greyfinch-sync:ivall/xcl:comment:7241890585 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2244#issuecomment-7241890585). Originally posted by [kole07139](https://github.com/kole07139) on 2026-11-28T15:59:34Z. --- Both commits of this PR are in `main` since #2959 (merged 2026-11-27), with the same code: - `60a90b12` is this PR's `06f9df8` (the pending fences, XCL's own queue waits and the armed GPU waits at each `XCL_THREAD_DUMP_AT` dump); - `3caff9ef` is `97e22f6` (@GreemSC's `cells_behind_summary` and the decommitted / protected cell test). @bmjask's `bff80f9b` then added the list that recorded each cell to that line ("the sync-state dump names the list behind a Wait64 cell"). The conflict with `main` is this PR's own code, so nothing is left to merge. I am closing it as landed through #2959. Thanks to @GreemSC for the function and to @bmjask for carrying it and extending it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2234
No description provided.