Shaders: prepare whole split fallbacks on nvidia-dev #3131

Closed
Prime1997 wants to merge 2 commits from upstream-pr/3131 into main
Prime1997 commented 2026-11-28 12:37:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T12:37:36Z.


Adapt #2551 by René (@DTsordas), original commit 3567b2efdc94617de71e50be77e107991a6bd41c, onto nvidia-dev 54225f5884a94cd23b7aab3f703a7c975070aa77. Ordinary --precompile --pipelines prepared split pieces but omitted the whole fallback needed by indirect dispatch. Preparing that fallback ahead of play can avoid its cold driver compile on the game's thread. This is a NVIDIA adaptation of the existing main PR.

What is in it

  • Prepare the whole form with the dispatch-chain root signature and .chain.pso cache namespace alongside the split pieces.
  • Remove NVIDIA's separate startup-worker whole-form call from #2794, so each preparation call builds that form once.
  • Extend synthetic cache reuse, corrupt-blob and size-cap coverage; update the fresh-process reuse test and README. Runtime dispatch semantics and retained shader-source memory behavior are unchanged.

Tested

  • Current PR head: 73872c0d487c6f7b001a78424e5e49ad819b9fef.
  • Windows 11 Pro 26200; Intel i5-10400; NVIDIA RTX 3060 Ti driver 32.0.16.1714; Rust 1.100.0; release profile.
  • Combined integration d50f6656fb50b7927a2279d4c78b24222be3da54: cargo build --locked --release -p xcl --target-dir <isolated-target> exited 0 in 228.576s, with 9 warnings. This includes the change but is not a standalone build/test of this PR head.
  • At the combined head above: cargo test --locked --release -p xcl --test gpu_compute_e2e <filter> --target-dir <isolated-target> -- --exact --test-threads=1 --nocapture. Filters offline_split_compute_pipeline_is_reused_by_a_second_process and a_preparation_worker_also_builds_a_split_programs_whole_form: each 1 passed, 0 failed, 0 ignored, 7 filtered, no SKIPPED messages. Covers cold synthetic whole/piece creation, fresh-process reuse, corrupt-blob recovery and startup avoiding duplicate whole preparation.
  • Two fresh CLI processes at that combined head: xcl.exe shaders <private-exact-four> --precompile --only cs --pipelines --windows 16 --split 1. Each accepted 60/60 cached native pipelines, 0 refused, 4 split programs/56 pieces plus four whole forms, with one pipeline worker and matching adapter/DXC/translation settings. The four whole blobs already existed after the prior failed play session; this proves current driver acceptance, not a controlled 113-second before/after reduction or successful world entry.
  • At this exact PR head: cargo test --locked --release -p xcl --lib shaders::pipeline_cap_tests::split_compute_program_prebuilds_and_caches_chain_pieces --target-dir <isolated-target> -- --exact --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, 1805 filtered, no SKIPPED messages; command wall time 384.914s including compilation. This is a synthetic native PSO/cache check, without shader dispatch. The previous head failed this test in Windows CI because it assumed the whole DXIL was larger than each piece. This fixture-only follow-up restores the rejected piece before testing a cold whole cap, so it no longer depends on compiler-specific sizes. The earlier runtime change is preserved; the full suite and new-head CI are not claimed here.
  • Combined integration d50f also reached loading screens in two unattended attempts, but both ended in device removal before playable world entry. The pagefault-DRED attempt showed a compute completion fence pending over ten seconds. Local GPU usage stayed below its reported budget in all captured samples; this does not establish the cause of removal. Neither attempt is a successful regression run for this focused PR.

Regression run
Pending paired clean-head main/PR title runs. No smoke result or successful world-entry result is claimed. Draft while required validation remains incomplete.

Not tested

  • Exact-head title regression, full GPU workspace suite, AMD/Intel and Linux/Wine.
  • Complete retail shader coverage or a measured reduction of all loading stalls. This prepares eligible fallbacks without skipping rendering work; cache rejection, uncaptured shaders and GPU removal remain separate concerns.
  • Offline preparation adds work and still respects the cold-build size cap. Matching translation settings and actual driver cache acceptance are required for reuse.

AI use
Codex (GPT-6) checked overlap, adapted and reviewed the NVIDIA integration and tests, and prepared this description. René's original #2551 work is credited in the commit.

Optional temporary Discord for coordinating contributor work, testing and comparing results: https://discord.gg/6B4TykyC4W

<!-- greyfinch-sync:ivall/xcl:issue:5540190059 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3131). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-28T12:37:36Z. --- Adapt [#2551](https://github.com/xcl-dev/xcl/pull/2551) by René (@DTsordas), original commit `3567b2efdc94617de71e50be77e107991a6bd41c`, onto `nvidia-dev` `54225f5884a94cd23b7aab3f703a7c975070aa77`. Ordinary `--precompile --pipelines` prepared split pieces but omitted the whole fallback needed by indirect dispatch. Preparing that fallback ahead of play can avoid its cold driver compile on the game's thread. This is a NVIDIA adaptation of the existing main PR. **What is in it** - Prepare the whole form with the dispatch-chain root signature and `.chain.pso` cache namespace alongside the split pieces. - Remove NVIDIA's separate startup-worker whole-form call from #2794, so each preparation call builds that form once. - Extend synthetic cache reuse, corrupt-blob and size-cap coverage; update the fresh-process reuse test and README. Runtime dispatch semantics and retained shader-source memory behavior are unchanged. **Tested** - Current PR head: `73872c0d487c6f7b001a78424e5e49ad819b9fef`. - Windows 11 Pro 26200; Intel i5-10400; NVIDIA RTX 3060 Ti driver 32.0.16.1714; Rust 1.100.0; release profile. - Combined integration `d50f6656fb50b7927a2279d4c78b24222be3da54`: `cargo build --locked --release -p xcl --target-dir <isolated-target>` exited 0 in 228.576s, with 9 warnings. This includes the change but is not a standalone build/test of this PR head. - At the combined head above: `cargo test --locked --release -p xcl --test gpu_compute_e2e <filter> --target-dir <isolated-target> -- --exact --test-threads=1 --nocapture`. Filters `offline_split_compute_pipeline_is_reused_by_a_second_process` and `a_preparation_worker_also_builds_a_split_programs_whole_form`: each **1 passed, 0 failed, 0 ignored, 7 filtered**, no SKIPPED messages. Covers cold synthetic whole/piece creation, fresh-process reuse, corrupt-blob recovery and startup avoiding duplicate whole preparation. - Two fresh CLI processes at that combined head: `xcl.exe shaders <private-exact-four> --precompile --only cs --pipelines --windows 16 --split 1`. Each accepted **60/60 cached native pipelines, 0 refused, 4 split programs/56 pieces plus four whole forms**, with one pipeline worker and matching adapter/DXC/translation settings. The four whole blobs already existed after the prior failed play session; this proves current driver acceptance, not a controlled 113-second before/after reduction or successful world entry. - At this exact PR head: `cargo test --locked --release -p xcl --lib shaders::pipeline_cap_tests::split_compute_program_prebuilds_and_caches_chain_pieces --target-dir <isolated-target> -- --exact --test-threads=1 --nocapture`: **1 passed, 0 failed, 0 ignored, 1805 filtered**, no SKIPPED messages; command wall time 384.914s including compilation. This is a synthetic native PSO/cache check, without shader dispatch. The previous head failed this test in Windows CI because it assumed the whole DXIL was larger than each piece. This fixture-only follow-up restores the rejected piece before testing a cold whole cap, so it no longer depends on compiler-specific sizes. The earlier runtime change is preserved; the full suite and new-head CI are not claimed here. - Combined integration d50f also reached loading screens in two unattended attempts, but both ended in device removal before playable world entry. The pagefault-DRED attempt showed a compute completion fence pending over ten seconds. Local GPU usage stayed below its reported budget in all captured samples; this does not establish the cause of removal. Neither attempt is a successful regression run for this focused PR. **Regression run** Pending paired clean-head main/PR title runs. No smoke result or successful world-entry result is claimed. Draft while required validation remains incomplete. **Not tested** - Exact-head title regression, full GPU workspace suite, AMD/Intel and Linux/Wine. - Complete retail shader coverage or a measured reduction of all loading stalls. This prepares eligible fallbacks without skipping rendering work; cache rejection, uncaptured shaders and GPU removal remain separate concerns. - Offline preparation adds work and still respects the cold-build size cap. Matching translation settings and actual driver cache acceptance are required for reuse. **AI use** Codex (GPT-6) checked overlap, adapted and reviewed the NVIDIA integration and tests, and prepared this description. René's original #2551 work is credited in the commit. Optional temporary Discord for coordinating contributor work, testing and comparing results: https://discord.gg/6B4TykyC4W
Aniseto commented 2026-11-28 12:55:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-28T12:55:53Z.


Ran the whole-fallback preparation tests at fb573832 on an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --test gpu_compute_e2e -- offline_split_compute_pipeline_is_reused_by_a_second_process a_preparation_worker_also_builds_a_split_programs_whole_form --test-threads=1
2 passed; 0 failed; 0 ignored; 0 measured; 6 filtered out      (exit 0)

Both tests pass: the whole .chain.pso fallback is reused by a second process and the preparation worker builds it once. The author ran these at the combined head in release on an RTX 3060 Ti; this is the standalone PR head in debug on an RTX 5070 Ti. The PR has no comments yet.

Not tested: a title's indirect dispatch, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:ivall/xcl:comment:7239567644 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3131#issuecomment-7239567644). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-28T12:55:53Z. --- Ran the whole-fallback preparation tests at `fb573832` on an NVIDIA Blackwell desktop part: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` XCL_ADAPTER=NVIDIA cargo test -p xcl --test gpu_compute_e2e -- offline_split_compute_pipeline_is_reused_by_a_second_process a_preparation_worker_also_builds_a_split_programs_whole_form --test-threads=1 2 passed; 0 failed; 0 ignored; 0 measured; 6 filtered out (exit 0) ``` Both tests pass: the whole `.chain.pso` fallback is reused by a second process and the preparation worker builds it once. The author ran these at the combined head in release on an RTX 3060 Ti; this is the standalone PR head in debug on an RTX 5070 Ti. The PR has no comments yet. Not tested: a title's indirect dispatch, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Aniseto commented 2026-11-28 13:34:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-28T13:34:24Z.


Re-ran the whole-fallback preparation tests at 73872c0d after the head moved from fb573832; this is a new response in the same thread, not an edit of my earlier report:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --test gpu_compute_e2e -- offline_split_compute_pipeline_is_reused_by_a_second_process a_preparation_worker_also_builds_a_split_programs_whole_form --test-threads=1
2 passed; 0 failed; 0 ignored; 0 measured; 6 filtered out      (exit 0)

Both tests still pass at the new head, which changes the whole-pipeline cap test to be independent of DXIL size. The thread already has my report at fb573832; this is only the new head.

Not tested: a title's indirect dispatch, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:ivall/xcl:comment:7240030994 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3131#issuecomment-7240030994). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-28T13:34:24Z. --- Re-ran the whole-fallback preparation tests at `73872c0d` after the head moved from `fb573832`; this is a new response in the same thread, not an edit of my earlier report: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` XCL_ADAPTER=NVIDIA cargo test -p xcl --test gpu_compute_e2e -- offline_split_compute_pipeline_is_reused_by_a_second_process a_preparation_worker_also_builds_a_split_programs_whole_form --test-threads=1 2 passed; 0 failed; 0 ignored; 0 measured; 6 filtered out (exit 0) ``` Both tests still pass at the new head, which changes the whole-pipeline cap test to be independent of DXIL size. The thread already has my report at `fb573832`; this is only the new head. Not tested: a title's indirect dispatch, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
KDenKC commented 2026-11-28 17:32:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-28T17:32:04Z.


@Prime1997 we ran the whole suite of your head on an RTX 3090 against its base on the same machine: no failure the base doesn't have. Your two changed tests pass:

  • shaders::pipeline_cap_tests::split_compute_program_prebuilds_and_caches_chain_pieces: the pieces, the whole form under the chain root signature, and the caps;
  • tests\gpu_compute_e2e.rs: 8 passed.

Tested: 73872c0d and its base nvidia-dev 54225f58.

  • RTX 3090 24 GB, NVIDIA 621.24, i7-10700T x8 (a VM with the GPU passed through), Windows 11 26H2 (26300.9974), Rust 1.99.1 (stable-x86_64-pc-windows-msvc), debug, no XCL_* set.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 --skip uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom --skip uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment --skip uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window
    • Those three end the lib test binary on 621.24, at the base too.
  • base: 1,900 passed, 7 failed, 48 ignored; head: 1,900 passed, 7 failed, 48 ignored. The PR changes tests and adds none, so the count is the same.
  • The 7 failures are the same tests on both, and they come from this VM:
    • 4 title_textures: one 0x8007000E in the full run, which passes alone, and three PoisonError from it;
    • 2 vram 0x8007000E;
    • e2e test_title_runs_and_game_folder_is_untouched.
  • SKIPPED: 30, the same on both.

A note from reading it: a title's launch workers already build the whole forms, since precompile does it when XCL_PRECOMPILE_PARENT is set (shaders.rs ~2191, removed here and moved into Pipelines::make). So the change shows for a plain xcl shaders --precompile --pipelines run, as the README line says.

Not tested: a timed offline --precompile --pipelines pass on a title's pack; a title run; a release build; AMD / Intel.

AI use: an agent swarm: Claude Fable 5.2, Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.

<!-- greyfinch-sync:ivall/xcl:comment:7243090472 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3131#issuecomment-7243090472). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-28T17:32:04Z. --- @Prime1997 we ran the whole suite of your head on an RTX 3090 against its base on the same machine: **no failure the base doesn't have**. Your two changed tests pass: - `shaders::pipeline_cap_tests::split_compute_program_prebuilds_and_caches_chain_pieces`: the pieces, the whole form under the chain root signature, and the caps; - `tests\gpu_compute_e2e.rs`: 8 passed. **Tested:** `73872c0d` and its base `nvidia-dev` `54225f58`. - RTX 3090 24 GB, NVIDIA 621.24, i7-10700T x8 (a VM with the GPU passed through), Windows 11 26H2 (26300.9974), Rust 1.99.1 (stable-x86_64-pc-windows-msvc), debug, no `XCL_*` set. - `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom --skip uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment --skip uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window` - Those three end the lib test binary on 621.24, at the base too. - base: 1,900 passed, 7 failed, 48 ignored; head: **1,900 passed, 7 failed, 48 ignored**. The PR changes tests and adds none, so the count is the same. - The 7 failures are the same tests on both, and they come from this VM: - 4 `title_textures`: one `0x8007000E` in the full run, which passes alone, and three `PoisonError` from it; - 2 `vram` `0x8007000E`; - `e2e` `test_title_runs_and_game_folder_is_untouched`. - SKIPPED: 30, the same on both. A note from reading it: a title's launch workers already build the whole forms, since `precompile` does it when `XCL_PRECOMPILE_PARENT` is set (`shaders.rs` ~2191, removed here and moved into `Pipelines::make`). So the change shows for a plain `xcl shaders --precompile --pipelines` run, as the README line says. **Not tested:** a timed offline `--precompile --pipelines` pass on a title's pack; a title run; a release build; AMD / Intel. AI use: an agent swarm: Claude Fable 5.2, Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.
andrewDoing commented 2026-11-28 17:48:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T17:48:32Z.


One cache-layout control on 73872c0d: a valid ordinary whole .pso for the same compute DXIL did not make a missing dispatch-chain whole .chain.pso count as warm. This matters when interpreting an offline preparation run after changing split settings.

I extended the stock synthetic split fixture locally. Both pieces were already cached. I removed the chained whole and used production Pipelines::make_one with the ordinary ABI root signature to create the ordinary whole. Then I called production Pipelines::make three times:

Cold-build cap Reused Newly built Capped Chained whole on disk
One byte below whole DXIL size 2 pieces 0 1 Absent
Disabled 2 pieces 1 whole 0 Present
Restored to the first setting 2 pieces + whole 0 0 Present

The ordinary blob remained byte-for-byte unchanged in all three passes. Thus an over-cap missing fallback still needs one preparation pass that permits its cold build; afterwards the lower cap admits its valid cached form. XCL_ADAPTER=5070 on an RTX 5070, Windows MSVC debug, DXC 1.8.2502.11. One test passed without skips. This used native PSO creation and disk caching, with no shader dispatch, title data or timing claim.

AI use: OpenAI Codex prepared the test-only extension, ran the controls and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7243302743 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3131#issuecomment-7243302743). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-28T17:48:32Z. --- One cache-layout control on `73872c0d`: a valid ordinary whole `.pso` for the **same compute DXIL** did not make a missing dispatch-chain whole `.chain.pso` count as warm. This matters when interpreting an offline preparation run after changing split settings. I extended the stock synthetic split fixture locally. Both pieces were already cached. I removed the chained whole and used production `Pipelines::make_one` with the ordinary ABI root signature to create the ordinary whole. Then I called production `Pipelines::make` three times: | Cold-build cap | Reused | Newly built | Capped | Chained whole on disk | |---|---:|---:|---:|---| | One byte below whole DXIL size | 2 pieces | 0 | 1 | Absent | | Disabled | 2 pieces | 1 whole | 0 | Present | | Restored to the first setting | 2 pieces + whole | 0 | 0 | Present | The ordinary blob remained byte-for-byte unchanged in all three passes. Thus an over-cap missing fallback still needs one preparation pass that permits its cold build; afterwards the lower cap admits its valid cached form. `XCL_ADAPTER=5070` on an RTX 5070, Windows MSVC debug, DXC 1.8.2502.11. One test passed without skips. This used native PSO creation and disk caching, with no shader dispatch, title data or timing claim. AI use: OpenAI Codex prepared the test-only extension, ran the controls and wrote this report.
Prime1997 commented 2026-11-28 21:50:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T21:50:31Z.


Closing as a duplicate. This was the nvidia-dev port of #2551 by DTsordas. nvidia-dev was merged into main by #3203 and this PR was retargeted to main, where #2551 is open with the same change. Checked and closed with Claude Code on Prime's behalf.

<!-- greyfinch-sync:ivall/xcl:comment:7246312854 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3131#issuecomment-7246312854). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-28T21:50:31Z. --- Closing as a duplicate. This was the `nvidia-dev` port of #2551 by DTsordas. `nvidia-dev` was merged into `main` by #3203 and this PR was retargeted to `main`, where #2551 is open with the same change. Checked and closed with Claude Code on Prime's behalf.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!3131
No description provided.