xcl run: shader preparation in worker processes, only what earlier runs used; upstream main; sampler fix #2614

Merged
theaustinayers merged 178 commits from upstream-pr/2624 into nvidia-dev 2026-11-26 06:10:44 +00:00
theaustinayers commented 2026-11-26 02:56:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by theaustinayers on 2026-11-26T02:56:41Z.


Brings nvidia-dev up to upstream main (through #2371) and adds the faster shader preparation before a title starts.

What is in it

  • Upstream main merged in (b49be183, includes #2338, #174, #2371), with the fork's fixes kept.
  • Upstream #2555 (draft): shaders are prepared in the game window before the title runs.
  • Preparation in worker processes (crates/xcl/src/shaders.rs): the stages are translated in the host; a pack's compute pipelines are built by worker processes, each on its own slice of the records. The driver builds about two pipelines at a time for one process, so one process stood for minutes on each stretch of large compute programs. Workers: logical processors less four, 3 GB of free commit each (XCL_PREPARE_WORKERS; 1 = one process as before). A worker that fails is logged and the title starts; a worker ends when the host does.
  • Only what earlier runs used, or everything (shaders.rs, hle/d3d12x/pso_async.rs): a run keeps the shaders of the pipelines it uses in used-shaders.txt beside the DXIL cache. With that list the preparation translates only those records, and the pipeline pass builds only the compute pipelines an earlier run used. XCL_PREPARE_ALL=1 prepares every record. XCL_PREPARE=0 skips preparation: the title builds what it uses as it goes.
  • Progress (hle/d3d12x/present/preparation.rs): each pass has its own heading and count, a worker reports every record, the host logs progress every 5 s.
  • Sampler fix (gpu/recomp/mod.rs): an S# set before a branch or a loop is recognised as a static sampler after it. Before, those samples went through sampler-heap entry 0 (point, wrap, mip 0): banded gradients, stepped glows. XCL_ZERO_SAMPLER_LINEAR=1 is a diagnostic for that entry.
  • Upstream #2377 (one-wave groups meet at a group barrier; XCL_WAVE64_SPIN=1 restores the counters).
  • Taken out again after runs on a title: #2385, #2437, #2547 (suspects for blurry texture patches, exploded geometry and a stall; each still to be confirmed).

Tested

  • RTX 5090 (driver 621.14), Ryzen 9 9950X3D, Windows 11 26300, release build.
  • Software adapter, cargo test --release -p xcl --lib -- --test-threads=4 at fbfac4d0: 1538 passed, 0 failed, 25 ignored; 59 tests that open the hardware GPU not run. The four tests added after it (the_shaders_of_a_used_set_are_kept_for_the_next_run, the_key_of_one_shader_is_the_key_of_a_set_of_it, preparation_workers_leave_two_processors_and_follow_the_commit_left, static_sampler_set_before_a_branch_is_a_constant_after_it) pass at the head.
  • Retail title, preparation with 28 workers: a cold pipeline pass in 929 s, 0 of 28 workers failed; with warm caches the whole preparation in 43 s (translation 14 s, pipelines 29 s). One process before: 84 % of one pass after several minutes, then about two pipelines a minute.
  • Retail title, 16 minutes in the world without a device removal on the build before the sampler fix.

Not tested

  • The full suite at the head commit, the hardware-GPU tests and the integration tests.
  • The sampler fix and the used-shader list on a title: the first run with them is in progress.
  • Any GPU other than the RTX 5090.

AI use

  • Claude Code, Claude Fable 5.2: wrote the code, the tests and this description; ran the tests and the title runs.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5503154689 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624). Originally posted by [theaustinayers](https://github.com/theaustinayers) on 2026-11-26T02:56:41Z. --- Brings `nvidia-dev` up to upstream main (through #2371) and adds the faster shader preparation before a title starts. **What is in it** - Upstream main merged in (`b49be183`, includes #2338, #174, #2371), with the fork's fixes kept. - Upstream #2555 (draft): shaders are prepared in the game window before the title runs. - **Preparation in worker processes** (`crates/xcl/src/shaders.rs`): the stages are translated in the host; a pack's compute pipelines are built by worker processes, each on its own slice of the records. The driver builds about two pipelines at a time for one process, so one process stood for minutes on each stretch of large compute programs. Workers: logical processors less four, 3 GB of free commit each (`XCL_PREPARE_WORKERS`; `1` = one process as before). A worker that fails is logged and the title starts; a worker ends when the host does. - **Only what earlier runs used, or everything** (`shaders.rs`, `hle/d3d12x/pso_async.rs`): a run keeps the shaders of the pipelines it uses in `used-shaders.txt` beside the DXIL cache. With that list the preparation translates only those records, and the pipeline pass builds only the compute pipelines an earlier run used. `XCL_PREPARE_ALL=1` prepares every record. `XCL_PREPARE=0` skips preparation: the title builds what it uses as it goes. - **Progress** (`hle/d3d12x/present/preparation.rs`): each pass has its own heading and count, a worker reports every record, the host logs progress every 5 s. - **Sampler fix** (`gpu/recomp/mod.rs`): an S# set before a branch or a loop is recognised as a static sampler after it. Before, those samples went through sampler-heap entry 0 (point, wrap, mip 0): banded gradients, stepped glows. `XCL_ZERO_SAMPLER_LINEAR=1` is a diagnostic for that entry. - Upstream #2377 (one-wave groups meet at a group barrier; `XCL_WAVE64_SPIN=1` restores the counters). - Taken out again after runs on a title: #2385, #2437, #2547 (suspects for blurry texture patches, exploded geometry and a stall; each still to be confirmed). **Tested** - RTX 5090 (driver 621.14), Ryzen 9 9950X3D, Windows 11 26300, release build. - Software adapter, `cargo test --release -p xcl --lib -- --test-threads=4` at `fbfac4d0`: 1538 passed, 0 failed, 25 ignored; 59 tests that open the hardware GPU not run. The four tests added after it (`the_shaders_of_a_used_set_are_kept_for_the_next_run`, `the_key_of_one_shader_is_the_key_of_a_set_of_it`, `preparation_workers_leave_two_processors_and_follow_the_commit_left`, `static_sampler_set_before_a_branch_is_a_constant_after_it`) pass at the head. - Retail title, preparation with 28 workers: a cold pipeline pass in 929 s, 0 of 28 workers failed; with warm caches the whole preparation in 43 s (translation 14 s, pipelines 29 s). One process before: 84 % of one pass after several minutes, then about two pipelines a minute. - Retail title, 16 minutes in the world without a device removal on the build before the sampler fix. **Not tested** - The full suite at the head commit, the hardware-GPU tests and the integration tests. - The sampler fix and the used-shader list on a title: the first run with them is in progress. - Any GPU other than the RTX 5090. **AI use** - Claude Code, Claude Fable 5.2: wrote the code, the tests and this description; ran the tests and the title runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
GodlyBDS commented 2026-11-26 04:07:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by GodlyBDS on 2026-11-26T03:29:37Z.


RTX 3090 Ti / 621.40 / Windows 10 / 32 GiB follow-up on e877812e. I used two local startup compatibility changes already tested on the older NVIDIA branch (Agility host-path scope and the XG extra argument), and the same per-executable 1 GiB shader heap reserve. The release build and six focused startup tests passed. This arm uses on-demand compilation (XCL_PREPARE=0, background PSO preload off) and starts from 8,426 prior native entries. The translated cache is regenerated so that the refreshed shader paths use their current outputs.

  • A separate earlier build with the 32 MiB two-pass record allocation path reached 3,737 MiB of tracked mesh buffer widths, 2,185 MiB waiting for allocator reset. It eventually stopped on low physical RAM. In the new run the highest logged mesh total through 630 s was 1,459 MiB, with 367 MiB waiting for reset, and zero refusals at the 4,096 MiB diagnostic mesh budget. These are different builds and rendering progress points, so the figures are allocation observations rather than a paired benchmark.
  • This run passed the device-removal point of the older NVIDIA branch, without a matching device removal or Windows driver reset through the sample. The transition went black after the loading artwork. At 630 s the scheduler still reported newly completed work. I left it running. Visible 3D remains unverified here. I have not tested this PR's worker-process preparation path in this arm.

The independent timing of PSO worker gate waits is in #2628. AI use: OpenAI Codex (GPT-6) ran the comparison and drafted the report.

Long-run update. One recording thread completed 37 large, cache-missing compute PSO builds in sequence between 773.010 and 1,443.620 s. Their logged driver durations total 670.124 s of that 670.610 s interval. The runtime stack samples caught the thread in nvgpucomp64.dll. There were no Presents in that interval and the run remained active. The verified seed held 8,426 native entries and the live cache had 10,565 files at this sample. The foreground sequence is separate from the worker-gate pressure described on #2628. This supports warming the demanded native PSOs on this GPU. It does not show that precompilation resolves the full world transition.

<!-- greyfinch-sync:ivall/xcl:comment:7181766840 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7181766840). Originally posted by [GodlyBDS](https://github.com/GodlyBDS) on 2026-11-26T03:29:37Z. --- RTX 3090 Ti / 621.40 / Windows 10 / 32 GiB follow-up on `e877812e`. I used two local startup compatibility changes already tested on the older NVIDIA branch (Agility host-path scope and the XG extra argument), and the same per-executable 1 GiB shader heap reserve. The release build and six focused startup tests passed. This arm uses on-demand compilation (`XCL_PREPARE=0`, background PSO preload off) and starts from 8,426 prior native entries. The translated cache is regenerated so that the refreshed shader paths use their current outputs. - A separate earlier build with the 32 MiB two-pass record allocation path reached **3,737 MiB** of tracked mesh buffer widths, **2,185 MiB** waiting for allocator reset. It eventually stopped on low physical RAM. In the new run the highest logged mesh total through 630 s was **1,459 MiB**, with **367 MiB** waiting for reset, and **zero refusals** at the 4,096 MiB diagnostic mesh budget. These are different builds and rendering progress points, so the figures are allocation observations rather than a paired benchmark. - This run passed the device-removal point of the older NVIDIA branch, without a matching device removal or Windows driver reset through the sample. The transition went black after the loading artwork. At 630 s the scheduler still reported newly completed work. I left it running. Visible 3D remains unverified here. I have not tested this PR's worker-process preparation path in this arm. The independent timing of PSO worker gate waits is in [#2628](https://github.com/xcl-dev/xcl/pull/2628#issuecomment-7181713792). AI use: OpenAI Codex (GPT-6) ran the comparison and drafted the report. **Long-run update.** One recording thread completed 37 large, cache-missing compute PSO builds in sequence between 773.010 and 1,443.620 s. Their logged driver durations total **670.124 s of that 670.610 s interval**. The runtime stack samples caught the thread in `nvgpucomp64.dll`. There were no Presents in that interval and the run remained active. The verified seed held 8,426 native entries and the live cache had 10,565 files at this sample. The foreground sequence is separate from the worker-gate pressure described on #2628. This supports warming the demanded native PSOs on this GPU. It does not show that precompilation resolves the full world transition.
pickles976 commented 2026-11-26 04:07:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-26T04:02:09Z.


Blocker for 16 GiB / capped Wine hosts (source-verified at exact head 82e4a9bbf3be583418b9df7825dd1430fd8b06d6): the default worker budget has a byte/MB mismatch.

crates/xcl/src/host.rs:13-22 documents and returns system_commit() total/limit in bytes (K32GetPerformanceInfo × PageSize). crates/xcl/src/shaders.rs:1683-1694 forwards limit.saturating_sub(used) unchanged to workers_for(cores, free_mb), which divides by 3072 assuming its input is MiB. On this laptop nproc=16; for an illustrative 6 GiB free commit, the intended three-GiB-per-worker rule is 2 workers, but the head's expression selects 12 (all 16-4 allowed CPU slots). Under the local 9 GiB Wine cgroup and 16 GiB physical RAM, this can trigger the external 2 GiB MemAvailable guard or an OOM before the title starts. XCL_PREPARE_WORKERS=1 avoids this risky default for local trials, not a shipping fix. Please make the argument explicitly bytes and divide by 3 * 1024 * 1024 * 1024 (or convert bytes to MiB before calling), add a regression with 6 GiB in bytes, and respect a smaller applicable process/cgroup memory limit if the application is launched within one; global commit alone does not enforce a 9 GiB scope cap.

I attempted the focused Windows-MSVC Wine test preparation_workers_leave_two_processors_and_follow_the_commit_left, but the head does not reach the test on this build setup: transitive windows-future 0.3.2 fails compilation against windows-core 0.62.2 / windows-threading (IMarshal, marshaler, submit missing), exit 101. Local log .compat-xcl/logs/verify-pr2624-wine-worker-budget.log. The existing synthetic workers_for cases pass fake numbers labeled MB and would not catch the bytes passed from the real caller. No worker processes or retail title were launched; the source-level unit mismatch is independent of the dependency build failure. Machine: RTX 4060 Laptop 8 GiB, Wine 11.0, 16 GiB host RAM.

<!-- greyfinch-sync:ivall/xcl:comment:7182236787 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7182236787). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-26T04:02:09Z. --- **Blocker for 16 GiB / capped Wine hosts (source-verified at exact head `82e4a9bbf3be583418b9df7825dd1430fd8b06d6`): the default worker budget has a byte/MB mismatch.** `crates/xcl/src/host.rs:13-22` documents and returns `system_commit()` total/limit in **bytes** (`K32GetPerformanceInfo` × PageSize). `crates/xcl/src/shaders.rs:1683-1694` forwards `limit.saturating_sub(used)` unchanged to `workers_for(cores, free_mb)`, which divides by **3072** assuming its input is **MiB**. On this laptop `nproc=16`; for an illustrative **6 GiB free commit**, the intended three-GiB-per-worker rule is **2 workers**, but the head's expression selects **12** (all 16-4 allowed CPU slots). Under the local 9 GiB Wine cgroup and 16 GiB physical RAM, this can trigger the external 2 GiB MemAvailable guard or an OOM before the title starts. `XCL_PREPARE_WORKERS=1` avoids this risky default for local trials, not a shipping fix. Please make the argument explicitly bytes and divide by `3 * 1024 * 1024 * 1024` (or convert bytes to MiB before calling), add a regression with 6 GiB **in bytes**, and respect a smaller applicable process/cgroup memory limit if the application is launched within one; global commit alone does not enforce a 9 GiB scope cap. I attempted the focused Windows-MSVC Wine test `preparation_workers_leave_two_processors_and_follow_the_commit_left`, but the head **does not reach the test on this build setup**: transitive `windows-future 0.3.2` fails compilation against `windows-core 0.62.2` / `windows-threading` (`IMarshal`, `marshaler`, `submit` missing), exit 101. Local log `.compat-xcl/logs/verify-pr2624-wine-worker-budget.log`. The existing synthetic `workers_for` cases pass fake numbers labeled MB and would not catch the bytes passed from the real caller. No worker processes or retail title were launched; the source-level unit mismatch is independent of the dependency build failure. Machine: RTX 4060 **Laptop** 8 GiB, Wine 11.0, 16 GiB host RAM.
luckyteagirl commented 2026-11-26 04:50:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T04:50:56Z.

Review: COMMENTED


With XCL_PREPARE_WORKERS=2, XCL_ADAPTER unset, and a title config such as d3d12_adapter = "1" on a two-GPU host, the parent captures progress.adapter but this child Command does not pass it on. Each worker enters the CLI shaders --precompile path with startup=None, so Pipelines::for_adapter("auto") selects the default adapter; the title runtime still selects adapter 1. That means the workers can warm driver PSOs for the wrong device, and matching-DXIL cache entries can later be rejected and rebuilt on the title's adapter. Could the spawn pass the resolved adapter to children (for example via XCL_ADAPTER only when no explicit environment override exists) and test the config-only secondary-adapter case? This is source review; I did not run a two-GPU preparation test, and this point concerns the worker pipeline path rather than all translation-only preparation.

<!-- greyfinch-sync:ivall/xcl:review:6068712499 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#pullrequestreview-6068712499). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T04:50:56Z. **Review:** COMMENTED --- With `XCL_PREPARE_WORKERS=2`, `XCL_ADAPTER` unset, and a title config such as `d3d12_adapter = "1"` on a two-GPU host, the parent captures `progress.adapter` but this child `Command` does not pass it on. Each worker enters the CLI `shaders --precompile` path with `startup=None`, so `Pipelines::for_adapter("auto")` selects the default adapter; the title runtime still selects adapter 1. That means the workers can warm driver PSOs for the wrong device, and matching-DXIL cache entries can later be rejected and rebuilt on the title's adapter. Could the spawn pass the resolved adapter to children (for example via `XCL_ADAPTER` only when no explicit environment override exists) and test the config-only secondary-adapter case? This is source review; I did not run a two-GPU preparation test, and this point concerns the worker pipeline path rather than all translation-only preparation.
LocranKing commented 2026-11-26 06:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by LocranKing on 2026-11-26T05:13:08Z.


Independent NVIDIA test report on exact head 82e4a9bbf3be583418b9df7825dd1430fd8b06d6 (clean detached checkout, no local changes), compared against nvidia-dev (c044dc6d).

Tested

  • Hardware: NVIDIA GeForce RTX 3060 Ti 8 GB (Ampere, wave32, driver 32.0.16.2140 / 621.40), AMD Ryzen 5 5500 (6c/12t), 32 GB RAM, Windows 11 Home (build 26300), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100.0.
  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4 (debug):
    • nvidia-dev (c044dc6d): 1560 passed, 6 failed, 47 ignored (xcl --lib: 1490 passed, 2 failed, 27 ignored), 28 SKIPPED.
    • #2624 (82e4a9bb): 1721 passed, 6 failed, 48 ignored (xcl --lib: 1594 passed, 2 failed, 28 ignored), 28 SKIPPED.
    • 0 new failures vs nvidia-dev (+161 passing tests). All 6 failures match nvidia-dev:
      • hle::d3d12x::texture_upload::tests::{gpu_parts_of_a_texture_go_up_and_the_rest_stays, pieces_hold_the_texels_of_their_levels} (texture_upload.rs:990:17: attempt to multiply with overflow in debug)
      • d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly (expected AS-slot refusal in translation_errors: ["MS: no NGG hardware variant"])
      • gpu_compute_e2e::async_compute_pso_registers_real_pso_and_not_standin
      • gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (both test runs fail with disabled:)
    • 28 SKIPPED GPU tests on this adapter: 21 wave64-only (no wave64), 3 wave32 per-lane f16/f32 semantics, 1 no heap windows, 1 no heap windows (opt-in: XCL_HEAP_WINDOWS=1), 1 no D3D12 debug layer (0x887A002D), 1 cannot disable driver cache without Developer Mode (0x887A002D).
  • Shader preparation check (with used-shaders.txt = 11 shaders from the prior XCL_PREPARE=0 run):
    • Launched 8 worker processes on the 12-thread CPU (0 of 8 workers failed), checked 26,503 records and finished compute pipeline preparation in 6 s (total_elapsed_s=72.5 including the 60 s run), presentation window worked cleanly.

Regression run
scripts/smoke.ps1 -Seconds 60, release builds of nvidia-dev (c044dc6d) and #2624 (82e4a9bb):

nvidia-dev (c044dc6d):

xcl-smoke v1
commit: c044dc6d48d2b46a8ae77852df275c534681f3df
gpu: NVIDIA GeForce RTX 3060 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1552 (PresentX 1552)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15485 MB

PR (XCL_PREPARE=0):

xcl-smoke v1
commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6
gpu: NVIDIA GeForce RTX 3060 Ti
title: 9cc6a39e
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: 15475 MB

PR (with worker preparation over used-shaders.txt, 8 workers, 6 s prep):

xcl-smoke v1
commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6
gpu: NVIDIA GeForce RTX 3060 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1576 (PresentX 1576)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15585 MB

Not tested

  • Cold XCL_PREPARE_ALL=1 full-pack compute precompile pass; AMD / Intel / Linux GPUs; XCL_SAMPLE_* tests; the 60 s smoke run covers boot/intro/menus and does not enter the 3D world.

AI use

  • Antigravity (Gemini 4 Hydrogen) ran the builds, test suite, and smoke.ps1 commands on this machine and drafted this report from the captured outputs.
<!-- greyfinch-sync:ivall/xcl:comment:7183286973 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7183286973). Originally posted by [LocranKing](https://github.com/LocranKing) on 2026-11-26T05:13:08Z. --- Independent NVIDIA test report on exact head `82e4a9bbf3be583418b9df7825dd1430fd8b06d6` (clean detached checkout, no local changes), compared against `nvidia-dev` (`c044dc6d`). **Tested** - Hardware: NVIDIA GeForce RTX 3060 Ti 8 GB (Ampere, wave32, driver `32.0.16.2140` / 621.40), AMD Ryzen 5 5500 (6c/12t), 32 GB RAM, Windows 11 Home (build 26300), Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), Windows SDK `10.0.26100.0`. - `cargo build --workspace` + `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug): - `nvidia-dev` (`c044dc6d`): 1560 passed, 6 failed, 47 ignored (`xcl --lib`: 1490 passed, 2 failed, 27 ignored), 28 `SKIPPED`. - `#2624` (`82e4a9bb`): 1721 passed, 6 failed, 48 ignored (`xcl --lib`: 1594 passed, 2 failed, 28 ignored), 28 `SKIPPED`. - **0 new failures vs `nvidia-dev` (+161 passing tests).** All 6 failures match `nvidia-dev`: - `hle::d3d12x::texture_upload::tests::{gpu_parts_of_a_texture_go_up_and_the_rest_stays, pieces_hold_the_texels_of_their_levels}` (`texture_upload.rs:990:17`: `attempt to multiply with overflow` in debug) - `d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly` (`expected AS-slot refusal in translation_errors: ["MS: no NGG hardware variant"]`) - `gpu_compute_e2e::async_compute_pso_registers_real_pso_and_not_standin` - `gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` (both test runs fail with `disabled:`) - 28 `SKIPPED` GPU tests on this adapter: 21 wave64-only (`no wave64`), 3 wave32 per-lane f16/f32 semantics, 1 `no heap windows`, 1 `no heap windows (opt-in: XCL_HEAP_WINDOWS=1)`, 1 no D3D12 debug layer (`0x887A002D`), 1 cannot disable driver cache without Developer Mode (`0x887A002D`). - **Shader preparation check (with `used-shaders.txt` = 11 shaders from the prior `XCL_PREPARE=0` run):** - Launched 8 worker processes on the 12-thread CPU (`0 of 8 workers failed`), checked 26,503 records and finished compute pipeline preparation in **6 s** (`total_elapsed_s=72.5` including the 60 s run), presentation window worked cleanly. **Regression run** `scripts/smoke.ps1 -Seconds 60`, release builds of `nvidia-dev` (`c044dc6d`) and `#2624` (`82e4a9bb`): nvidia-dev (`c044dc6d`): ``` xcl-smoke v1 commit: c044dc6d48d2b46a8ae77852df275c534681f3df gpu: NVIDIA GeForce RTX 3060 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1552 (PresentX 1552) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15485 MB ``` PR (`XCL_PREPARE=0`): ``` xcl-smoke v1 commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6 gpu: NVIDIA GeForce RTX 3060 Ti title: 9cc6a39e 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: 15475 MB ``` PR (with worker preparation over `used-shaders.txt`, 8 workers, 6 s prep): ``` xcl-smoke v1 commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6 gpu: NVIDIA GeForce RTX 3060 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1576 (PresentX 1576) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15585 MB ``` **Not tested** - Cold `XCL_PREPARE_ALL=1` full-pack compute precompile pass; AMD / Intel / Linux GPUs; `XCL_SAMPLE_*` tests; the 60 s smoke run covers boot/intro/menus and does not enter the 3D world. **AI use** - Antigravity (Gemini 4 Hydrogen) ran the builds, test suite, and `smoke.ps1` commands on this machine and drafted this report from the captured outputs.
itsSio commented 2026-11-26 06:06:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by itsSio on 2026-11-26T05:29:30Z.


Dual-PC NVIDIA full-workspace test run (debug) and RTX 5080 retail smoke (release) at exact head 82e4a9bbf3be583418b9df7825dd1430fd8b06d6, covering the full suite, hardware-GPU tests, integration tests, and non-5090 NVIDIA hardware listed under Not tested.

Tested

  • Commit 82e4a9bbf3be583418b9df7825dd1430fd8b06d6 (base nvidia-dev), clean checkouts on both PCs, XCL_ADAPTER=NVIDIA, cargo build --workspace before running cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture.
  • PC 1: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200.9974, rustc 1.97.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug build.
    • Full workspace: 1720 passed, 6 failed, 48 ignored (lib: 1594 passed, 2 failed, 28 ignored; raw lines also print 3 single-test child reruns and a duplicate gpu_two_pass_cache print, excluded from totals).
    • SKIPPED: 27 lines (no-wave64 group, 3 refused wave32 per-lane f16 forms, no heap windows).
  • PC 2: NVIDIA GeForce RTX 2080 SUPER (driver 32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200.8653, rustc 1.99.1 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC 1.8.2502.11, debug build.
    • Full workspace: 1721 passed, 5 failed, 48 ignored (lib: 1594 passed, 2 failed, 28 ignored).
    • SKIPPED: 30 lines (18 distinct tests: PC 1 skips plus pso_measurement_compiles_an_exact_synthetic_record, uploads_start_from_each_subresources_state, and 2 lower:: wave64 tests).
  • All 4 new #2624 tests pass on both PCs: the_shaders_of_a_used_set_are_kept_for_the_next_run, the_key_of_one_shader_is_the_key_of_a_set_of_it, preparation_workers_leave_two_processors_and_follow_the_commit_left, static_sampler_set_before_a_branch_is_a_constant_after_it.
  • Failures (5 pre-existing on nvidia-dev, reproduced on both PCs):
    1. texture_upload::tests::pieces_hold_the_texels_of_their_levels & gpu_parts_of_a_texture_go_up_and_the_rest_stays (texture_upload.rs:990:17, debug multiply overflow in test LCG).
    2. d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly (:96, expected AS-slot refusal, got ["MS: no NGG hardware variant"]).
    3. gpu_compute_e2e::async_compute_pso_registers_real_pso_and_not_standin (:535, TRANSLATED_COMPUTE cleanup vs late_release).
    4. gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (:649, two-pass state release left 3, right 0 vs late_release).
  • New failure on PC 1 only (e2e::test_title_runs_and_game_folder_is_untouched, e2e.rs:168):
    • The game folder snapshot gains empty NVIDIA Corporation\ and NVIDIA Corporation\umdlogs\ directories.
    • A/B on the same RTX 5080 and driver: #2624 (82e4a9bb) failed 4/4 runs; nvidia-dev (c044dc6d) passed 3/3 runs (where the VFS redirects those driver writes to the overlay because D3D12 init happens after VFS install, whereas preparation::before_guest opens D3D12 before VFS install while cwd is the game root). Passing on PC 2 (RTX 2080 SUPER does not create umdlogs).
  • Retail 60 s smoke on PC 1 (RTX 5080, release build, XCL_PREPARE=0, XCL_DXC_DIR = DXC 1.9.2609.5):
xcl-smoke v1
commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6
gpu: NVIDIA GeForce RTX 5080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14970 MB

Not tested

  • Worker-process shader preparation (XCL_PREPARE=1) and used-shaders.txt reuse on a retail title, visual verification of the static sampler fix in 3D world rendering, AMD / Intel GPUs, and retail smoke on the RTX 2080 SUPER.

AI use
Ran via Samaritan:

  • Google Antigravity CLI (Claude Opus 5.5 (High)): ran the dual-PC workspace test suites, the e2e A/B check against c044dc6d, and the release build, and traced the before_guest cwd vs VFS ordering behind the umdlogs failure.
  • Google Antigravity CLI (Gemini 4 Neon (High)): ran the 60 s RTX 5080 retail smoke test and wrote this test report.
<!-- greyfinch-sync:ivall/xcl:comment:7183532520 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7183532520). Originally posted by [itsSio](https://github.com/itsSio) on 2026-11-26T05:29:30Z. --- Dual-PC NVIDIA full-workspace test run (debug) and RTX 5080 retail smoke (release) at exact head `82e4a9bbf3be583418b9df7825dd1430fd8b06d6`, covering the full suite, hardware-GPU tests, integration tests, and non-5090 NVIDIA hardware listed under **Not tested**. **Tested** - Commit `82e4a9bbf3be583418b9df7825dd1430fd8b06d6` (base `nvidia-dev`), clean checkouts on both PCs, `XCL_ADAPTER=NVIDIA`, `cargo build --workspace` before running `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture`. - PC 1: NVIDIA GeForce RTX 5080 (driver `32.0.16.1088`), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200.9974, `rustc 1.97.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.9.2609.5`, debug build. - Full workspace: **1720 passed, 6 failed, 48 ignored** (lib: `1594 passed, 2 failed, 28 ignored`; raw lines also print 3 single-test child reruns and a duplicate `gpu_two_pass_cache` print, excluded from totals). - `SKIPPED`: 27 lines (no-wave64 group, 3 refused wave32 per-lane f16 forms, no heap windows). - PC 2: NVIDIA GeForce RTX 2080 SUPER (driver `32.0.16.1088`), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200.8653, `rustc 1.99.1` (`stable-x86_64-pc-windows-msvc`), Windows SDK 10.0.26100 DXC `1.8.2502.11`, debug build. - Full workspace: **1721 passed, 5 failed, 48 ignored** (lib: `1594 passed, 2 failed, 28 ignored`). - `SKIPPED`: 30 lines (18 distinct tests: PC 1 skips plus `pso_measurement_compiles_an_exact_synthetic_record`, `uploads_start_from_each_subresources_state`, and 2 `lower::` wave64 tests). - All 4 new `#2624` tests pass on both PCs: `the_shaders_of_a_used_set_are_kept_for_the_next_run`, `the_key_of_one_shader_is_the_key_of_a_set_of_it`, `preparation_workers_leave_two_processors_and_follow_the_commit_left`, `static_sampler_set_before_a_branch_is_a_constant_after_it`. - **Failures (5 pre-existing on `nvidia-dev`, reproduced on both PCs):** 1. `texture_upload::tests::pieces_hold_the_texels_of_their_levels` & `gpu_parts_of_a_texture_go_up_and_the_rest_stays` (`texture_upload.rs:990:17`, debug multiply overflow in test LCG). 2. `d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly` (`:96`, expected AS-slot refusal, got `["MS: no NGG hardware variant"]`). 3. `gpu_compute_e2e::async_compute_pso_registers_real_pso_and_not_standin` (`:535`, `TRANSLATED_COMPUTE` cleanup vs `late_release`). 4. `gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` (`:649`, two-pass state release `left 3, right 0` vs `late_release`). - **New failure on PC 1 only (`e2e::test_title_runs_and_game_folder_is_untouched`, `e2e.rs:168`):** - The game folder snapshot gains empty `NVIDIA Corporation\` and `NVIDIA Corporation\umdlogs\` directories. - A/B on the same RTX 5080 and driver: `#2624` (`82e4a9bb`) failed **4/4** runs; `nvidia-dev` (`c044dc6d`) passed **3/3** runs (where the VFS redirects those driver writes to the overlay because D3D12 init happens after VFS install, whereas `preparation::before_guest` opens D3D12 before VFS install while cwd is the game root). Passing on PC 2 (RTX 2080 SUPER does not create `umdlogs`). - **Retail 60 s smoke on PC 1 (RTX 5080, release build, `XCL_PREPARE=0`, `XCL_DXC_DIR` = DXC `1.9.2609.5`):** ``` xcl-smoke v1 commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6 gpu: NVIDIA GeForce RTX 5080 title: retail-title seconds: 60 exit: 0x0 frames shown: 1677 (PresentX 1677) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14970 MB ``` **Not tested** - Worker-process shader preparation (`XCL_PREPARE=1`) and `used-shaders.txt` reuse on a retail title, visual verification of the static sampler fix in 3D world rendering, AMD / Intel GPUs, and retail smoke on the RTX 2080 SUPER. **AI use** Ran via Samaritan: - Google Antigravity CLI (Claude Opus 5.5 (High)): ran the dual-PC workspace test suites, the `e2e` A/B check against `c044dc6d`, and the release build, and traced the `before_guest` cwd vs VFS ordering behind the `umdlogs` failure. - Google Antigravity CLI (Gemini 4 Neon (High)): ran the 60 s RTX 5080 retail smoke test and wrote this test report.
upstream-sync closed this pull request 2026-11-26 07:03:08 +00:00
KDenKC commented 2026-11-26 07:03:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-26T06:20:05Z.


+1 to @pickles976's byte/MB finding above (7182236787). I didn't see it before posting, sorry for the repeat. One new data point: it is still there at the current nvidia-dev head af2cecc4 (shaders.rs:1727 passes system_commit() bytes to workers_for, which divides by 3072). So on a 16-thread CPU the default is still 12 workers, whatever commit is free. We'll set XCL_PREPARE_WORKERS explicitly when we run the branch.

AI use: Claude Code (Claude Opus 5.5) checked the source at af2cecc4 and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7184328534 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7184328534). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-26T06:20:05Z. --- +1 to @pickles976's byte/MB finding above (7182236787). I didn't see it before posting, sorry for the repeat. One new data point: it is still there at the current `nvidia-dev` head `af2cecc4` (`shaders.rs:1727` passes `system_commit()` bytes to `workers_for`, which divides by 3072). So on a 16-thread CPU the default is still 12 workers, whatever commit is free. We'll set `XCL_PREPARE_WORKERS` explicitly when we run the branch. AI use: Claude Code (Claude Opus 5.5) checked the source at `af2cecc4` and wrote this.
pr1sm-dev commented 2026-11-26 07:03:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pr1sm-dev on 2026-11-26T06:27:38Z.


@pickles976 confirmed by reading the current nvidia-dev head af2cecc: prepare_workers (crates/xcl/src/shaders.rs:1727-1728) still passes host::system_commit(), which is in bytes (host.rs:11-12), to workers_for(cores, free_mb), which divides by 3072 as MiB (shaders.rs:1732-1733). So the commit bound never applies, and the count is always the logical processors less four (capped at 32).

I'm taking the fix, as a small PR against nvidia-dev: convert at the call site, leave workers_for and its tests as they are, and add a regression test with byte values (6 GiB free on 16 threads → 2 workers). A process or cgroup memory cap that the commit figures do not show stays out of scope; I'll say so in the PR.

AI use: Claude Code (Claude Opus 5.5) read the source and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7184450517 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7184450517). Originally posted by [pr1sm-dev](https://github.com/pr1sm-dev) on 2026-11-26T06:27:38Z. --- @pickles976 confirmed by reading the current `nvidia-dev` head `af2cecc`: `prepare_workers` (`crates/xcl/src/shaders.rs:1727-1728`) still passes `host::system_commit()`, which is in bytes (`host.rs:11-12`), to `workers_for(cores, free_mb)`, which divides by 3072 as MiB (`shaders.rs:1732-1733`). So the commit bound never applies, and the count is always the logical processors less four (capped at 32). I'm taking the fix, as a small PR against `nvidia-dev`: convert at the call site, leave `workers_for` and its tests as they are, and add a regression test with byte values (6 GiB free on 16 threads → 2 workers). A process or cgroup memory cap that the commit figures do not show stays out of scope; I'll say so in the PR. AI use: Claude Code (Claude Opus 5.5) read the source and wrote this comment.
KDenKC commented 2026-11-26 09:07:48 +00:00 (Migrated from github.com)

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


nvidia-dev af2cecc4, all cold, RTX 5090. Preparation works and removes the graphics stall on a relaunch. The wall left is about 20 split programs' whole forms, which the worker processes do not build.

RTX 5090 (621.24), Ryzen 7 9800X3D (16 threads), Windows 11, release, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_TRACE=1 XCL_NETWORK=0, XCL_PREPARE_WORKERS=6 (set by hand, see the byte/MB note above), 600 s of title time, the retail title. Each arm used a fresh exe name (empty NVIDIA cache) and a fresh XCL_DXIL_CACHE. One run per arm:

  • M: main b49be18.
  • N1: this branch, no history.
  • N2: this branch, a cache holding only N1's used-shaders.txt, used-pipelines.txt and used-graphics-pipelines.bin.
M N1 N2
preparation before the title none 64.5 min: translate 33.0 + compute 31.5 (all 26,503 records, 0 of 6 workers failed) 9.4 min: translate 48 s (1,233 used) + compute 8.0 min + graphics 33 s (142 made, 0 failed)
graphics PSO driver compile time in the title 124 s 155 s 5 s
compute compiles of 500 KB+ DXIL in the title (count, total time) 14, 262 s 39, 488 s 42, 546 s
frames shown / last frame 2,004 / +120 s 2,153 / +108 s 2,199 / +108 s
peak commit / removals 32.6 GB / 0 35.7 GB / 0 35.6 GB / 0

None of the three reached the world in 600 s. Each one sat on the world loading screen from about +110 s, while large compute pipelines kept compiling.

Where N2's time went. Joining driver compile start/finish with the binds:

  • The compute compiles with no driver blob that a bind actually waited for took 491 s.
  • 468.5 s of that (95%) was 20 whole forms of split programs, plus one 805 KB whole form still compiling at the cap. Their programs were in used-pipelines.txt, and Pass 2 had built their pieces.
  • The other compiles with no blob were background preloads of pipelines no run bound.

The reason is in shaders.rs (af2cecc4, around line 2172): p.make_one(&c.dxil, …, true, None) for a program with a dispatch_chain runs only if startup.is_some(). Pass 2's workers run precompile with startup = None, so they build the pieces but never the whole form. Building it when XCL_PRECOMPILE_PARENT is set too (or passing a flag to the workers) looks like it would take most of that remaining wait into preparation.

Not tested: the default worker count; more than one run per arm; whether the title reaches the world with whole forms prepared; AMD. nvidia-dev is the whole branch, so M vs N differences are not only #2624's.

AI use: Claude Code (Claude Opus 5.5) ran the three arms. Gemini (Antigravity) joined the trace lines and found the startup gate. Claude Code checked the gate in the source and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7187143204 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7187143204). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-26T08:53:17Z. --- **`nvidia-dev` `af2cecc4`, all cold, RTX 5090.** Preparation works and removes the graphics stall on a relaunch. The wall left is about 20 split programs' whole forms, which the worker processes do not build. RTX 5090 (621.24), Ryzen 7 9800X3D (16 threads), Windows 11, release, `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_TRACE=1 XCL_NETWORK=0`, `XCL_PREPARE_WORKERS=6` (set by hand, see the byte/MB note above), 600 s of title time, the retail title. Each arm used a fresh exe name (empty NVIDIA cache) and a fresh `XCL_DXIL_CACHE`. One run per arm: - **M:** `main` `b49be18`. - **N1:** this branch, no history. - **N2:** this branch, a cache holding only N1's `used-shaders.txt`, `used-pipelines.txt` and `used-graphics-pipelines.bin`. | | M | N1 | N2 | |---|---:|---:|---:| | preparation before the title | none | 64.5 min: translate 33.0 + compute 31.5 (all 26,503 records, 0 of 6 workers failed) | 9.4 min: translate 48 s (1,233 used) + compute 8.0 min + graphics 33 s (142 made, 0 failed) | | graphics PSO driver compile time in the title | 124 s | 155 s | 5 s | | compute compiles of 500 KB+ DXIL in the title (count, total time) | 14, 262 s | 39, 488 s | 42, 546 s | | frames shown / last frame | 2,004 / +120 s | 2,153 / +108 s | 2,199 / +108 s | | peak commit / removals | 32.6 GB / 0 | 35.7 GB / 0 | 35.6 GB / 0 | None of the three reached the world in 600 s. Each one sat on the world loading screen from about +110 s, while large compute pipelines kept compiling. **Where N2's time went.** Joining `driver compile start/finish` with the binds: - The compute compiles with no driver blob that a bind actually waited for took 491 s. - 468.5 s of that (95%) was 20 whole forms of split programs, plus one 805 KB whole form still compiling at the cap. Their programs were in `used-pipelines.txt`, and Pass 2 had built their pieces. - The other compiles with no blob were background preloads of pipelines no run bound. The reason is in `shaders.rs` (`af2cecc4`, around line 2172): `p.make_one(&c.dxil, …, true, None)` for a program with a `dispatch_chain` runs only `if startup.is_some()`. Pass 2's workers run `precompile` with `startup = None`, so they build the pieces but never the whole form. Building it when `XCL_PRECOMPILE_PARENT` is set too (or passing a flag to the workers) looks like it would take most of that remaining wait into preparation. **Not tested:** the default worker count; more than one run per arm; whether the title reaches the world with whole forms prepared; AMD. `nvidia-dev` is the whole branch, so M vs N differences are not only #2624's. AI use: Claude Code (Claude Opus 5.5) ran the three arms. Gemini (Antigravity) joined the trace lines and found the `startup` gate. Claude Code checked the gate in the source and wrote this.
joeypercia commented 2026-11-26 10:06:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-26T09:32:54Z.


Confirming @KDenKC's finding about the preparation's startup gate on an RTX 4070 Ti 12 GB (af2cecc4, shader heap at 1 GiB with xcl nvprofile).

  • Without whole forms prepared, two runs froze from about 130 s. Title threads sat in Chain::whole building whole forms cold, 15–25 s each, 750 KB – 1.1 MB of DXIL (symbolized thread dumps at 180 and 300 s).
  • I patched only the gate, locally: startup.is_some() || std::env::var_os("XCL_PRECOMPILE_PARENT").is_some() in the compute branch of precompile. The first preparation with it took 754 s (12 workers, 0 failed). On the next launch it took 17 s, and the title went through the load with no freeze and no removal to the 438 s cap.
  • What's left there is video memory, on #2688.

One run per arm, so take it as an indication. The 754 s is a one-time cost per cache. (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7188137447 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7188137447). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-26T09:32:54Z. --- Confirming @KDenKC's finding about the preparation's `startup` gate on an RTX 4070 Ti 12 GB (`af2cecc4`, shader heap at 1 GiB with `xcl nvprofile`). - Without whole forms prepared, two runs froze from about 130 s. Title threads sat in `Chain::whole` building whole forms cold, 15–25 s each, 750 KB – 1.1 MB of DXIL (symbolized thread dumps at 180 and 300 s). - I patched only the gate, locally: `startup.is_some() || std::env::var_os("XCL_PRECOMPILE_PARENT").is_some()` in the compute branch of `precompile`. The first preparation with it took 754 s (12 workers, 0 failed). On the next launch it took 17 s, and the title went through the load with no freeze and no removal to the 438 s cap. - What's left there is video memory, on #2688. One run per arm, so take it as an indication. The 754 s is a one-time cost per cache. (Claude Code, Claude Opus 5.5)
KDenKC commented 2026-11-26 11:05:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-26T10:28:23Z.


Follow-up to 7187143204: with the preparation workers also building whole forms, the compute wall moves into preparation, and the title loads further before the next wall: graphics pipelines no earlier run reached.

Same setup as N2 there (RTX 5090, af2cecc4, a fresh exe name, a cache holding only N1's three used-* files, XCL_PREPARE_WORKERS=6, 600 s). One local change, a suggestion rather than a PR from us:

--- a/crates/xcl/src/shaders.rs   (in precompile)
+    // Pass-2 preparation workers have no in-process startup state but need whole forms too.
+    let prepare_whole = startup.is_some() || std::env::var_os("XCL_PRECOMPILE_PARENT").is_some();
 ...
-                                if startup.is_some() && c.dispatch_chain.as_ref().is_some_and(|plan| plan.pieces.len() >= 2) {
+                                if prepare_whole && c.dispatch_chain.as_ref().is_some_and(|plan| plan.pieces.len() >= 2) {

We also added a worker variant of the gpu_compute_e2e offline split-pipeline test (a worker must leave the whole form's blob for a second process). It failed without the change and passed with it.

N2 N3 (with the change)
preparation 9.4 min (Pass 2: 8.0 min) 32.3 min (Pass 2: 30.9 min, 0 of 6 workers failed)
compute compiles of 500 KB+ in the title 42, 546 s (plus 1 unfinished) 156, 130 s (150 of them from a driver blob)
bind waits on a cold whole form listed in used-pipelines.txt 20 (468.5 s) + 1 unfinished 0
draws / dispatches after +120 s 582 / 547 3,442 / 7,695
graphics compiles of 1 s or more 0 135 (387 s, from +190 s to the cap)
world reached no no
  • The 135 graphics pipelines were in no earlier run's used-graphics-pipelines.bin (N1 never got that far). The gap before each one was ~5 ms, so translation was warm and the time is the driver's compile.
  • A run seeded with N3's manifests should show whether Pass 3 then clears those as well. We have not run it yet.

Not tested: that N4; more than one run; the default worker count; AMD.

AI use: Codex (GPT-6.1-Sol) wrote the change and its test. Claude Code (Claude Opus 5.5) ran the arm. Gemini (Antigravity) compared N2 and N3 in the traces. Claude Code checked the numbers and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7189411250 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7189411250). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-26T10:28:23Z. --- **Follow-up to 7187143204: with the preparation workers also building whole forms, the compute wall moves into preparation, and the title loads further before the next wall: graphics pipelines no earlier run reached.** Same setup as N2 there (RTX 5090, `af2cecc4`, a fresh exe name, a cache holding only N1's three `used-*` files, `XCL_PREPARE_WORKERS=6`, 600 s). One local change, a suggestion rather than a PR from us: ```diff --- a/crates/xcl/src/shaders.rs (in precompile) + // Pass-2 preparation workers have no in-process startup state but need whole forms too. + let prepare_whole = startup.is_some() || std::env::var_os("XCL_PRECOMPILE_PARENT").is_some(); ... - if startup.is_some() && c.dispatch_chain.as_ref().is_some_and(|plan| plan.pieces.len() >= 2) { + if prepare_whole && c.dispatch_chain.as_ref().is_some_and(|plan| plan.pieces.len() >= 2) { ``` We also added a worker variant of the `gpu_compute_e2e` offline split-pipeline test (a worker must leave the whole form's blob for a second process). It failed without the change and passed with it. | | N2 | N3 (with the change) | |---|---:|---:| | preparation | 9.4 min (Pass 2: 8.0 min) | 32.3 min (Pass 2: 30.9 min, 0 of 6 workers failed) | | compute compiles of 500 KB+ in the title | 42, 546 s (plus 1 unfinished) | 156, 130 s (150 of them from a driver blob) | | bind waits on a cold whole form listed in `used-pipelines.txt` | 20 (468.5 s) + 1 unfinished | 0 | | draws / dispatches after +120 s | 582 / 547 | 3,442 / 7,695 | | graphics compiles of 1 s or more | 0 | 135 (387 s, from +190 s to the cap) | | world reached | no | no | - The 135 graphics pipelines were in no earlier run's `used-graphics-pipelines.bin` (N1 never got that far). The gap before each one was ~5 ms, so translation was warm and the time is the driver's compile. - A run seeded with N3's manifests should show whether Pass 3 then clears those as well. We have not run it yet. Not tested: that N4; more than one run; the default worker count; AMD. AI use: Codex (GPT-6.1-Sol) wrote the change and its test. Claude Code (Claude Opus 5.5) ran the arm. Gemini (Antigravity) compared N2 and N3 in the traces. Claude Code checked the numbers and wrote this.
joeypercia commented 2026-11-26 14:03:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-26T13:35:05Z.


@KDenKC, since you posted the gate change as a suggestion rather than a PR, I opened it as #2794 against nvidia-dev, with your numbers credited. It adds a worker variant of the offline split-pipeline e2e test: one more pipeline than pieces, each with a driver blob, and the test fails without the change. If you'd rather open your own with your worker test, say so and I'll close mine. (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7193552969 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7193552969). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-26T13:35:05Z. --- @KDenKC, since you posted the gate change as a suggestion rather than a PR, I opened it as #2794 against `nvidia-dev`, with your numbers credited. It adds a worker variant of the offline split-pipeline e2e test: one more pipeline than pieces, each with a driver blob, and the test fails without the change. If you'd rather open your own with your worker test, say so and I'll close mine. (Claude Code, Claude Opus 5.5)
KDenKC commented 2026-11-26 14:03:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-26T13:43:42Z.


@joeypercia thanks, please keep #2794. We posted it as a suggestion so that someone could open it. Your worker variant of the e2e test is the same check we ran (one more blob than pieces; it fails without the change).

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

<!-- greyfinch-sync:ivall/xcl:comment:7193753267 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7193753267). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-26T13:43:42Z. --- @joeypercia thanks, please keep #2794. We posted it as a suggestion so that someone could open it. Your worker variant of the e2e test is the same check we ran (one more blob than pieces; it fails without the change). AI use: Claude Code (Claude Opus 5.5) wrote this.
vakaobr commented 2026-11-26 19:39:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-26T19:39:12Z.


Edit: this was already reported by @pickles976 above (https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7182236787) and is fixed by #2705, which makes the same change. I missed both; my Mac test of the fix is on #2705. The rest of this comment stays as written for the measurements.

The preparation worker count never applies its 3 GB-per-worker limit: prepare_workers passes the commit left in bytes to workers_for, which takes MB.

On nvidia-dev (eae01502), crates/xcl/src/shaders.rs:

let (used, limit) = crate::host::system_commit();   // bytes (host.rs: "its limit in bytes")
workers_for(cores, limit.saturating_sub(used))      // workers_for(cores: usize, free_mb: u64)

free_mb / 3072 is then in the millions, so the count is always the logical processors less four (capped at 32), whatever memory is left. On a 32-thread machine with 20 GB of commit left that is 28 workers where the rule gives 6.

Measured on my Mac (M5 Pro, 18 logical processors, 48 GB RAM + 6 GB swap, CrossOver 26.3 + D3DMetal): the host read 21,051 MB of commit left of a 55,296 MB limit and started 14 workers. With the fix it starts 6 or 7, depending on the memory left at that moment.

Fix (one helper and a test, d4f8569 on my fork):

-    workers_for(cores, limit.saturating_sub(used))
+    workers_for_commit(cores, used, limit)
+}
+
+/// `workers_for` with the system's commit as `host::system_commit` gives it, in bytes.
+fn workers_for_commit(cores: usize, used: u64, limit: u64) -> usize {
+    workers_for(cores, limit.saturating_sub(used) >> 20)
 }
#[test]
fn preparation_workers_count_the_commit_left_in_megabytes() {
    assert_eq!(workers_for_commit(18, 34 << 30, 55 << 30), 7);
    assert_eq!(workers_for_commit(32, 0, 100 << 30), 28);
    assert_eq!(workers_for_commit(32, 55 << 30, 55 << 30), 1);
}

The test fails without the shift (left 14, right 7) and passes with it.

Tested (macOS, CrossOver, not Windows): the shader-preparation commits from this PR and #2555 plus this fix, on top of main 6d12f58 and the Mac fixes, as mac/integration. Whole suite one test per process: no change on the 1,516 tests in common with the base, and the new tests pass. Test title 50/50 with exit 0, with and without a synthetic compute pack; workers start, build, exit, and end with the host. XCL_PREPARE_WORKERS=1 keeps the single-process path.

Not tested: Windows, a retail title, a large pack (for the speed-up).

Two smaller things I noticed, not changed:

  • With XCL_PREPARE_ALL=1 and a used-pipelines.txt present, the host takes every record but the workers still get --used-only, because pipelines_in_workers only looks at the used list.
  • used-shaders.txt and used-pipelines.txt live in the shared DXIL cache folder, so one title's run (or a test run) changes what the next title prepares.

AI use: Claude Code with Claude Opus 5.5 found the bug while porting these commits, wrote the fix and test, ran the tests on my machine and drafted this comment. I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7201819582 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7201819582). Originally posted by [vakaobr](https://github.com/vakaobr) on 2026-11-26T19:39:12Z. --- **Edit:** this was already reported by @pickles976 above (https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7182236787) and is fixed by #2705, which makes the same change. I missed both; my Mac test of the fix is on #2705. The rest of this comment stays as written for the measurements. The preparation worker count never applies its 3 GB-per-worker limit: `prepare_workers` passes the commit left in **bytes** to `workers_for`, which takes **MB**. On `nvidia-dev` (`eae01502`), `crates/xcl/src/shaders.rs`: ```rust let (used, limit) = crate::host::system_commit(); // bytes (host.rs: "its limit in bytes") workers_for(cores, limit.saturating_sub(used)) // workers_for(cores: usize, free_mb: u64) ``` `free_mb / 3072` is then in the millions, so the count is always the logical processors less four (capped at 32), whatever memory is left. On a 32-thread machine with 20 GB of commit left that is 28 workers where the rule gives 6. **Measured** on my Mac (M5 Pro, 18 logical processors, 48 GB RAM + 6 GB swap, CrossOver 26.3 + D3DMetal): the host read 21,051 MB of commit left of a 55,296 MB limit and started 14 workers. With the fix it starts 6 or 7, depending on the memory left at that moment. **Fix** (one helper and a test, [`d4f8569` on my fork](https://github.com/vakaobr/xcl/commit/d4f856900c48c2d967a9c057e5f535c9e90e81fc)): ```diff - workers_for(cores, limit.saturating_sub(used)) + workers_for_commit(cores, used, limit) +} + +/// `workers_for` with the system's commit as `host::system_commit` gives it, in bytes. +fn workers_for_commit(cores: usize, used: u64, limit: u64) -> usize { + workers_for(cores, limit.saturating_sub(used) >> 20) } ``` ```rust #[test] fn preparation_workers_count_the_commit_left_in_megabytes() { assert_eq!(workers_for_commit(18, 34 << 30, 55 << 30), 7); assert_eq!(workers_for_commit(32, 0, 100 << 30), 28); assert_eq!(workers_for_commit(32, 55 << 30, 55 << 30), 1); } ``` The test fails without the shift (left 14, right 7) and passes with it. **Tested** (macOS, CrossOver, not Windows): the shader-preparation commits from this PR and #2555 plus this fix, on top of `main` `6d12f58` and the Mac fixes, as `mac/integration`. Whole suite one test per process: no change on the 1,516 tests in common with the base, and the new tests pass. Test title 50/50 with exit 0, with and without a synthetic compute pack; workers start, build, exit, and end with the host. `XCL_PREPARE_WORKERS=1` keeps the single-process path. **Not tested:** Windows, a retail title, a large pack (for the speed-up). Two smaller things I noticed, not changed: - With `XCL_PREPARE_ALL=1` and a `used-pipelines.txt` present, the host takes every record but the workers still get `--used-only`, because `pipelines_in_workers` only looks at the used list. - `used-shaders.txt` and `used-pipelines.txt` live in the shared DXIL cache folder, so one title's run (or a test run) changes what the next title prepares. **AI use:** Claude Code with Claude Opus 5.5 found the bug while porting these commits, wrote the fix and test, ran the tests on my machine and drafted this comment. I checked it before posting.
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!2614
No description provided.