Skip to content

Shaders: scheduling and diagnostic switches leave the warm pipeline key alone - #3308

Merged
raylitebull merged 1 commit into
xcl-dev:mainfrom
grahamster2:pr/warm-key-knobs
Nov 29, 2026
Merged

raylitebull merged 1 commit into
xcl-dev:mainfrom
grahamster2:pr/warm-key-knobs

Conversation

@grahamster2

Copy link
Copy Markdown
Collaborator

warm_settings hashes every XCL_* variable except an exclusion list into the key of the driver-blob / pipeline-recipe cache. Changing a runtime knob between runs (a wait budget, the huge-compile slots, the disk-cache threshold, a dump switch) therefore made every saved blob miss and forced a full pipeline re-preparation: about 10 minutes on an RTX 3080, seen several times. With these switches out of the key, a run after such a change prepared in 15 s and 12 s from disk.

Now also left out, each checked where it is read on main: the bind wait budgets (XCL_PSO_WAIT_MS, XCL_GFX_PSO_WAIT_MS), the huge-compile gate (XCL_HUGE_PSO_CONCURRENCY, XCL_HUGE_PSO_WANTED_CONCURRENCY), which builds keep a disk file (XCL_PSO_DISK_CACHE_MIN_MS), the sync watchdogs (XCL_GPU_WAIT_TIMEOUT_MS, and XCL_WAIT_TIMEOUT_MS: how long the CPU waits for a Wait32BitValueX / Wait64BitValueX nothing satisfies, read only by list_x::wait_timeout), target dumps (XCL_DUMP_TARGETS, XCL_DUMP_AFTER_S), XCL_THREAD_DUMP_AT, XCL_NETWORK, XCL_DRED (device-removal reporting), XCL_PLACE_RETIRE (resource placement), XCL_PLACE_CHECK (only logs and counts placements over live textures: placements::check), and the logging-only XCL_TRACE_* family. None of them changes a pipeline description, its DXIL or its root signature. Translation, heap/UMA, device and page-alias switches stay in the key. Switches that other open PRs add (e.g. XCL_HUGE_PSO_HANDOFFS, XCL_HELD_WAIT_CAP_MS) are not listed here; each can add its own name.

No issue.

What is in it

  • crates/xcl/src/shaders.rs: the longer exclusion list in warm_settings, and test warm_settings_ignore_waits_watchdogs_and_traces_but_keep_pipeline_switches. It checks each of the 14 newly excluded names and two XCL_TRACE_ ones on its own and all together, that XCL_PAGE_ALIAS stays in the key, and that only the XCL_TRACE_ family is matched as a prefix. It fails without the change (checked by putting back main's list).

Tested

  • NVIDIA GeForce RTX 3080 10 GB, driver 610.88; AMD Ryzen 5 7600X; Windows 11 build 10.0.26200.9974; rustc 1.94.0 (4a4ef493e 2026-03-02); tests in the debug profile, smoke runs on a release build (cargo build --release -p xcl)
  • on ef599bcb3dbfb9d6833fc33184cb2fe3f350ed0f: cargo build --workspace ok; cargo test --workspace -- --test-threads=4: 2609 passed, 0 failed, 49 ignored
  • 29 SKIPPED lines on this adapter (no wave64 on NVIDIA, no heap windows, no D3D12 debug layer):
    • SKIPPED gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole: no wave64
    • SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64
    • SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64
    • SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64
    • SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu: const_mask, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))
    • SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))
    • SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))
    • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: f64, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64
    • SKIPPED gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu: mask_ff0_flbit, wave64: no wave64
    • SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
    • SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
    • SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
    • SKIPPED hle::d3d12x::bind::tests::two_pass_binds_set_the_shared_view_heap: no heap windows (opt-in: XCL_HEAP_WINDOWS=1)
    • SKIPPED the title under the debug layer (dred: false): no d3d12SDKLayers.dll
    • SKIPPED the title under the debug layer (dred: true): no d3d12SDKLayers.dll
    • SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D))

Regression run

  • scripts/smoke.ps1 -Game <title folder> -Seconds 60 -StartupTimeoutSeconds 900 with XCL_DEVICE_TYPE=lockhart XCL_PREPARE=0 (Series S mode as in the contributor's runs; no startup shader preparation, so pipelines are built in game) (smoke.ps1 sets XCL_NETWORK=0); same retail title, same settings for both runs. Both stay on the title's first screens (about 660 draws per 2 s) for the 60 s.

main:

xcl-smoke v1
commit: fa204595a488c60c6c5f905244f0172072c9c2a9
gpu: NVIDIA GeForce RTX 3080
title: 5d6132ca
seconds: 60
exit: 0x0
frames shown: 1680 (PresentX 1680)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 12321 MB

this PR's head:

xcl-smoke v1
commit: ef599bcb3dbfb9d6833fc33184cb2fe3f350ed0f
gpu: NVIDIA GeForce RTX 3080
title: 5d6132ca
seconds: 60
exit: 0x0
frames shown: 1676 (PresentX 1676)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 12350 MB

Not tested

  • The ~10 min re-preparations and the 15 s / 12 s preparation times were measured on the contributor's development build with this change, not on this PR's head. The smoke runs above use the same switches on both sides, so they do not exercise a key change.
  • AMD GPUs, other titles.

AI use

  • Claude Code with Claude Opus 5.5: wrote the code and tests, ran the tests and smoke runs, drafted this description. A separate Claude Code agent that did not write the change reviewed the diff adversarially and its findings were fixed before opening.

…ey alone

warm_settings hashes every XCL_* variable but an exclusion list into the
key of the driver-blob / pipeline-recipe cache, so changing a runtime
knob between runs made every saved blob miss and forced a full pipeline
re-preparation (about 10 min on an RTX 3080, seen several times).

Now also left out, each checked where it is read: the bind wait budgets
(XCL_PSO_WAIT_MS, XCL_GFX_PSO_WAIT_MS: how long a bind waits before the
stand-in), the huge-compile gate (XCL_HUGE_PSO_CONCURRENCY,
XCL_HUGE_PSO_WANTED_CONCURRENCY), which builds keep a disk file
(XCL_PSO_DISK_CACHE_MIN_MS), the sync watchdogs (XCL_GPU_WAIT_TIMEOUT_MS,
and XCL_WAIT_TIMEOUT_MS: the CPU wait for an unsatisfied
Wait32/64BitValueX), target dumps (XCL_DUMP_TARGETS, XCL_DUMP_AFTER_S),
XCL_THREAD_DUMP_AT, XCL_NETWORK, XCL_DRED (device-removal reporting),
XCL_PLACE_RETIRE (resource placement), XCL_PLACE_CHECK (logs and counts
placements over live textures only), and the logging-only XCL_TRACE_*
family. None of them changes a pipeline description, its DXIL or root
signature. Translation, heap/UMA, device and page-alias switches stay in
the key. shaders.rs is not a translation cache input.

Test: warm_settings_ignore_waits_watchdogs_and_traces_but_keep_pipeline_switches
(each of the 14 names and two XCL_TRACE_ ones on its own and all
together; fails before this change).

Assisted-by: Claude Code (Claude Opus 5.5)
@github-actions github-actions Bot added area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) labels Nov 29, 2026
@andrewDoing

Copy link
Copy Markdown
Contributor

Six fresh Windows processes checked receipt reuse on ef599bc using the production warm_settings_key, Verified disk reader and stamp, with a previously generated RTX 5070 compute blob (1,358 bytes). I held the build/device/translation/path components of the native identity fixed in the harness. A cold process wrote a receipt. With XCL_PSO_WAIT_MS and XCL_TRACE_SHADERS changed, the next process hit that receipt. Changing one byte supplied to stamp under the same settings missed. Adding XCL_PS_EXPORT_PATCH=0 or XCL_DIRECT_DXIL=1 gave separate identities and misses; clearing the semantic override restored the hit.

This also narrows what “saved blob miss” means in the description. warm_settings_key feeds the validation/replay identity and completed library receipt. The raw compute .pso filename is selected from the DXIL, root/samplers, flags and node mask separately. An unmatched receipt can lead to revalidation of an existing blob; it doesn't by itself show a cold driver compile. #3209's translated-pixel cache still needs its own mode suffix to select the right DXIL before these preparation keys are used.

The controls exercised receipt selection on disk, using ordinary file writes for the harness's single-writer save. No new driver compilation or timing measurement. OpenAI Codex prepared and ran the controls and drafted this comment.

@bmjask

bmjask commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Current-main audit (2026-11-29): rebase/retest, then merge candidate.

I read the full one-file diff at ef599bcb and checked it against current main (3b6a91ed). This changes only warm_settings; it does not change DXIL, root signatures, PSO descriptors, or driver-blob naming, so the intended result is to preserve existing PSO cache identity when scheduling/diagnostic knobs change. main already excludes XCL_HUGE_PSO_CONCURRENCY; the remaining exclusions are still runtime/diagnostic-only at current call sites.

Two blockers before merge: the required Windows build is currently red (four pipeline-library/warm-library tests in that run), so this needs a current-main rebase and rerun; and the blanket name.starts_with("XCL_TRACE_") creates a future footgun if a later XCL_TRACE_* switch ever changes generated code. An explicit current list, or a documented/tested invariant that the prefix is observation-only, would make this safer.

Cache impact: safe for existing PSO blobs/libraries; this PR is specifically a cache-bust prevention change.

Review assisted by Codex; exact model name was not exposed in this session. I did not run a game or full PSO sweep.

@Prime1997 Prime1997 added test-only A maintainer reviewed the diff: tests only, no smoke run needed for this revision (CONTRIBUTING.md) gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) and removed gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) labels Nov 29, 2026
@raylitebull
raylitebull merged commit 0fe06eb into xcl-dev:main Nov 29, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) test-only A maintainer reviewed the diff: tests only, no smoke run needed for this revision (CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants