xcl run: a thread dump line reaches the title's frames under a deep stack #1734

Open
github-bot wants to merge 1 commit from github-bot/gh-1734 into main AGit
Owner

@⁠JRamos1993 on GitHub · 2026-11-24 20:02 UTC · original
JRamos1993:thread-dump-title-frames → main · +59 −2 · 1 files · 1 commits · open

A thread dump line showed each thread's top 14 frames. A title thread deep in XCL, the driver or DXC had all 14 of its frames there, so its line named no title frame and read like one of XCL's own threads. Examples are a compute pipeline the thread builds in a bind, or a compile it waits for. I misread such lines in a world-load stall of the retail title in #846; my report there explains how.

The dump now unwinds up to 96 frames. When none of the top 14 is in the title's code but a deeper one is, the line adds how many frames were left out and the title's first 4 frames from there. All other lines are unchanged. Related: #846, #924.

#253 changes the same call (unwind reads a copy of the stack there). Whichever of the two lands second needs a one-line rebase.

What is in it

  • crates/xcl/src/eh.rs:
    • dump_frames picks a line's frames: the top DUMP_FRAMES (14). When none of those is in the title's code, it adds … N frames … and the title's first DUMP_TITLE_FRAMES (4) frames.
    • dump_threads unwinds DUMP_UNWIND (96) frames and passes them to it.
    • "In the title's code" is modules::image_base_for_addr: the images XCL maps itself, which are the title's exe and DLLs. It takes no lock.
  • Tests: a_dump_line_reaches_the_title_frames_under_a_deep_stack and a_dump_line_is_the_top_frames_otherwise.

Tested

  • NVIDIA GeForce RTX 5090 32 GB (driver 621.24), Intel Core i9-14900KF, 64 GB RAM, Windows 11 Pro 26200, rustc 1.97.1.
    • Tests: debug, x86_64-pc-windows-msvc, and again with x86_64-pc-windows-gnu.
    • Title and smoke runs: release builds with x86_64-pc-windows-gnu.
  • cargo test --workspace -- --test-threads=4 on d18b275, after cargo build --workspace: 860 passed, 0 failed, 42 ignored, the same with both toolchains. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows). Both new tests pass.
  • Retail title 1.0.2.1 to its world-load stall: XCL_NETWORK=0 XCL_PRESS_AT=25:A XCL_THREAD_DUMP_AT=88,96.
    • Three dumps: at 88 s, at 96 s, and the one at the stop.
    • In each, two title threads whose top 14 frames are all in XCL and NVIDIA's compiler now end with … N frames … and their first title frames. Those frames were 18 to 53 frames deep.
    • In my earlier dumps of the same stall on main, such threads' lines had no title frame.
    • In another run, a local build unwinding 256 frames found such threads' first title frames at most 47 deep.
    • The only unnamed threads left without a title frame are XCL's own.

Regression run (60 s, no input)

main:

xcl-smoke v1
commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0
gpu: NVIDIA GeForce RTX 5090
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1608 (PresentX 1608)
presents per 2 s (last 3): 60 60 59
device removals: 0
crashes: 0
peak commit: 17333 MB

PR:

xcl-smoke v1
commit: d18b27513ada669c25d3d3ea9ed386c1acea36d7
gpu: NVIDIA GeForce RTX 5090
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1646 (PresentX 1646)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15952 MB

In these 60 s runs the title takes one of two paths, whatever the build: about 16–17 GB peak commit with ~1,600 frames, or about 25–26 GB with ~1,300 frames. Two other runs took the heavier path: a second main run on c160d86 (1,302 frames, 26.5 GB) and an earlier PR run on be07955 (this change with 40 frames: 1,361 frames, 25.4 GB). Without a thread dump this change does not run.

Not tested

  • AMD and Intel GPUs, Linux / Wine
  • this change on top of #253
  • dumps of titles other than the retail one above

AI use

  • Claude Code with Claude Opus 5.5 found the problem while reading thread dumps, wrote the change and its tests, ran the tests and the title runs, and wrote this description.
**@⁠JRamos1993** on GitHub · 2026-11-24 20:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1734) `JRamos1993:thread-dump-title-frames` → `main` · +59 −2 · 1 files · 1 commits · open A thread dump line showed each thread's top 14 frames. A title thread deep in XCL, the driver or DXC had all 14 of its frames there, so its line named no title frame and read like one of XCL's own threads. Examples are a compute pipeline the thread builds in a bind, or a compile it waits for. I misread such lines in a world-load stall of the retail title in #846; my report there explains how. The dump now unwinds up to 96 frames. When none of the top 14 is in the title's code but a deeper one is, the line adds how many frames were left out and the title's first 4 frames from there. All other lines are unchanged. Related: #846, #924. #253 changes the same call (`unwind` reads a copy of the stack there). Whichever of the two lands second needs a one-line rebase. **What is in it** - `crates/xcl/src/eh.rs`: - `dump_frames` picks a line's frames: the top `DUMP_FRAMES` (14). When none of those is in the title's code, it adds `… N frames …` and the title's first `DUMP_TITLE_FRAMES` (4) frames. - `dump_threads` unwinds `DUMP_UNWIND` (96) frames and passes them to it. - "In the title's code" is `modules::image_base_for_addr`: the images XCL maps itself, which are the title's exe and DLLs. It takes no lock. - Tests: `a_dump_line_reaches_the_title_frames_under_a_deep_stack` and `a_dump_line_is_the_top_frames_otherwise`. **Tested** - NVIDIA GeForce RTX 5090 32 GB (driver 621.24), Intel Core i9-14900KF, 64 GB RAM, Windows 11 Pro 26200, rustc 1.97.1. - Tests: debug, `x86_64-pc-windows-msvc`, and again with `x86_64-pc-windows-gnu`. - Title and smoke runs: release builds with `x86_64-pc-windows-gnu`. - `cargo test --workspace -- --test-threads=4` on `d18b275`, after `cargo build --workspace`: 860 passed, 0 failed, 42 ignored, the same with both toolchains. SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). Both new tests pass. - Retail title 1.0.2.1 to its world-load stall: `XCL_NETWORK=0 XCL_PRESS_AT=25:A XCL_THREAD_DUMP_AT=88,96`. - Three dumps: at 88 s, at 96 s, and the one at the stop. - In each, two title threads whose top 14 frames are all in XCL and NVIDIA's compiler now end with `… N frames …` and their first title frames. Those frames were 18 to 53 frames deep. - In my earlier dumps of the same stall on `main`, such threads' lines had no title frame. - In another run, a local build unwinding 256 frames found such threads' first title frames at most 47 deep. - The only unnamed threads left without a title frame are XCL's own. **Regression run** (60 s, no input) main: ``` xcl-smoke v1 commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0 gpu: NVIDIA GeForce RTX 5090 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1608 (PresentX 1608) presents per 2 s (last 3): 60 60 59 device removals: 0 crashes: 0 peak commit: 17333 MB ``` PR: ``` xcl-smoke v1 commit: d18b27513ada669c25d3d3ea9ed386c1acea36d7 gpu: NVIDIA GeForce RTX 5090 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1646 (PresentX 1646) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15952 MB ``` In these 60 s runs the title takes one of two paths, whatever the build: about 16–17 GB peak commit with ~1,600 frames, or about 25–26 GB with ~1,300 frames. Two other runs took the heavier path: a second `main` run on `c160d86` (1,302 frames, 26.5 GB) and an earlier PR run on `be07955` (this change with 40 frames: 1,361 frames, 25.4 GB). Without a thread dump this change does not run. **Not tested** - AMD and Intel GPUs, Linux / Wine - this change on top of #253 - dumps of titles other than the retail one above **AI use** - Claude Code with Claude Opus 5.5 found the problem while reading thread dumps, wrote the change and its tests, ran the tests and the title runs, and wrote this description.
A thread dump line showed the top 14 frames of each thread. A title thread
deep in XCL, the driver or DXC (a compute pipeline it builds in a bind, a
compile it waits for) had all 14 of them there, so its line named no title
frame and read like one of XCL's own threads. In dumps of a retail title's
world-load stall, the title threads building pipelines in their binds looked
like that, and reading them as XCL's own threads led to a wrong conclusion.

The dump now unwinds up to 96 frames. When none of the top 14 is in the
title's code but a deeper one is, the line adds how many frames were left
out and the title's first 4 frames from there. Other lines are unchanged.
(Such a thread's first title frame was 34 and 47 frames deep.)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:02:59 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 21:14 UTC · original · edited 2026-11-24 21:56 UTC

Full-suite run, since this PR has no test report yet. Tested exact head d18b275 (on its base c160d86).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 859 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: a_dump_line_reaches_the_title_frames_under_a_deep_stack, a_dump_line_is_the_top_frames_otherwise.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 860 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Two tests were skipped with --skip on NVIDIA. Both fail on main 7f7e768 too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. heap_window_out_of_memory_falls_back_to_the_switch_form skips when XCL_HEAP_WINDOWS is unset (#1651), and shaders::tests::pso_measurement_compiles_an_exact_synthetic_record skips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not set XCL_REQUIRE_GPU, so there both just print SKIPPED.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 21:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/1734#issuecomment-7144677131) · edited 2026-11-24 21:56 UTC Full-suite run, since this PR has no test report yet. Tested exact head `d18b275` (on its base `c160d86`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record`: **859 passed, 0 failed, 42 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `a_dump_line_reaches_the_title_frames_under_a_deep_stack`, `a_dump_line_is_the_top_frames_otherwise`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **860 passed, 0 failed, 42 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - Two tests were skipped with `--skip` on NVIDIA. Both fail on main `7f7e768` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns their skips into failures. `heap_window_out_of_memory_falls_back_to_the_switch_form` skips when `XCL_HEAP_WINDOWS` is unset (#1651), and `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` skips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not set `XCL_REQUIRE_GPU`, so there both just print SKIPPED. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 22:37 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 22:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/1734#issuecomment-7146459205) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1734/head:github-bot/gh-1734'
git switch 'github-bot/gh-1734'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1734'
git switch 'github-bot/gh-1734'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1734'
git switch 'github-bot/gh-1734'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1734'
git switch 'main'
git merge --squash 'github-bot/gh-1734'
git switch 'main'
git merge --ff-only 'github-bot/gh-1734'
git switch 'main'
git merge 'github-bot/gh-1734'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.