Skip to content

[upstream #1734] xcl run: a thread dump line reaches the title's frames under a deep stack - #394

Open
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1734
Open

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1734

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner

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 xcl-dev#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: xcl-dev#846, xcl-dev#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

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.

Mirror of xcl-dev#1734 (auto-synced, do not edit).

…tack

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.)
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.

2 participants