Shaders: xcl pipelines leaves to the title only what a crash cut short #1325

Closed
VolenNakov wants to merge 9 commits from upstream-pr/1335 into main
VolenNakov commented 2026-11-24 14:56:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by VolenNakov on 2026-11-24T14:56:09Z.


Stacked on #759; only the top commit (Shaders: xcl pipelines leaves to the title only what a crash cut short) belongs here.

xcl pipelines writes each pipeline it starts to pipelines.trying, and the next run marks everything in that file as done ("left to the title") so a pipeline that crashed the driver does not end every run. The file was never trimmed and had no binary key, so the next run also skipped everything the stopped run had finished or was building: after a Ctrl+C the builds in flight, after a rebuild of xcl.exe (pipelines.done starts empty for a new binary) every pipeline the earlier run had started – 12 919 of a 15 129-pipeline share of the retail title's journal here, none of them built by the new binary.

What is in it

  • crates/xcl/src/pipelines.rs: .trying begins with binary_key(), and a pipeline's hash is written when its build starts and again when it ends. in_flight takes only hashes written an odd number of times, in a file of this binary. stop_cleanly_on_ctrl_c (a console control handler) empties the file to its key before the process ends, so a Ctrl+C or a closed console leaves nothing to the title; a crash in the driver or DXC still does. Test: only_what_was_in_flight_with_this_binary_counts_as_crashed.

Tested

  • NVIDIA GeForce RTX 4060 Ti 16 GB (driver 32.0.16.1088), Intel Core i7-8700, 32 GB RAM, Windows 11 build 26200, rustc 1.94.1 MSVC, release.
  • cargo build --release --workspace, then cargo test --release --workspace --no-fail-fast -- --test-threads=4: 703 passed, 3 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware. The 3 failures are title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, title_textures::tests::transitions_apply_when_their_list_is_submitted and vram::tests::d32s8_targets_take_their_own_size_of_video_memory; run on their own they pass, on this commit (twice) and on #759's head 788e366, so they fail only next to the other GPU tests on this 16 GB card. This change touches neither file.
  • xcl pipelines on the retail title's journal with this commit's build, stopped with Ctrl+C after 1 222 pipelines: pipelines.trying went from 2 446 records to 8 bytes (the key only); the next start printed 1222 done before and no "the last run ended while making …" line.
  • Earlier, with the same change on a local tree (#759 + main 930e8b4): four processes on shares of the journal (a local --shard option, not in this PR) stopped with Ctrl+C and restarted on a rebuilt xcl.exe started with "0 done before" and no "the last run ended while making …" line; before the change the same restart reported 12 919 such pipelines per shard.

Regression run

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 4060 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1437 (PresentX 1437)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 48880 MB

PR:

xcl-smoke v1
commit: d26b19cc7377b107198f580eda959db30f9a4d05
gpu: NVIDIA GeForce RTX 4060 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1295 (PresentX 1295)
presents per 2 s (last 3): 60 59 59
device removals: 0
crashes: 0
peak commit: 15572 MB

Not tested

  • A real crash in the driver or DXC during xcl pipelines (the path that should still leave the in-flight pipeline to the title): only the unit test covers it.
  • --watch beside a running title, AMD and Intel GPUs, Wine.
  • The smoke runs do not reach xcl pipelines; they check that the runtime is unchanged. main's peak commit is high because of #1307 (b8b1f49), which #759's base does not have.

AI use

  • Claude Code with Claude Opus 5.5: found the bug in runs on my PC, wrote the change, the test and this description, and ran the tests and the smoke runs.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:6584641566 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1335). Originally posted by [VolenNakov](https://github.com/VolenNakov) on 2026-11-24T14:56:09Z. --- Stacked on #759; only the top commit (`Shaders: xcl pipelines leaves to the title only what a crash cut short`) belongs here. `xcl pipelines` writes each pipeline it starts to `pipelines.trying`, and the next run marks everything in that file as done ("left to the title") so a pipeline that crashed the driver does not end every run. The file was never trimmed and had no binary key, so the next run also skipped everything the stopped run had finished or was building: after a Ctrl+C the builds in flight, after a rebuild of xcl.exe (`pipelines.done` starts empty for a new binary) every pipeline the earlier run had started – 12 919 of a 15 129-pipeline share of the retail title's journal here, none of them built by the new binary. **What is in it** - `crates/xcl/src/pipelines.rs`: `.trying` begins with `binary_key()`, and a pipeline's hash is written when its build starts and again when it ends. `in_flight` takes only hashes written an odd number of times, in a file of this binary. `stop_cleanly_on_ctrl_c` (a console control handler) empties the file to its key before the process ends, so a Ctrl+C or a closed console leaves nothing to the title; a crash in the driver or DXC still does. Test: `only_what_was_in_flight_with_this_binary_counts_as_crashed`. **Tested** - NVIDIA GeForce RTX 4060 Ti 16 GB (driver 32.0.16.1088), Intel Core i7-8700, 32 GB RAM, Windows 11 build 26200, rustc 1.94.1 MSVC, release. - `cargo build --release --workspace`, then `cargo test --release --workspace --no-fail-fast -- --test-threads=4`: 703 passed, 3 failed, 41 ignored. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. The 3 failures are `title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels`, `title_textures::tests::transitions_apply_when_their_list_is_submitted` and `vram::tests::d32s8_targets_take_their_own_size_of_video_memory`; run on their own they pass, on this commit (twice) and on #759's head `788e366`, so they fail only next to the other GPU tests on this 16 GB card. This change touches neither file. - `xcl pipelines` on the retail title's journal with this commit's build, stopped with Ctrl+C after 1 222 pipelines: `pipelines.trying` went from 2 446 records to 8 bytes (the key only); the next start printed `1222 done before` and no "the last run ended while making …" line. - Earlier, with the same change on a local tree (#759 + `main` `930e8b4`): four processes on shares of the journal (a local `--shard` option, not in this PR) stopped with Ctrl+C and restarted on a rebuilt xcl.exe started with "0 done before" and no "the last run ended while making …" line; before the change the same restart reported 12 919 such pipelines per shard. **Regression run** main: ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: NVIDIA GeForce RTX 4060 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1437 (PresentX 1437) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 48880 MB ``` PR: ``` xcl-smoke v1 commit: d26b19cc7377b107198f580eda959db30f9a4d05 gpu: NVIDIA GeForce RTX 4060 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1295 (PresentX 1295) presents per 2 s (last 3): 60 59 59 device removals: 0 crashes: 0 peak commit: 15572 MB ``` **Not tested** - A real crash in the driver or DXC during `xcl pipelines` (the path that should still leave the in-flight pipeline to the title): only the unit test covers it. - `--watch` beside a running title, AMD and Intel GPUs, Wine. - The smoke runs do not reach `xcl pipelines`; they check that the runtime is unchanged. `main`'s peak commit is high because of #1307 (`b8b1f49`), which #759's base does not have. **AI use** - Claude Code with Claude Opus 5.5: found the bug in runs on my PC, wrote the change, the test and this description, and ran the tests and the smoke runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
futurepro62 commented 2026-11-24 15:06:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T15:05:39Z.


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

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, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 706 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: graphics_round_trip, a_torn_frame_written_over_is_read_again, done_file_of_another_binary_is_replaced_and_a_torn_record_cut, used_pipelines_first_done_ones_skipped_journal_followed, only_what_was_in_flight_with_this_binary_counts_as_crashed.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 706 passed, 0 failed, 41 ignored, no skips.

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.
<!-- greyfinch-sync:ivall/xcl:comment:7135447141 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1335#issuecomment-7135447141). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T15:05:39Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `d26b19c` (on its base `f4ce27c`). **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, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **706 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `graphics_round_trip`, `a_torn_frame_written_over_is_read_again`, `done_file_of_another_binary_is_replaced_and_a_torn_record_cut`, `used_pipelines_first_done_ones_skipped_journal_followed`, `only_what_was_in_flight_with_this_binary_counts_as_crashed`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **706 passed, 0 failed, 41 ignored**, no skips. **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.
DavidM1911 commented 2026-11-24 16:06:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T15:08:40Z.


Does not compile merged with current main (930e8b4): cargo test -p xcl --lib fails with

  • E0599: no method acquire on d3d12x::real::Slots (used at real.rs:4217, BIG_COMPILES.acquire())
  • E0425: cannot find function wait_for_commit

Looks like the branch was written against an older/different allocator API — needs a rebase onto current main. Also ~1,147 changed lines across 11 files; likely wants splitting per CONTRIBUTING.

<!-- greyfinch-sync:ivall/xcl:comment:7135529802 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1335#issuecomment-7135529802). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T15:08:40Z. --- Does not compile merged with current `main` (`930e8b4`): `cargo test -p xcl --lib` fails with - `E0599`: no method `acquire` on `d3d12x::real::Slots` (used at real.rs:4217, `BIG_COMPILES.acquire()`) - `E0425`: cannot find function `wait_for_commit` Looks like the branch was written against an older/different allocator API — needs a rebase onto current main. Also ~1,147 changed lines across 11 files; likely wants splitting per CONTRIBUTING.
JoaoPauluu commented 2026-11-24 16:07:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T15:37:03Z.


A run of this commit under Wine on Linux, where xcl pipelines still crashes (the stack overflow I reported on #759). That makes it a real crash case for the new .trying handling, which works as described.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. d26b19c as it is (stacked on #759), no uncommitted changes.
  • The retail title's journal from a 60 s run this morning (57 807 pipelines, 5 659 shaders, 4 memory windows). Its pipelines.done (406 272 bytes) and pipelines.trying (296 bytes) were written by #759's 788e366 build.
  • Run 1: 57807 pipelines to make (228 the title used), 0 done before. The other binary's files were not taken, and there was no "last run ended" line. At 50 600 done it ended after 162 s with thread 'xcl-warm-0' has overflowed its stack, exit 5. It left pipelines.trying at 810 424 bytes.
  • Run 2: the last run ended while making 6 pipelines: left to the title, then 7153 pipelines to make (0 the title used), 50654 done before. So of everything run 1 started, only the 6 in flight at the crash were skipped. It made 1 driver blob, then crashed again after 5 s (xcl-warm-1 overflowed its stack, exit 5).
  • On #759's head 788e366 this morning, the reruns also left only 6 to the title after each crash, but there .trying was a fresh file per run. This run covers the binary key and the start / end records.

Not tested

  • Ctrl+C (stop_cleanly_on_ctrl_c); only_what_was_in_flight_with_this_binary_counts_as_crashed and the rest of the suite on this head; native Windows.

AI use

  • Claude Code (Claude Opus 5.5) built the commit, ran the tool and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
<!-- greyfinch-sync:ivall/xcl:comment:7136327836 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1335#issuecomment-7136327836). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-24T15:37:03Z. --- A run of this commit under Wine on Linux, where `xcl pipelines` still crashes (the stack overflow I reported on #759). That makes it a real crash case for the new `.trying` handling, which works as described. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `d26b19c` as it is (stacked on #759), no uncommitted changes. - The retail title's journal from a 60 s run this morning (57 807 pipelines, 5 659 shaders, 4 memory windows). Its `pipelines.done` (406 272 bytes) and `pipelines.trying` (296 bytes) were written by #759's `788e366` build. - Run 1: `57807 pipelines to make (228 the title used), 0 done before`. The other binary's files were not taken, and there was no "last run ended" line. At 50 600 done it ended after 162 s with `thread 'xcl-warm-0' has overflowed its stack`, exit 5. It left `pipelines.trying` at 810 424 bytes. - Run 2: `the last run ended while making 6 pipelines: left to the title`, then `7153 pipelines to make (0 the title used), 50654 done before`. So of everything run 1 started, only the 6 in flight at the crash were skipped. It made 1 driver blob, then crashed again after 5 s (`xcl-warm-1` overflowed its stack, exit 5). - On #759's head `788e366` this morning, the reruns also left only 6 to the title after each crash, but there `.trying` was a fresh file per run. This run covers the binary key and the start / end records. **Not tested** - Ctrl+C (`stop_cleanly_on_ctrl_c`); `only_what_was_in_flight_with_this_binary_counts_as_crashed` and the rest of the suite on this head; native Windows. **AI use** - Claude Code (Claude Opus 5.5) built the commit, ran the tool and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
upstream-sync closed this pull request 2026-11-24 21:28:58 +00:00
VolenNakov commented 2026-11-24 21:29:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by VolenNakov on 2026-11-24T21:10:13Z.


Closing: #759 now does this itself – d20dc0f keeps only the pipelines being made in .trying, and bbf56a8 makes Ctrl+C a clean stop – so this PR adds nothing on top of it. Thanks @futurepro62 for the full-suite runs (RTX 5070 Ti and the Radeon iGPU), @JoaoPauluu for the real crash case under Wine (only the 6 in-flight pipelines left to the title after 50 600 started), and @DavidM1911 for spotting that the old base no longer builds on main.

AI use: Claude Code (Claude Opus 5.5) wrote this note.

<!-- greyfinch-sync:ivall/xcl:comment:7144570147 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1335#issuecomment-7144570147). Originally posted by [VolenNakov](https://github.com/VolenNakov) on 2026-11-24T21:10:13Z. --- Closing: #759 now does this itself – `d20dc0f` keeps only the pipelines being made in `.trying`, and `bbf56a8` makes Ctrl+C a clean stop – so this PR adds nothing on top of it. Thanks @futurepro62 for the full-suite runs (RTX 5070 Ti and the Radeon iGPU), @JoaoPauluu for the real crash case under Wine (only the 6 in-flight pipelines left to the title after 50 600 started), and @DavidM1911 for spotting that the old base no longer builds on `main`. AI use: Claude Code (Claude Opus 5.5) wrote this note.
DavidM1911 commented 2026-11-26 05:05:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T04:53:17Z.


Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7182990043 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1335#issuecomment-7182990043). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T04:53:17Z. --- Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.

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!1325
No description provided.