D3D12.X: a pipeline the driver gave up on is not built again #1655

Open
zorde23 wants to merge 1 commit from upstream-pr/1665 into main
zorde23 commented 2026-11-24 18:57:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by zorde23 on 2026-11-24T18:57:59Z.


Part of #1035. No longer stacked: #1918 (in main) logs the driver's refusal of a huge compute program, which is what #1300 did.

The pipeline preload (#690) builds every pipeline an earlier run used. On an AMD RX 6750 XT two compute programs of a retail
title (~14 MB and ~23 MB of translated DXIL) each kept the driver busy 45-55 s, took the commit to the limit and were
refused with E_OUTOFMEMORY, in every run, because a failed build leaves nothing behind and the key stays in
used-pipelines.txt (#1918 logs the refusal). #1398 (retry without DXC GVN) and the switch-form retry of #680 do not
change that here (numbers below); another RX 6750 XT on #1398 also reports the ~14 MB one still refused.

#1524 (in main now) changes when these builds run, not whether they fail: big programs go to the driver a few at a time
(XCL_HUGE_PSO_CONCURRENCY, default 1, and ≥ 4 MiB in a lane of its own), which this preload already did one at a time.
Each of the two programs alone still takes the driver to its limit here. #1996 caps the builds a title waits for and
gives them a slot without waiting for commit; #2178 drops queued builds the title already released. Neither keeps a
refused build from coming back next run. The turn this PR checks is a slot driver_compile_identified took through the
commit check (since #1996, a slot taken for a waiting title thread is not one).

When the driver returns E_OUTOFMEMORY after working 1 s or more on a build ahead that had its big-compile turn (commit
free, no title thread waiting for it), the shader set gets a !<key> line in used-pipelines.txt. Pipelines of such a
set get their stand-in at once (what they got before, when the build failed) instead of being built again, ahead or at a
bind. Other failures, an out-of-memory next to a title thread that waits for the pipeline (when the build started or by
the time it failed), and an attempt followed by a retry that fails for another reason are tried again next run. Older builds pass over the new lines.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: driver_compile_identified also returns whether the compile had its turn (its
    slot came through big_compile_turn's commit check; the other callers ignore it); each attempt of
    translated_compute_pso_once (the cached-blob one, its cold retry, the switch-form retry) sets
    pso_async::note_driver_gave_up(driver_gave_up(hr, turn, time in the driver)): E_OUTOFMEMORY, the turn, ≥ 1 s.
  • crates/xcl/src/hle/d3d12x/pso_async.rs: used::skipped / skip / is_skipped (!<key> lines, one write_all per
    line); build(.., preload = true) marks the set when the driver gave up; the preload worker drops queued pipelines of a
    marked set; submit_as completes a marked set's pipeline as failed at once. Tests: a_skipped_key_is_read_from_the_file,
    a_pipeline_the_driver_gave_up_on_is_not_built_again (fails on main: the second pipeline is not done at once),
    a_build_ahead_that_fails_otherwise_is_tried_again (also: gave up, then a retry that fails otherwise; gave up while
    a title thread waited),
    only_a_long_out_of_memory_in_its_turn_is_giving_up (real.rs).

Tested

  • AMD Radeon RX 6750 XT, driver 32.0.21045.29003; AMD Ryzen 7 5700X, 32 GB (commit limit ~46 GB, page file auto);
    Windows 11 Pro 26200; Rust 1.100 MSVC; release.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 (debug build first): at this PR on 06c9f55 1268 passed,
    1 failed, 46 ignored; at main 06c9f55 1264 / 1 / 46. The same test fails on both here and this change does not
    touch it: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1.
    SKIPPED on both: f16_programs_on_the_gpu / f32_programs_on_the_gpu (some forms refused),
    pso_measurement_compiles_an_exact_synthetic_record (no Developer Mode), test_title_draws_with_a_root_signature_under_the_debug_layer
    and uploads_start_from_each_subresources_state (no debug layer), heap_window_out_of_memory_falls_back_to_the_switch_form.
  • Retail title, preload on, no input, XCL_NETWORK=0, release, a watchdog that ends the run at 90 % of the system commit
    limit (peaks below are system commit). #1321 applied to all four (without it main's commit grows from b8b1f49):
    • main + #1321: 90 s, no refusal, peak 35.8 GB; 240 s: ended by the watchdog at ~140 s (42.9 GB).
    • this PR + #1321, with the two ! lines: 240 s, peak 34.3 GB.
    • main + #1321 + #1398: ended by the watchdog at ~49 s (42.9 GB).
    • this PR + #1321 + #1398: 240 s, peak 36.0 GB; with only the ~14 MB set's line, ended at ~33 s (43.9 GB).
  • The two ! lines were written by runs of this change on main 47efa2e (preload on, 90 s): peak 53.0 → 53.1 → 19.6 →
    20.7 GB over four runs, one set marked in each of the first two (the ~23 MB one only shows once the first is skipped).
  • @papasmurph0 ran the smoke pair on NVIDIA (RTX 4080 SUPER, 64 GB, 60 s, main 85e3826 vs 599c69c, comment above):
    99.7 % of main's frames, 123 % of its peak commit, no crash or device removal. A 60 s run there does not reach the world
    load, where this change applies; on NVIDIA nothing is refused, so nothing is marked. Thanks!

Regression run

Both on main 06c9f55 and this PR rebased onto it, release, scripts/smoke.ps1 -Seconds 60 -Title retail-a, preload on,
a watchdog at 90 % of the system commit limit (not reached). The PR's run starts with the two ! lines already in
used-pipelines.txt (its log: 2 shader sets not built again); main passes over them and builds those two sets ahead
(no refusal within 60 s). System commit peak: main 33.7 GB, PR 34.2 GB.

main:

xcl-smoke v1
commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324
gpu: AMD Radeon RX 6750 XT
title: retail-a
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16533 MB

PR:

xcl-smoke v1
commit: cd46e3fc2bd9d298143d20dc5c49b209027621d0
gpu: AMD Radeon RX 6750 XT
title: retail-a
seconds: 60
exit: 0x0
frames shown: 1526 (PresentX 1527)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17789 MB

Not tested

  • Other GPUs/drivers. A newer AMD driver (RDNA4, 32.0.31044.16, comment on #1035) does not grow; there nothing is marked.
  • Linux/Wine (dxil-spirv/RADV in #1035): builds that never return are never marked. Nor is growth inside DXC (the other
    reports in #1035: NVIDIA on Windows and Linux, RADV): only a driver's E_OUTOFMEMORY answer marks a set.
  • The mark is written only when the driver answers. On a machine whose commit runs out first (here the watchdog ended
    main's runs before any refusal), the first runs still pay the full cost and may end the title; it converges one set per
    run that survives. The main run above does not write marks (it has no such code): the lines came from runs of this change on 47efa2e.
  • XCL never removes a ! line (driver update, more memory, a recompiler change that shrinks the DXIL, XCL_HEAP_WINDOWS):
    the user deletes it to retry; the log line says so. The mark also applies with XCL_PSO_PRELOAD=0.
  • The E_OUTOFMEMORY / slot / 1 s rule is unit-tested (driver_gave_up); the driver answering it was only seen in the
    runs above.
  • The slot means 3 GB of commit were free when the build started. The title loading, another process, or a second huge
    compile beside it (#1524's ≥ 4 MiB lane runs next to the other one by default; #1996 lets builds a title waits for skip
    the commit check) can use up the commit during a 30-60 s
    build; the driver then answers E_OUTOFMEMORY too and the set is marked, for good, though it might build on another run.
    Marking only after two such runs would avoid that, at the price of one more run at the limit; not done here.
  • Graphics pipelines and first-use (non-preload) builds are not marked. A skipped pipeline counts as a failed background
    build in the stats.
  • Not merged with #889 (all compute through the preload: then any compute built ahead in its turn could be marked),
    #1113 (textual overlap in used::get and the file format) or #1398 (merges cleanly; its retry resets the timer, so the
    1 s is measured on the last attempt).

AI use

  • Claude Code (Claude Opus 5.5) investigated, wrote the code, tests and this text from runs on my machine; Claude Fable 5.2
    reviewed the design and the rebased diff and tried to break it (its findings changed the marking rule). I reviewed and
    ran everything.

Written with Claude Code from runs on this machine.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5478425199 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665). Originally posted by [zorde23](https://github.com/zorde23) on 2026-11-24T18:57:59Z. --- Part of #1035. No longer stacked: #1918 (in `main`) logs the driver's refusal of a huge compute program, which is what #1300 did. The pipeline preload (#690) builds every pipeline an earlier run used. On an AMD RX 6750 XT two compute programs of a retail title (~14 MB and ~23 MB of translated DXIL) each kept the driver busy 45-55 s, took the commit to the limit and were refused with E_OUTOFMEMORY, in every run, because a failed build leaves nothing behind and the key stays in `used-pipelines.txt` (#1918 logs the refusal). #1398 (retry without DXC GVN) and the switch-form retry of #680 do not change that here (numbers below); another RX 6750 XT on #1398 also reports the ~14 MB one still refused. #1524 (in `main` now) changes when these builds run, not whether they fail: big programs go to the driver a few at a time (`XCL_HUGE_PSO_CONCURRENCY`, default 1, and ≥ 4 MiB in a lane of its own), which this preload already did one at a time. Each of the two programs alone still takes the driver to its limit here. #1996 caps the builds a title waits for and gives them a slot without waiting for commit; #2178 drops queued builds the title already released. Neither keeps a refused build from coming back next run. The turn this PR checks is a slot `driver_compile_identified` took through the commit check (since #1996, a slot taken for a waiting title thread is not one). When the driver returns E_OUTOFMEMORY after working 1 s or more on a build ahead that had its big-compile turn (commit free, no title thread waiting for it), the shader set gets a `!<key>` line in `used-pipelines.txt`. Pipelines of such a set get their stand-in at once (what they got before, when the build failed) instead of being built again, ahead or at a bind. Other failures, an out-of-memory next to a title thread that waits for the pipeline (when the build started or by the time it failed), and an attempt followed by a retry that fails for another reason are tried again next run. Older builds pass over the new lines. **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: `driver_compile_identified` also returns whether the compile had its turn (its slot came through `big_compile_turn`'s commit check; the other callers ignore it); each attempt of `translated_compute_pso_once` (the cached-blob one, its cold retry, the switch-form retry) sets `pso_async::note_driver_gave_up(driver_gave_up(hr, turn, time in the driver))`: E_OUTOFMEMORY, the turn, ≥ 1 s. - `crates/xcl/src/hle/d3d12x/pso_async.rs`: `used::skipped` / `skip` / `is_skipped` (`!<key>` lines, one `write_all` per line); `build(.., preload = true)` marks the set when the driver gave up; the preload worker drops queued pipelines of a marked set; `submit_as` completes a marked set's pipeline as failed at once. Tests: `a_skipped_key_is_read_from_the_file`, `a_pipeline_the_driver_gave_up_on_is_not_built_again` (fails on main: the second pipeline is not done at once), `a_build_ahead_that_fails_otherwise_is_tried_again` (also: gave up, then a retry that fails otherwise; gave up while a title thread waited), `only_a_long_out_of_memory_in_its_turn_is_giving_up` (real.rs). **Tested** - AMD Radeon RX 6750 XT, driver 32.0.21045.29003; AMD Ryzen 7 5700X, 32 GB (commit limit ~46 GB, page file auto); Windows 11 Pro 26200; Rust 1.100 MSVC; release. - `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug build first): at this PR on 06c9f55 1268 passed, 1 failed, 46 ignored; at main 06c9f55 1264 / 1 / 46. The same test fails on both here and this change does not touch it: `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`. SKIPPED on both: `f16_programs_on_the_gpu` / `f32_programs_on_the_gpu` (some forms refused), `pso_measurement_compiles_an_exact_synthetic_record` (no Developer Mode), `test_title_draws_with_a_root_signature_under_the_debug_layer` and `uploads_start_from_each_subresources_state` (no debug layer), `heap_window_out_of_memory_falls_back_to_the_switch_form`. - Retail title, preload on, no input, `XCL_NETWORK=0`, release, a watchdog that ends the run at 90 % of the system commit limit (peaks below are system commit). #1321 applied to all four (without it main's commit grows from b8b1f49): - main + #1321: 90 s, no refusal, peak 35.8 GB; 240 s: ended by the watchdog at ~140 s (42.9 GB). - this PR + #1321, with the two `!` lines: 240 s, peak 34.3 GB. - main + #1321 + #1398: ended by the watchdog at ~49 s (42.9 GB). - this PR + #1321 + #1398: 240 s, peak 36.0 GB; with only the ~14 MB set's line, ended at ~33 s (43.9 GB). - The two `!` lines were written by runs of this change on main 47efa2e (preload on, 90 s): peak 53.0 → 53.1 → 19.6 → 20.7 GB over four runs, one set marked in each of the first two (the ~23 MB one only shows once the first is skipped). - @papasmurph0 ran the smoke pair on NVIDIA (RTX 4080 SUPER, 64 GB, 60 s, main 85e3826 vs 599c69c, comment above): 99.7 % of main's frames, 123 % of its peak commit, no crash or device removal. A 60 s run there does not reach the world load, where this change applies; on NVIDIA nothing is refused, so nothing is marked. Thanks! **Regression run** Both on `main` 06c9f55 and this PR rebased onto it, release, `scripts/smoke.ps1 -Seconds 60 -Title retail-a`, preload on, a watchdog at 90 % of the system commit limit (not reached). The PR's run starts with the two `!` lines already in `used-pipelines.txt` (its log: 2 shader sets not built again); `main` passes over them and builds those two sets ahead (no refusal within 60 s). System commit peak: main 33.7 GB, PR 34.2 GB. main: ``` xcl-smoke v1 commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324 gpu: AMD Radeon RX 6750 XT title: retail-a seconds: 60 exit: 0x0 frames shown: 1566 (PresentX 1566) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16533 MB ``` PR: ``` xcl-smoke v1 commit: cd46e3fc2bd9d298143d20dc5c49b209027621d0 gpu: AMD Radeon RX 6750 XT title: retail-a seconds: 60 exit: 0x0 frames shown: 1526 (PresentX 1527) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17789 MB ``` **Not tested** - Other GPUs/drivers. A newer AMD driver (RDNA4, 32.0.31044.16, comment on #1035) does not grow; there nothing is marked. - Linux/Wine (dxil-spirv/RADV in #1035): builds that never return are never marked. Nor is growth inside DXC (the other reports in #1035: NVIDIA on Windows and Linux, RADV): only a driver's E_OUTOFMEMORY answer marks a set. - The mark is written only when the driver answers. On a machine whose commit runs out first (here the watchdog ended main's runs before any refusal), the first runs still pay the full cost and may end the title; it converges one set per run that survives. The main run above does not write marks (it has no such code): the lines came from runs of this change on 47efa2e. - XCL never removes a `!` line (driver update, more memory, a recompiler change that shrinks the DXIL, `XCL_HEAP_WINDOWS`): the user deletes it to retry; the log line says so. The mark also applies with `XCL_PSO_PRELOAD=0`. - The E_OUTOFMEMORY / slot / 1 s rule is unit-tested (`driver_gave_up`); the driver answering it was only seen in the runs above. - The slot means 3 GB of commit were free when the build started. The title loading, another process, or a second huge compile beside it (#1524's ≥ 4 MiB lane runs next to the other one by default; #1996 lets builds a title waits for skip the commit check) can use up the commit during a 30-60 s build; the driver then answers E_OUTOFMEMORY too and the set is marked, for good, though it might build on another run. Marking only after two such runs would avoid that, at the price of one more run at the limit; not done here. - Graphics pipelines and first-use (non-preload) builds are not marked. A skipped pipeline counts as a failed background build in the stats. - Not merged with #889 (all compute through the preload: then any compute built ahead in its turn could be marked), #1113 (textual overlap in `used::get` and the file format) or #1398 (merges cleanly; its retry resets the timer, so the 1 s is measured on the last attempt). **AI use** - Claude Code (Claude Opus 5.5) investigated, wrote the code, tests and this text from runs on my machine; Claude Fable 5.2 reviewed the design and the rebased diff and tried to break it (its findings changed the marking rule). I reviewed and ran everything. Written with Claude Code from runs on this machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
papasmurph0 commented 2026-11-24 21:09:18 +00:00 (Migrated from github.com)

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


Regression run for this PR on Windows / NVIDIA, since it has no xcl-smoke pair yet.

Tested

  • NVIDIA GeForce RTX 4080 SUPER (driver 32.0.16.1088), Ryzen 7 7800X3D, 64 GB RAM, Windows 11 build 26200, rustc 1.100.0 MSVC, release; scripts/smoke.ps1 -Seconds 60 on the retail title of #505 (game folder passed as a neutral junction, hence title: t1), each build from a clean worktree of the exact commit.

main:

xcl-smoke v1
commit: 85e38262ff94aecd75d6f83fa8156a8b7697bd13
gpu: NVIDIA GeForce RTX 4080 SUPER
title: t1
seconds: 60
exit: 0x0
frames shown: 1537 (PresentX 1537)
presents per 2 s (last 3): 57 60 60
device removals: 0
crashes: 0
peak commit: 15976 MB

this PR:

xcl-smoke v1
commit: 599c69c58bfd4ebe35ee03c76a345e46dacdb497
gpu: NVIDIA GeForce RTX 4080 SUPER
title: t1
seconds: 60
exit: 0x0
frames shown: 1532 (PresentX 1533)
presents per 2 s (last 3): 59 48 53
device removals: 0
crashes: 0
peak commit: 19686 MB

Both runs started from the same state: the title showed its first-run screens (terms, screen narration) in both, so the pair is like for like. The title saved its settings during this PR's run, so later runs on this machine skip those screens and are not comparable with these two.

The PR's run is within the limits: 99.7 % of main's frames, 123 % of its peak commit, no crash, no device removal.

Not tested: the world load, where the PR's change applies; a 60 s run does not reach it here. On this machine (125 GB commit limit) the title's screen-probe programs reach the in-title driver build in longer runs, so a longer run of this PR is possible if useful.

AI use: Claude Code (Claude Opus 5.5) built the trees, made the runs on my PC and wrote this report; I asked for it to be posted.

<!-- greyfinch-sync:ivall/xcl:comment:7143102210 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7143102210). Originally posted by [papasmurph0](https://github.com/papasmurph0) on 2026-11-24T20:08:40Z. --- Regression run for this PR on Windows / NVIDIA, since it has no `xcl-smoke` pair yet. **Tested** - NVIDIA GeForce RTX 4080 SUPER (driver 32.0.16.1088), Ryzen 7 7800X3D, 64 GB RAM, Windows 11 build 26200, rustc 1.100.0 MSVC, release; `scripts/smoke.ps1 -Seconds 60` on the retail title of #505 (game folder passed as a neutral junction, hence `title: t1`), each build from a clean worktree of the exact commit. `main`: ``` xcl-smoke v1 commit: 85e38262ff94aecd75d6f83fa8156a8b7697bd13 gpu: NVIDIA GeForce RTX 4080 SUPER title: t1 seconds: 60 exit: 0x0 frames shown: 1537 (PresentX 1537) presents per 2 s (last 3): 57 60 60 device removals: 0 crashes: 0 peak commit: 15976 MB ``` this PR: ``` xcl-smoke v1 commit: 599c69c58bfd4ebe35ee03c76a345e46dacdb497 gpu: NVIDIA GeForce RTX 4080 SUPER title: t1 seconds: 60 exit: 0x0 frames shown: 1532 (PresentX 1533) presents per 2 s (last 3): 59 48 53 device removals: 0 crashes: 0 peak commit: 19686 MB ``` Both runs started from the same state: the title showed its first-run screens (terms, screen narration) in both, so the pair is like for like. The title saved its settings during this PR's run, so later runs on this machine skip those screens and are not comparable with these two. The PR's run is within the limits: 99.7 % of `main`'s frames, 123 % of its peak commit, no crash, no device removal. **Not tested:** the world load, where the PR's change applies; a 60 s run does not reach it here. On this machine (125 GB commit limit) the title's screen-probe programs reach the in-title driver build in longer runs, so a longer run of this PR is possible if useful. AI use: Claude Code (Claude Opus 5.5) built the trees, made the runs on my PC and wrote this report; I asked for it to be posted.
DavidM1911 commented 2026-11-24 21:30:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T21:26:32Z.


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

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

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7144934587 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7144934587). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T21:26:32Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
JJAutoCompare commented 2026-11-25 05:08:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:44:36Z.


XCL PR #1665 verification

Head daf72219421f6815e2faa88c089ccd119327c72a (clean detached checkout). The PR changes crates/xcl/src/hle/d3d12x/{pso_async,real}.rs.

STOR-WINLAB, Windows 11 Enterprise Evaluation x64 build 26200.9974, AMD Family 23 Model 113 (12 logical CPUs), Intel Arc A770 (16 GiB), driver 32.0.101.9175, DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Unoptimized dev/test profiles, debug info and incremental compilation disabled.

Tested

  • cargo build --workspace and cargo test --workspace --no-run succeeded outside the Arc mutex.
  • With XCL_ADAPTER=NONE_CPU_ONLY, cargo test -p xcl --lib pso_async::used_tests -- --test-threads=1 had 9 passed, 0 failed, 0 ignored, 0 skipped. New tests checked parsing !<key> markers, returning the stand-in at the next bind without executing the replacement build after a simulated driver failure, and retrying when the final attempt failed for another reason.
  • With the same adapter setting, cargo test -p xcl --lib only_a_long_out_of_memory_in_its_turn_is_giving_up -- --test-threads=1 had 1 passed, 0 failed, 0 ignored, 0 skipped. It checked that only E_OUTOFMEMORY after at least one second with a compile slot qualifies.
  • Under Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1, cargo test --workspace --no-fail-fast -- --test-threads=4 exited 101. All four new unit tests passed again. Summing pr1665-suite.log gave 944 harness passes, 19 failures, and 43 ignored across 20 results (19 executables and one doctest target).

Workspace failures and skips

  • The library target had 14 CreateComputePipelineState failures (0x80070057) and four result mismatches. The e2e target failed the test title's dynamic depth-bias pixel check (blue where green was expected).
  • 25 exact SKIPPED lines provide no coverage. Reasons include missing wave64 (17), per-lane lowering refusal (3), missing debug layer (2), and one each for tiled tier below 2, unavailable cache control, and unavailable heap windows.

Not tested

Matched main run, retail-title smoke, real driver OOM, on-disk skip-marker write and reuse across processes, or other adapters.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1665-suite.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7153122785 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7153122785). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T04:44:36Z. --- # XCL PR #1665 verification Head `daf72219421f6815e2faa88c089ccd119327c72a` (clean detached checkout). The PR changes `crates/xcl/src/hle/d3d12x/{pso_async,real}.rs`. STOR-WINLAB, Windows 11 Enterprise Evaluation x64 build 26200.9974, AMD Family 23 Model 113 (12 logical CPUs), Intel Arc A770 (16 GiB), driver 32.0.101.9175, DXC 1.9.2609.5, rustc 1.100.0 (`0ef1bc386`, x86_64-pc-windows-msvc). Unoptimized dev/test profiles, debug info and incremental compilation disabled. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` succeeded outside the Arc mutex. - With `XCL_ADAPTER=NONE_CPU_ONLY`, `cargo test -p xcl --lib pso_async::used_tests -- --test-threads=1` had 9 passed, 0 failed, 0 ignored, 0 skipped. New tests checked parsing `!<key>` markers, returning the stand-in at the next bind without executing the replacement build after a simulated driver failure, and retrying when the final attempt failed for another reason. - With the same adapter setting, `cargo test -p xcl --lib only_a_long_out_of_memory_in_its_turn_is_giving_up -- --test-threads=1` had 1 passed, 0 failed, 0 ignored, 0 skipped. It checked that only `E_OUTOFMEMORY` after at least one second with a compile slot qualifies. - Under `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`, `cargo test --workspace --no-fail-fast -- --test-threads=4` exited 101. All four new unit tests passed again. Summing `pr1665-suite.log` gave 944 harness passes, 19 failures, and 43 ignored across 20 results (19 executables and one doctest target). **Workspace failures and skips** - The library target had 14 `CreateComputePipelineState` failures (`0x80070057`) and four result mismatches. The `e2e` target failed the test title's dynamic depth-bias pixel check (blue where green was expected). - 25 exact `SKIPPED ` lines provide no coverage. Reasons include missing wave64 (17), per-lane lowering refusal (3), missing debug layer (2), and one each for tiled tier below 2, unavailable cache control, and unavailable heap windows. **Not tested** Matched `main` run, retail-title smoke, real driver OOM, on-disk skip-marker write and reuse across processes, or other adapters. **AI use** T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1665-suite.log` and published.
Chrysana commented 2026-11-25 21:05:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-11-25T20:13:31Z.


RDNA4 run of cd46e3f, for "Other GPUs/drivers" under Not tested (your note says RDNA4 on driver 32.0.31044.16 doesn't grow; on 32.0.32015.2008 it does). On an RX 9070 XT the change works as described: the driver's refusals of builds ahead in their turn get a ! line, and the next run doesn't build those sets again. But the largest program here, 95cc13288a27a96e (ActivateRays, 2.4 MB DXIL), is never marked: it is refused and built again in every run. That one is where most of the memory goes on this card (#1598).

Setup: AMD Radeon RX 9070 XT 16 GB (RDNA4), driver 32.0.32015.2008; Ryzen 7 9800X3D, 31 GB RAM (commit ceiling 79 GB with the page files at their maximum); Windows 11 26200.9974; rustc 1.100.0 MSVC, release. Retail title 1.0.2.1, preload on (1181 shader sets in used-pipelines.txt, no ! lines at the start), XCL_NETWORK=0 XCL_ACTIVITY=1, A pressed every 4 s from 12 to 120 s, 200 s runs, cd46e3f as pushed (its base is 06c9f55).

How I got the refusals without running the whole PC out of commit: (a first try at a 37 GB limit was stopped by my own system-memory guard at ~142 s, before any refusal.) on main here, ActivateRays alone grows the process by ~16 GB and is refused only when the system nears its limit, at ~44 GB of process commit after 69 s in the driver (numbers in #1598). That took other programs down with it once, so I ran the title in a Windows job object with a 33 GB commit limit for all its processes (JOB_OBJECT_LIMIT_JOB_MEMORY). The driver's allocations fail inside the title, it returns 0x8007000e as at the system limit, and the rest of the machine keeps its headroom. The catch: the refusals come sooner (after 4–13 s in the driver), and some programs that would build with more headroom get refused here.

Run 1 under the cap, no ! lines at the start: six compute programs refused with 0x8007000e, two of them marked:

record DXIL its compile refused at ! line
67e870153afb3a94 413,472 B ungated here 119.0 s, 12.2 s in the driver no
95cc13288a27a96e (ActivateRays) 2,420,640 B ungated here 119.2 s, 12.5 s no
68d630a8567ab575 333,764 B ungated here 131.2 s, 5.8 s no
517e7bab67ece93f 1,021,324 B gated (waited 114983 ms) 131.8 s, 12.8 s !6c3726c018616a2f
b6dd852172e5f719 1,011,788 B gated (waited 5288 ms) 181.1 s, 4.3 s !7edd0762558da1f5
33743bd6d1e45443 1,040,856 B ungated here 199.7 s, 3.9 s no

The two marks match the two gated builds (same thread and time as their the driver gave up on a pipeline built ahead (shaders …): not built again lines). The four ungated here ones are what your description leaves to be tried again.

Run 2, same cap, with those two lines:

  • At start: 2 shader sets the driver gave up on in an earlier run are not built again (stand-ins; …).
  • Neither 517e7bab67ece93f nor b6dd852172e5f719 is compiled (no driver compile start for either).
  • ActivateRays is compiled again from 105.1 s and refused again after 11.1 s. This time its compile is logged gated (waited 101125 ms), so it had its turn, and it is still not marked.
  • Six more builds ahead were refused under the cap and marked (8 ! lines at the end). These are artefacts of the 33 GB limit: with more headroom some of them would build.

Both runs ran the full 200 s, exit 0, no device removal. First #101 at 105.2 / 103.7 s; presents stop 2–3 s after it in both (the four-queue wait of #1993, the same as main).

What this means on RDNA4, as far as I can tell:

  • The mark works, and skipping the two sets in run 2 is visible.
  • ActivateRays is the build that takes this machine to its limit, and it falls in the cases you retry on purpose. On main without the cap (69 s in the driver) and in run 1 here, its compile is ungated here (a title thread's). In run 2 it is gated, but its compile starts 1.4 s after the first #101, as the world load binds it. Going by build(), a gated refusal isn't marked when the build isn't the preload's own or a title thread came to wait for it, and I'd guess the latter, though the log doesn't say which. So under this PR it comes back each run, as on main. Whether a refusal the title waited for should be remembered too is your call.
  • A ! line stays until someone deletes it. On a machine that is short of commit for a moment (other programs open, as here under the cap), a build ahead that would succeed later is skipped in every run after. The log line says how to retry; it may be worth logging the free commit when the mark is written, so it's possible to tell a real "never fits" from a busy moment.

Not tested

  • These refusals at the real system limit with this PR (only under the 33 GB job limit; main reached it without the cap in #1598's runs).
  • The PR's suite, the smoke pair (papasmurph0's covers that), XCL_PSO_PRELOAD=0, the RDNA2 iGPU.
  • The marked sets' stand-ins on screen: presents stop at the world load here either way.

AI use

  • Claude Code (Claude Opus 5.5) built the PR, wrote the job-limited run script, ran the title, read the logs and drafted this comment. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7173359971 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7173359971). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-11-25T20:13:31Z. --- RDNA4 run of `cd46e3f`, for "Other GPUs/drivers" under **Not tested** (your note says RDNA4 on driver 32.0.31044.16 doesn't grow; on 32.0.32015.2008 it does). **On an RX 9070 XT the change works as described: the driver's refusals of builds ahead in their turn get a `!` line, and the next run doesn't build those sets again. But the largest program here, `95cc13288a27a96e` (ActivateRays, 2.4 MB DXIL), is never marked: it is refused and built again in every run.** That one is where most of the memory goes on this card (#1598). **Setup:** AMD Radeon RX 9070 XT 16 GB (RDNA4), driver 32.0.32015.2008; Ryzen 7 9800X3D, 31 GB RAM (commit ceiling 79 GB with the page files at their maximum); Windows 11 26200.9974; rustc 1.100.0 MSVC, release. Retail title 1.0.2.1, preload on (1181 shader sets in `used-pipelines.txt`, no `!` lines at the start), `XCL_NETWORK=0 XCL_ACTIVITY=1`, A pressed every 4 s from 12 to 120 s, 200 s runs, `cd46e3f` as pushed (its base is `06c9f55`). **How I got the refusals without running the whole PC out of commit:** (a first try at a 37 GB limit was stopped by my own system-memory guard at ~142 s, before any refusal.) on `main` here, ActivateRays alone grows the process by ~16 GB and is refused only when the system nears its limit, at ~44 GB of process commit after 69 s in the driver (numbers in #1598). That took other programs down with it once, so I ran the title in a Windows job object with a 33 GB commit limit for all its processes (`JOB_OBJECT_LIMIT_JOB_MEMORY`). The driver's allocations fail inside the title, it returns `0x8007000e` as at the system limit, and the rest of the machine keeps its headroom. The catch: the refusals come sooner (after 4–13 s in the driver), and some programs that would build with more headroom get refused here. **Run 1 under the cap, no `!` lines at the start:** six compute programs refused with `0x8007000e`, two of them marked: | record | DXIL | its compile | refused at | `!` line | |---|---|---|---|---| | `67e870153afb3a94` | 413,472 B | `ungated here` | 119.0 s, 12.2 s in the driver | no | | `95cc13288a27a96e` (ActivateRays) | 2,420,640 B | `ungated here` | 119.2 s, 12.5 s | no | | `68d630a8567ab575` | 333,764 B | `ungated here` | 131.2 s, 5.8 s | no | | `517e7bab67ece93f` | 1,021,324 B | `gated (waited 114983 ms)` | 131.8 s, 12.8 s | **`!6c3726c018616a2f`** | | `b6dd852172e5f719` | 1,011,788 B | `gated (waited 5288 ms)` | 181.1 s, 4.3 s | **`!7edd0762558da1f5`** | | `33743bd6d1e45443` | 1,040,856 B | `ungated here` | 199.7 s, 3.9 s | no | The two marks match the two gated builds (same thread and time as their `the driver gave up on a pipeline built ahead (shaders …): not built again` lines). The four `ungated here` ones are what your description leaves to be tried again. **Run 2, same cap, with those two lines:** - At start: `2 shader sets the driver gave up on in an earlier run are not built again (stand-ins; …)`. - Neither `517e7bab67ece93f` nor `b6dd852172e5f719` is compiled (no `driver compile start` for either). - ActivateRays is compiled again from 105.1 s and refused again after 11.1 s. This time its compile is logged `gated (waited 101125 ms)`, so it had its turn, and it is still not marked. - Six more builds ahead were refused under the cap and marked (8 `!` lines at the end). These are artefacts of the 33 GB limit: with more headroom some of them would build. Both runs ran the full 200 s, exit 0, no device removal. First `#101` at 105.2 / 103.7 s; presents stop 2–3 s after it in both (the four-queue wait of #1993, the same as `main`). **What this means on RDNA4, as far as I can tell:** - The mark works, and skipping the two sets in run 2 is visible. - ActivateRays is the build that takes this machine to its limit, and it falls in the cases you retry on purpose. On `main` without the cap (69 s in the driver) and in run 1 here, its compile is `ungated here` (a title thread's). In run 2 it is gated, but its compile starts 1.4 s after the first `#101`, as the world load binds it. Going by `build()`, a gated refusal isn't marked when the build isn't the preload's own or a title thread came to wait for it, and I'd guess the latter, though the log doesn't say which. So under this PR it comes back each run, as on `main`. Whether a refusal the title waited for should be remembered too is your call. - A `!` line stays until someone deletes it. On a machine that is short of commit for a moment (other programs open, as here under the cap), a build ahead that would succeed later is skipped in every run after. The log line says how to retry; it may be worth logging the free commit when the mark is written, so it's possible to tell a real "never fits" from a busy moment. **Not tested** - These refusals at the real system limit with this PR (only under the 33 GB job limit; `main` reached it without the cap in #1598's runs). - The PR's suite, the smoke pair (papasmurph0's covers that), `XCL_PSO_PRELOAD=0`, the RDNA2 iGPU. - The marked sets' stand-ins on screen: presents stop at the world load here either way. **AI use** - Claude Code (Claude Opus 5.5) built the PR, wrote the job-limited run script, ran the title, read the logs and drafted this comment. I checked it before posting.
bmjask commented 2026-11-25 21:22:11 +00:00 (Migrated from github.com)

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

Review: COMMENTED


No concrete source-level defect found. Marker parsing/preload behavior and retry-state replacement look sound; current Windows CI is green. Residual documented tradeoff: a transient long E_OUTOFMEMORY can suppress a shader set until user deletes its ! line. Consider logging available commit at mark time to support that manual recovery decision. I found no blocker.

<!-- greyfinch-sync:ivall/xcl:review:6065159278 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#pullrequestreview-6065159278). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T21:22:11Z. **Review:** COMMENTED --- No concrete source-level defect found. Marker parsing/preload behavior and retry-state replacement look sound; current Windows CI is green. Residual documented tradeoff: a transient long E_OUTOFMEMORY can suppress a shader set until user deletes its ! line. Consider logging available commit at mark time to support that manual recovery decision. I found no blocker.
DavidM1911 commented 2026-11-26 07:03:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:07:45Z.


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:7184119418 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7184119418). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T06:07:45Z. --- 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
Decodere commented 2026-11-27 14:46:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T14:46:27Z.


Independent desktop NVIDIA verification of PR #1665 at head cd46e3fc2bd9d298143d20dc5c49b209027621d0 (1 commit; exact parent & merge-base: 06c9f5505f63f10c5ec49ef932d75b2c28177324, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted tests & build (cd46e3fc)

Command Result
cargo test --release -p xcl --lib -- --nocapture a_skipped_key_is_read_from_the_file a_pipeline_the_driver_gave_up_on_is_not_built_again a_build_ahead_that_fails_otherwise_is_tried_again only_a_long_out_of_memory_in_its_turn_is_giving_up (3 consecutive runs) 4 passed; 0 failed; 0 ignored; 1222 filtered out × 3 (0.01s, 0.01s, 0.01s, 0 skipped)
cargo test --release -p xcl --lib -- --nocapture hle::d3d12x::pso_async:: (3 consecutive runs) 13 passed; 0 failed; 0 ignored; 1213 filtered out × 3 (0.61s, 0.61s, 0.60s, 0 skipped)
cargo build --release -p xcl Clean build (1m 49s, exit 0, 0 new warnings in PR-touched lines)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (06c9f5505f63f10c5ec49ef932d75b2c28177324, cached baseline on the same machine):

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

PR #1665 (cd46e3fc2bd9d298143d20dc5c49b209027621d0):

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

Limits of coverage

  • All 4 new unit tests (a_skipped_key_is_read_from_the_file, a_pipeline_the_driver_gave_up_on_is_not_built_again, a_build_ahead_that_fails_otherwise_is_tried_again, only_a_long_out_of_memory_in_its_turn_is_giving_up) and the full hle::d3d12x::pso_async:: suite (13/13, 0 skipped) passed 3/3, directly verifying !<key> skip persistence, driver_gave_up gating (E_OUTOFMEMORY after >= 1 s in a big-compile turn), and retry behavior for other failures.
  • No live driver E_OUTOFMEMORY PSO refusal occurred during the 60 s retail smoke on RTX 4060 (0 device removals, 0 crashes, steady 60 Hz), so the end-to-end driver-refusal skip-file write path was verified via the unit tests rather than a live driver OOM; single-run frame/commit delta vs. the cached parent reflects normal startup variance.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7221209906 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7221209906). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T14:46:27Z. --- Independent desktop NVIDIA verification of **PR #1665** at head `cd46e3fc2bd9d298143d20dc5c49b209027621d0` (`1` commit; exact parent & merge-base: `06c9f5505f63f10c5ec49ef932d75b2c28177324`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted tests & build (`cd46e3fc`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib -- --nocapture a_skipped_key_is_read_from_the_file a_pipeline_the_driver_gave_up_on_is_not_built_again a_build_ahead_that_fails_otherwise_is_tried_again only_a_long_out_of_memory_in_its_turn_is_giving_up` (3 consecutive runs) | `4 passed; 0 failed; 0 ignored; 1222 filtered out` × 3 (`0.01s`, `0.01s`, `0.01s`, `0` skipped) | | `cargo test --release -p xcl --lib -- --nocapture hle::d3d12x::pso_async::` (3 consecutive runs) | `13 passed; 0 failed; 0 ignored; 1213 filtered out` × 3 (`0.61s`, `0.61s`, `0.60s`, `0` skipped) | | `cargo build --release -p xcl` | Clean build (`1m 49s`, exit `0`, `0` new warnings in PR-touched lines) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`06c9f5505f63f10c5ec49ef932d75b2c28177324`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1588 (PresentX 1589) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14452 MB ``` PR #1665 (`cd46e3fc2bd9d298143d20dc5c49b209027621d0`): ``` xcl-smoke v1 commit: cd46e3fc2bd9d298143d20dc5c49b209027621d0 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1541 (PresentX 1541) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14432 MB ``` ### Limits of coverage - All `4` new unit tests (`a_skipped_key_is_read_from_the_file`, `a_pipeline_the_driver_gave_up_on_is_not_built_again`, `a_build_ahead_that_fails_otherwise_is_tried_again`, `only_a_long_out_of_memory_in_its_turn_is_giving_up`) and the full `hle::d3d12x::pso_async::` suite (`13/13`, `0` skipped) passed `3/3`, directly verifying `!<key>` skip persistence, `driver_gave_up` gating (`E_OUTOFMEMORY` after `>= 1 s` in a big-compile turn), and retry behavior for other failures. - No live driver `E_OUTOFMEMORY` PSO refusal occurred during the 60 s retail smoke on RTX 4060 (`0` device removals, `0` crashes, steady 60 Hz), so the end-to-end driver-refusal skip-file write path was verified via the unit tests rather than a live driver OOM; single-run frame/commit delta vs. the cached parent reflects normal startup variance. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
thehollowedone commented 2026-11-27 15:28:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T15:28:20Z.


At head cd46e3f, I found a same-launch gap in the refusal marker. submit_lazy checks !<key> when it creates a pending job, and the preload worker checks after taking one. If another job with that key is already pending when the first build records the marker, a direct bind can still run its closure on the title thread; a budgeted bind can send it to a normal worker without another marker check. That can repeat the driver build this PR intends to avoid.

I added a synthetic regression that submits a lazy job, marks its key, then binds it. On the unmodified head, it failed at the direct bind: the job ran and returned 0x4327 instead of the stand-in. The candidate below checks the marker when a worker claims the job and before a direct bind executes it, drops skipped closures, and completes their pending entries. It covers both direct and budgeted binds. With the candidate, the new test passed (1/0) and cargo test --offline --locked -j 4 -p xcl --lib hle::d3d12x::pso_async:: -- --test-threads=4 passed 14/0.

cargo build --offline --locked -j 4 --workspace passed. cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 --quiet recorded 1,269 passed, 1 failed, 46 ignored, with 25 GPU skip notices. The sole failure, console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (DXIL not compiled yet), reproduced with the same focused command on a separate, untouched checkout of this PR head. I did not run a live driver-refusal scenario or a paired smoke on this uncommitted candidate.

Candidate regression and fix
diff --git a/crates/xcl/src/hle/d3d12x/pso_async.rs b/crates/xcl/src/hle/d3d12x/pso_async.rs
index 46c1c565..61a403de 100644
--- a/crates/xcl/src/hle/d3d12x/pso_async.rs
+++ b/crates/xcl/src/hle/d3d12x/pso_async.rs
@@ -65,8 +65,14 @@ pub fn wanted_here() -> crate::gpu::recomp::dxc::Wanted {
 }
 
 /// A worker's build of `p` (`preload`: by one of the lowest-priority workers).
-fn build(p: &Arc<Pending>, job: Job, preload: bool) {
+/// Returns false when a refusal marked its shader set after this job was submitted.
+fn build(p: &Arc<Pending>, job: Job, preload: bool) -> bool {
     use windows_sys::Win32::System::Threading::{GetCurrentThread, GetCurrentThreadId, SetThreadPriority, THREAD_PRIORITY_LOWEST, THREAD_PRIORITY_NORMAL};
+    if used::is_skipped(p.key) {
+        drop(job);
+        complete(p, 0);
+        return false;
+    }
     BUILDING.with(|b| *b.borrow_mut() = Some(p.clone()));
     if preload {
         let mut d = p.demand.lock().unwrap();
@@ -92,6 +98,7 @@ fn build(p: &Arc<Pending>, job: Job, preload: bool) {
         }
     }
     BUILDING.with(|b| *b.borrow_mut() = None);
+    true
 }
 
 impl Pending {
@@ -291,7 +298,7 @@ fn enqueue(p: Arc<Pending>) {
         // (None: a bind took it and builds it itself)
         let job = p.job.lock().unwrap().take();
         if let Some(job) = job {
-            build(&p, job, false);
+            let _ = build(&p, job, false);
         }
     }));
 }
@@ -564,16 +571,11 @@ fn preload() -> Option<&'static Preload> {
                     // (None: a bind took it and builds it itself)
                     let job = p.job.lock().unwrap().take();
                     if let Some(job) = job {
-                        // (another pipeline of the same shaders the driver gave up on meanwhile)
-                        if used::is_skipped(p.key) {
-                            drop(job);
-                            complete(&p, 0);
-                            continue;
-                        }
-                        build(&p, job, true);
-                        let n = DONE.fetch_add(1, Ordering::Relaxed) + 1;
-                        if n.is_power_of_two() {
-                            crate::xlog_info!("D3D12.X: {n} pipelines built ahead of their first use");
+                        if build(&p, job, true) {
+                            let n = DONE.fetch_add(1, Ordering::Relaxed) + 1;
+                            if n.is_power_of_two() {
+                                crate::xlog_info!("D3D12.X: {n} pipelines built ahead of their first use");
+                            }
                         }
                     }
                 }
@@ -807,6 +809,27 @@ mod used_tests {
         released(b);
     }
 
+    #[test]
+    fn a_pending_pipeline_is_not_built_after_its_key_is_skipped() {
+        for (i, budget) in [None, Some(std::time::Duration::from_secs(1))].into_iter().enumerate() {
+            let standin = 0x7E57_9010usize + i;
+            let key = 0x5EED_0020u64 + i as u64;
+            let ran = Arc::new(std::sync::atomic::AtomicBool::new(false));
+            let r = ran.clone();
+            submit_lazy(standin, true, Box::new(move || {
+                r.store(true, Ordering::Release);
+                0x4327
+            }), key);
+            assert!(is_pending(standin));
+            assert!(used::skip(key));
+            assert_eq!(resolve_wait_for(standin, budget), standin);
+            wait_built(standin);
+            assert!(!is_pending(standin), "skipped job did not complete");
+            assert!(!ran.load(Ordering::Acquire), "a claimed job reached the compiler");
+            released(standin);
+        }
+    }
+
     /// A build ahead that fails otherwise (a removed device fails every build, or a retry after
     /// the driver gave up fails for another reason) is tried again.
     #[test]
@@ -984,7 +1007,12 @@ fn resolve_wait_for(pso: usize, budget: Option<std::time::Duration>) -> usize {
     }
     let job = p.job.lock().unwrap().take();
     if let Some(job) = job {
-        complete(&p, job());
+        if used::is_skipped(p.key) {
+            drop(job);
+            complete(&p, 0);
+        } else {
+            complete(&p, job());
+        }
     }
     p.want();
     let mut done = p.done.lock().unwrap();

AI use: Codex (GPT-6.2 Sol) wrote and ran the regression and candidate; Codex (GPT-6.2 Astra) independently traced the affected paths and reviewed the candidate.

<!-- greyfinch-sync:ivall/xcl:comment:7222098062 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7222098062). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-27T15:28:20Z. --- At [head `cd46e3f`](https://github.com/xcl-dev/xcl/commit/cd46e3fc2bd9d298143d20dc5c49b209027621d0), I found a same-launch gap in the refusal marker. `submit_lazy` checks `!<key>` when it creates a pending job, and the preload worker checks after taking one. If another job with that key is already pending when the first build records the marker, [a direct bind](https://github.com/xcl-dev/xcl/blob/cd46e3fc2bd9d298143d20dc5c49b209027621d0/crates/xcl/src/hle/d3d12x/pso_async.rs#L980-L989) can still run its closure on the title thread; [a budgeted bind](https://github.com/xcl-dev/xcl/blob/cd46e3fc2bd9d298143d20dc5c49b209027621d0/crates/xcl/src/hle/d3d12x/pso_async.rs#L284-L296) can send it to a normal worker without another marker check. That can repeat the driver build this PR intends to avoid. I added a synthetic regression that submits a lazy job, marks its key, then binds it. On the unmodified head, it failed at the direct bind: the job ran and returned `0x4327` instead of the stand-in. The candidate below checks the marker when a worker claims the job and before a direct bind executes it, drops skipped closures, and completes their pending entries. It covers both direct and budgeted binds. With the candidate, the new test passed (1/0) and `cargo test --offline --locked -j 4 -p xcl --lib hle::d3d12x::pso_async:: -- --test-threads=4` passed 14/0. `cargo build --offline --locked -j 4 --workspace` passed. `cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 --quiet` recorded 1,269 passed, 1 failed, 46 ignored, with 25 GPU skip notices. The sole failure, `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` (`DXIL not compiled yet`), reproduced with the same focused command on a separate, untouched checkout of this PR head. I did not run a live driver-refusal scenario or a paired smoke on this uncommitted candidate. <details><summary>Candidate regression and fix</summary> ```diff diff --git a/crates/xcl/src/hle/d3d12x/pso_async.rs b/crates/xcl/src/hle/d3d12x/pso_async.rs index 46c1c565..61a403de 100644 --- a/crates/xcl/src/hle/d3d12x/pso_async.rs +++ b/crates/xcl/src/hle/d3d12x/pso_async.rs @@ -65,8 +65,14 @@ pub fn wanted_here() -> crate::gpu::recomp::dxc::Wanted { } /// A worker's build of `p` (`preload`: by one of the lowest-priority workers). -fn build(p: &Arc<Pending>, job: Job, preload: bool) { +/// Returns false when a refusal marked its shader set after this job was submitted. +fn build(p: &Arc<Pending>, job: Job, preload: bool) -> bool { use windows_sys::Win32::System::Threading::{GetCurrentThread, GetCurrentThreadId, SetThreadPriority, THREAD_PRIORITY_LOWEST, THREAD_PRIORITY_NORMAL}; + if used::is_skipped(p.key) { + drop(job); + complete(p, 0); + return false; + } BUILDING.with(|b| *b.borrow_mut() = Some(p.clone())); if preload { let mut d = p.demand.lock().unwrap(); @@ -92,6 +98,7 @@ fn build(p: &Arc<Pending>, job: Job, preload: bool) { } } BUILDING.with(|b| *b.borrow_mut() = None); + true } impl Pending { @@ -291,7 +298,7 @@ fn enqueue(p: Arc<Pending>) { // (None: a bind took it and builds it itself) let job = p.job.lock().unwrap().take(); if let Some(job) = job { - build(&p, job, false); + let _ = build(&p, job, false); } })); } @@ -564,16 +571,11 @@ fn preload() -> Option<&'static Preload> { // (None: a bind took it and builds it itself) let job = p.job.lock().unwrap().take(); if let Some(job) = job { - // (another pipeline of the same shaders the driver gave up on meanwhile) - if used::is_skipped(p.key) { - drop(job); - complete(&p, 0); - continue; - } - build(&p, job, true); - let n = DONE.fetch_add(1, Ordering::Relaxed) + 1; - if n.is_power_of_two() { - crate::xlog_info!("D3D12.X: {n} pipelines built ahead of their first use"); + if build(&p, job, true) { + let n = DONE.fetch_add(1, Ordering::Relaxed) + 1; + if n.is_power_of_two() { + crate::xlog_info!("D3D12.X: {n} pipelines built ahead of their first use"); + } } } } @@ -807,6 +809,27 @@ mod used_tests { released(b); } + #[test] + fn a_pending_pipeline_is_not_built_after_its_key_is_skipped() { + for (i, budget) in [None, Some(std::time::Duration::from_secs(1))].into_iter().enumerate() { + let standin = 0x7E57_9010usize + i; + let key = 0x5EED_0020u64 + i as u64; + let ran = Arc::new(std::sync::atomic::AtomicBool::new(false)); + let r = ran.clone(); + submit_lazy(standin, true, Box::new(move || { + r.store(true, Ordering::Release); + 0x4327 + }), key); + assert!(is_pending(standin)); + assert!(used::skip(key)); + assert_eq!(resolve_wait_for(standin, budget), standin); + wait_built(standin); + assert!(!is_pending(standin), "skipped job did not complete"); + assert!(!ran.load(Ordering::Acquire), "a claimed job reached the compiler"); + released(standin); + } + } + /// A build ahead that fails otherwise (a removed device fails every build, or a retry after /// the driver gave up fails for another reason) is tried again. #[test] @@ -984,7 +1007,12 @@ fn resolve_wait_for(pso: usize, budget: Option<std::time::Duration>) -> usize { } let job = p.job.lock().unwrap().take(); if let Some(job) = job { - complete(&p, job()); + if used::is_skipped(p.key) { + drop(job); + complete(&p, 0); + } else { + complete(&p, job()); + } } p.want(); let mut done = p.done.lock().unwrap(); ``` </details> AI use: Codex (GPT-6.2 Sol) wrote and ran the regression and candidate; Codex (GPT-6.2 Astra) independently traced the affected paths and reviewed the candidate.
ClosetPie107 commented 2026-11-27 16:12:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-27T16:12:30Z.


Tested on AMD / Linux: cd46e3fc (RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV; Ryzen 5 9600X, 32 GB; CachyOS; Proton Experimental experimental-11.0-20261112 with vkd3d-proton master ec207194 plus a local patch dropping the lpVtbl checks of command allocators and lists; DXC 1.9.2609.5; Rust 1.96.0, x86_64-pc-windows-gnu debug build, tests run under Wine)

The head as it is (not merged onto current main), with its base 06c9f550 as the baseline.

Tests (XCL_REQUIRE_GPU=wave64)

  • cargo test -p xcl --lib -- hle::d3d12x::pso_async:: --test-threads=1: 13 passed, 0 failed, 0 ignored.
  • cargo test -p xcl --lib -- only_a_long_out_of_memory_in_its_turn_is_giving_up --test-threads=1: 1 passed, 0 failed, 0 ignored.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 with --skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole (here the first loses the RADV device, the other two run out of memory under Wine): lib 1184 passed, 16 failed, 26 ignored; base 06c9f550 (this PR's base) the same session: lib 1180 passed, 16 failed, 26 ignored. The failures are the same set as on the base. The other binaries fail the same 3 tests as on the base (e2e, pls_quota, predication_e2e).
  • d3d12_resource_and_sync: 3 passed, 0 failed on this head; on the base its fence and queue test ended the process (exit 1), which it does in most trees here, main included.

Not tested

  • Native Windows, NVIDIA / Intel
  • A retail title. On this card the case does not come up: in 40 earlier retail runs here (release builds that include #1918's log line, 37 of them with XCL_PSO_PRELOAD=1) there is no the driver refused the compute PSO line and no E_OUTOFMEMORY, so a run would not reach the new path on RDNA4 / RADV

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the builds and tests on my machine and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7222985334 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7222985334). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-27T16:12:30Z. --- **Tested on AMD / Linux: `cd46e3fc`** (RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV; Ryzen 5 9600X, 32 GB; CachyOS; Proton Experimental `experimental-11.0-20261112` with vkd3d-proton master `ec207194` plus a local patch dropping the `lpVtbl` checks of command allocators and lists; DXC 1.9.2609.5; Rust 1.96.0, `x86_64-pc-windows-gnu` debug build, tests run under Wine) The head as it is (not merged onto current `main`), with its base `06c9f550` as the baseline. **Tests** (`XCL_REQUIRE_GPU=wave64`) - `cargo test -p xcl --lib -- hle::d3d12x::pso_async:: --test-threads=1`: **13 passed, 0 failed**, 0 ignored. - `cargo test -p xcl --lib -- only_a_long_out_of_memory_in_its_turn_is_giving_up --test-threads=1`: **1 passed, 0 failed**, 0 ignored. - `cargo test --workspace --no-fail-fast -- --test-threads=4` with `--skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole` (here the first loses the RADV device, the other two run out of memory under Wine): lib 1184 passed, 16 failed, 26 ignored; base `06c9f550` (this PR's base) the same session: lib 1180 passed, 16 failed, 26 ignored. The failures are the same set as on the base. The other binaries fail the same 3 tests as on the base (`e2e`, `pls_quota`, `predication_e2e`). - `d3d12_resource_and_sync`: 3 passed, 0 failed on this head; on the base its fence and queue test ended the process (exit 1), which it does in most trees here, `main` included. **Not tested** - Native Windows, NVIDIA / Intel - A retail title. On this card the case does not come up: in 40 earlier retail runs here (release builds that include #1918's log line, 37 of them with `XCL_PSO_PRELOAD=1`) there is no `the driver refused the compute PSO` line and no `E_OUTOFMEMORY`, so a run would not reach the new path on RDNA4 / RADV **AI use** - Claude Code (Claude Opus 5.5) wrote the test scripts, ran the builds and tests on my machine and wrote this report.
throny commented 2026-11-27 23:28:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:28:11Z.


merge-check claim
head: cd46e3fc2b

<!-- greyfinch-sync:ivall/xcl:comment:7230164743 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7230164743). Originally posted by [throny](https://github.com/throny) on 2026-11-27T23:28:11Z. --- merge-check claim head: cd46e3fc2bd9d298143d20dc5c49b209027621d0
throny commented 2026-11-27 23:41:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:41:20Z.


merge-check
base: 2c717a04
head: cd46e3fc2b
merge: clean
build: cargo build --workspace -> FAILED (E0308)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> not run (the merge result does not build); base alone: 1466 passed, 0 failed, 47 ignored (26 SKIPPED lines)
review: blocking: merged onto current main it does not compile, although GitHub shows no conflict and git merges it cleanly. The PR makes driver_compile_identified return three values; main has since gained a caller in the mesh path (real.rs, 'let (hr, took) = driver_compile_identified(label, mesh_bytes, ...)') that takes two: error E0308 at real.rs:6138 of the merge result. Also to decide before merging, from reading the change: a 'gave up' mark is a line in used-pipelines.txt and stays for ever, across driver and XCL updates (the key is per shader set), and it is written after an out-of-memory result of a build-ahead compile, so a shortage caused by other programs at that moment makes the skip permanent; a draw with such a pipeline keeps its stand-in (a graphics draw draws nothing). Open from the thread: within one run a direct or budgeted bind can still build a marked key; the largest program is never marked because the title waits for it; log the free commit when a mark is written.
performance: no frame cost; saves memory and time where the driver runs out of memory (reasoned).
verdict: not yet: rebase and update the mesh caller; and an expiry or a driver-identity part for the mark (or a note why permanent is right). I will rerun the suite on the new head.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7230332414 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7230332414). Originally posted by [throny](https://github.com/throny) on 2026-11-27T23:41:20Z. --- merge-check base: 2c717a04 head: cd46e3fc2bd9d298143d20dc5c49b209027621d0 merge: clean build: cargo build --workspace -> FAILED (E0308) tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> not run (the merge result does not build); base alone: 1466 passed, 0 failed, 47 ignored (26 SKIPPED lines) review: blocking: merged onto current main it does not compile, although GitHub shows no conflict and git merges it cleanly. The PR makes driver_compile_identified return three values; main has since gained a caller in the mesh path (real.rs, 'let (hr, took) = driver_compile_identified(label, mesh_bytes, ...)') that takes two: error E0308 at real.rs:6138 of the merge result. Also to decide before merging, from reading the change: a 'gave up' mark is a line in used-pipelines.txt and stays for ever, across driver and XCL updates (the key is per shader set), and it is written after an out-of-memory result of a build-ahead compile, so a shortage caused by other programs at that moment makes the skip permanent; a draw with such a pipeline keeps its stand-in (a graphics draw draws nothing). Open from the thread: within one run a direct or budgeted bind can still build a marked key; the largest program is never marked because the title waits for it; log the free commit when a mark is written. performance: no frame cost; saves memory and time where the driver runs out of memory (reasoned). verdict: not yet: rebase and update the mesh caller; and an expiry or a driver-identity part for the mark (or a note why permanent is right). I will rerun the suite on the new head. hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Foniass commented 2026-12-01 06:26:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:26:55Z.


Triage (#1607) – head cd46e3f

No open or merged PR makes the same change. #2527 (also #1035) deals with the same runaway driver compiles in a different way: it refuses compute programs from a hand-written XCL_REFUSE_CS list. This PR does it automatically: a build ahead that ends in E_OUTOFMEMORY after at least 1 s in its own big-compile turn is written to used-pipelines.txt as a !<key> line and gets the stand-in from then on.
No correctness problems found in the diff. Two things are design choices for the maintainer. The mark lasts across runs until someone deletes the ! line by hand, so a single run that was short of memory disables that pipeline for every later run. Only compute builds set the flag; graphics builds never mark.
The PR conflicts with main: driver_compile_identified now takes (record: Option<u64>, cached: bool), and pso_async.rs has grown a lot.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7302882830 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1665#issuecomment-7302882830). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:26:55Z. --- **Triage (#1607)** – head cd46e3f No open or merged PR makes the same change. #2527 (also #1035) deals with the same runaway driver compiles in a different way: it refuses compute programs from a hand-written `XCL_REFUSE_CS` list. This PR does it automatically: a build ahead that ends in E_OUTOFMEMORY after at least 1 s in its own big-compile turn is written to used-pipelines.txt as a `!<key>` line and gets the stand-in from then on. No correctness problems found in the diff. Two things are design choices for the maintainer. The mark lasts across runs until someone deletes the `!` line by hand, so a single run that was short of memory disables that pipeline for every later run. Only compute builds set the flag; graphics builds never mark. The PR conflicts with main: driver_compile_identified now takes `(record: Option<u64>, cached: bool)`, and pso_async.rs has grown a lot. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1665:upstream-pr/1665'
git switch 'upstream-pr/1665'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1665'
git switch 'upstream-pr/1665'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1665'
git switch 'upstream-pr/1665'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1665'
git switch 'main'
git merge --squash 'upstream-pr/1665'
git switch 'main'
git merge --ff-only 'upstream-pr/1665'
git switch 'main'
git merge 'upstream-pr/1665'
git push origin 'main'
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!1655
No description provided.