Skip to content

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

Closed
Prime1997 wants to merge 2 commits into
xcl-dev:mainfrom
Prime1997:codex/nv-whole-precompile-pr-20261128
Closed

Prime1997 wants to merge 2 commits into
xcl-dev:mainfrom
Prime1997:codex/nv-whole-precompile-pr-20261128

Conversation

@Prime1997

@Prime1997 Prime1997 commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

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 Shaders: a title's preparation workers build split programs' whole forms #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

Adapt xcl-dev#2551 (3567b2e) by Rene / DTsordas to nvidia-dev integration. The ordinary offline pass omitted whole chain forms, leaving the runtime to compile them synchronously when needed. Reuse the existing chain root signature and driver-cache path, and remove the startup-only duplicate call.

Preserve WholeSource and earlier memory repairs. Extend synthetic cache reuse and cap coverage; native tests are delegated to the integration owner and have not yet run for this commit.

Co-authored-by: René <153442863+DTsordas@users.noreply.github.com>

Assisted-by: Codex (GPT-6)
@Aniseto

Aniseto commented Nov 28, 2026

Copy link
Copy Markdown

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.

The Windows CI compiler emitted a whole fixture no larger than its pieces, so the size-order assertion failed before the cold whole cache-cap check. Rebuild the previously rejected piece first, then remove only the whole cache entry and cap it at its own DXIL length minus one. Assert both cached pieces are reused and the missing whole is capped independently of compiler size ordering.

Fixture only; runtime behavior unchanged. Reviewed the fixture and diff; git diff --check passes. Native execution is deferred to the integration owner after gameplay ends.

Assisted-by: Codex (GPT-6)
@Aniseto

Aniseto commented Nov 28, 2026

Copy link
Copy Markdown

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

KDenKC commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

@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

Copy link
Copy Markdown
Contributor

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
Prime1997 changed the base branch from nvidia-dev to main November 28, 2026 20:12
@Prime1997

Copy link
Copy Markdown
Collaborator Author

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.

@Prime1997 Prime1997 closed this Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants