Shaders: validate DXIL containers in the translated/v2 disk cache #2064

Manually merged
github merged 1 commit from gh-pr/2064/head into gh-pr/2064/base 2026-11-26 05:17:16 +00:00
Owner

@⁠RandomGithub12309 on GitHub · 2026-11-25 02:32 UTC · original
RandomGithub12309:shaders/validate-translated-cache-dxil → main · +118 −14 · 2 files · 1 commits · merged 2026-11-25 10:41 UTC

dxc::compile_cached_in_observed validates valid_dxil_container on both disk loads and fresh writes (and removes corrupt targets before renaming on Windows), preventing corrupt cached DXIL from reaching Create*PipelineState.

However, translated/v2 in pso.rs runs ahead of dxc::compile_cached (and is the only disk cache for XCL_DIRECT_DXIL), and its XCLTRAN2 header hashes only the input console shader blob rather than the stored DXIL payload:

  • translated::load_in accepted any payload whose length matched the 4-byte length field — including zero-filled or corrupted DXIL blocks — returning corrupt bytecode on every run forever.
  • translated::store_in and translated::cached_in persisted unvalidated DXIL payloads and dropped the replacement .tmp file if rename failed over an existing target on Windows.

What is in it

  • crates/xcl/src/gpu/recomp/dxc.rs:
    • Expose existing valid_dxil_container as pub(super).
  • crates/xcl/src/gpu/recomp/pso.rs:
    • Validate dxc::valid_dxil_container in translated::load_in, translated::store_in, and translated::cached_in (returning Err("translated cache: translator returned an invalid DXIL container") on an invalid fresh translation without writing to disk).
    • Bound the sampler count in translated::load_in against remaining bytes (n > r.len() / 17).
    • In translated::store_in, remove an existing target and retry rename before deleting .tmp.
    • Update existing shader_cache_tests fixtures to use valid synthetic DXBC/DXIL containers and add two regression tests (both fail before the fix and pass after):
      • translated_cache_rejects_corrupt_dxil_payload_and_rebuilds
      • translated_cache_rejects_invalid_fresh_dxil_without_poisoning_disk (including round-tripping a container emitted by gpu::dxil::shader::Shader).

Tested

Hardware: Windows 11 (Build 26300), Intel Core Ultra 7 255HX, NVIDIA GeForce RTX 5050 Laptop GPU (wave32-only, driver 32.0.16.2114), rustc 1.100.0 (0ef1bc386 2026-11-09) stable-x86_64-pc-windows-msvc, Windows SDK DXC 1.8.2502.11.

  • Verified both new regression tests fail before the fix:
    • cargo test -p xcl --lib gpu::recomp::pso::shader_cache_tests::translated_cache_rejects -- --test-threads=1 → 0 passed; 2 failed (zeroed DXIL payload must not load as a cache hit, invalid fresh DXIL must be rejected).
  • Verified with the fix (743a612):
    • cargo test -p xcl --lib gpu::recomp::pso -- --test-threads=4 → 18 passed; 0 failed; 1 ignored (repeated_pso_shader_compile, pre-existing #[ignore] bench).
    • cargo build --workspace → succeeded.
    • cargo test --workspace -- --test-threads=4 --skip fuzz_validate_and_gpu:
      • xcl lib: 1096 passed; 0 failed; 26 ignored; 4 filtered out (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0..3}, pre-existing RTX 50 0x8007000E failure tracked by #1905); 24 SKIPPED lines printed inside passing tests (20 wave64 / no-wave64 sub-cases, 3 wave32 per-lane refused sub-cases, 1 pso_measurement_compiles_an_exact_synthetic_record due to Developer Mode being off).
      • Integration tests (17 binaries): 56 passed; 0 failed; 20 ignored (1 SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows in gpu_compute_e2e).
      • Workspace total: 1152 passed; 0 failed; 46 ignored; 4 filtered out (25 SKIPPED notices).

Regression run

Baseline (upstream/main):

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: NVIDIA GeForce RTX 5050 Laptop GPU
title: e61570a3
seconds: 60
exit: 0x0
frames shown: 1599 (PresentX 1600)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14359 MB

PR head (743a612):

xcl-smoke v1
commit: 743a612e5821d88efb96205103b5287110fc3075
gpu: NVIDIA GeForce RTX 5050 Laptop GPU
title: e61570a3
seconds: 60
exit: 0x0
frames shown: 1507 (PresentX 1507)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14345 MB

(The PR run populated a fresh translated/v2 namespace because editing pso.rs / dxc.rs updates XCL_TRANSLATOR_SOURCE_ID, then ran at steady 60 60 60 presents per 2 s.)

Not tested

  • Wave64-only GPU tests (RTX 5050 is wave32-only), gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0..3} (#1905), and pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode not enabled on this host).
  • An on-disk translated/v2 corruption triggered by an OS power loss during a retail title run (exercised via unit tests instead).

AI use

Antigravity (Gemini 4 Neon) identified the missing DXIL container validation in translated/v2, implemented the fix and regression tests, ran the test suite and smoke runs, and drafted this PR description.

**@⁠RandomGithub12309** on GitHub · 2026-11-25 02:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/2064) `RandomGithub12309:shaders/validate-translated-cache-dxil` → `main` · +118 −14 · 2 files · 1 commits · merged 2026-11-25 10:41 UTC `dxc::compile_cached_in_observed` validates `valid_dxil_container` on both disk loads and fresh writes (and removes corrupt targets before renaming on Windows), preventing corrupt cached DXIL from reaching `Create*PipelineState`. However, `translated/v2` in `pso.rs` runs ahead of `dxc::compile_cached` (and is the only disk cache for `XCL_DIRECT_DXIL`), and its `XCLTRAN2` header hashes only the input console shader blob rather than the stored DXIL payload: - `translated::load_in` accepted any payload whose length matched the 4-byte length field — including zero-filled or corrupted DXIL blocks — returning corrupt bytecode on every run forever. - `translated::store_in` and `translated::cached_in` persisted unvalidated DXIL payloads and dropped the replacement `.tmp` file if `rename` failed over an existing target on Windows. **What is in it** - `crates/xcl/src/gpu/recomp/dxc.rs`: - Expose existing `valid_dxil_container` as `pub(super)`. - `crates/xcl/src/gpu/recomp/pso.rs`: - Validate `dxc::valid_dxil_container` in `translated::load_in`, `translated::store_in`, and `translated::cached_in` (returning `Err("translated cache: translator returned an invalid DXIL container")` on an invalid fresh translation without writing to disk). - Bound the sampler count in `translated::load_in` against remaining bytes (`n > r.len() / 17`). - In `translated::store_in`, remove an existing target and retry `rename` before deleting `.tmp`. - Update existing `shader_cache_tests` fixtures to use valid synthetic DXBC/DXIL containers and add two regression tests (both fail before the fix and pass after): - `translated_cache_rejects_corrupt_dxil_payload_and_rebuilds` - `translated_cache_rejects_invalid_fresh_dxil_without_poisoning_disk` (including round-tripping a container emitted by `gpu::dxil::shader::Shader`). **Tested** Hardware: Windows 11 (Build 26300), Intel Core Ultra 7 255HX, NVIDIA GeForce RTX 5050 Laptop GPU (wave32-only, driver 32.0.16.2114), `rustc 1.100.0 (0ef1bc386 2026-11-09)` `stable-x86_64-pc-windows-msvc`, Windows SDK DXC `1.8.2502.11`. - Verified both new regression tests fail before the fix: - `cargo test -p xcl --lib gpu::recomp::pso::shader_cache_tests::translated_cache_rejects -- --test-threads=1` → `0 passed; 2 failed` (`zeroed DXIL payload must not load as a cache hit`, `invalid fresh DXIL must be rejected`). - Verified with the fix (`743a612`): - `cargo test -p xcl --lib gpu::recomp::pso -- --test-threads=4` → `18 passed; 0 failed; 1 ignored` (`repeated_pso_shader_compile`, pre-existing `#[ignore]` bench). - `cargo build --workspace` → succeeded. - `cargo test --workspace -- --test-threads=4 --skip fuzz_validate_and_gpu`: - `xcl` lib: `1096 passed; 0 failed; 26 ignored; 4 filtered out` (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0..3}`, pre-existing RTX 50 `0x8007000E` failure tracked by #1905); `24 SKIPPED` lines printed inside passing tests (20 wave64 / no-wave64 sub-cases, 3 wave32 per-lane refused sub-cases, 1 `pso_measurement_compiles_an_exact_synthetic_record` due to Developer Mode being off). - Integration tests (17 binaries): `56 passed; 0 failed; 20 ignored` (`1 SKIPPED`: `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows` in `gpu_compute_e2e`). - Workspace total: `1152 passed; 0 failed; 46 ignored; 4 filtered out` (`25 SKIPPED` notices). **Regression run** Baseline (`upstream/main`): ``` xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: NVIDIA GeForce RTX 5050 Laptop GPU title: e61570a3 seconds: 60 exit: 0x0 frames shown: 1599 (PresentX 1600) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14359 MB ``` PR head (`743a612`): ``` xcl-smoke v1 commit: 743a612e5821d88efb96205103b5287110fc3075 gpu: NVIDIA GeForce RTX 5050 Laptop GPU title: e61570a3 seconds: 60 exit: 0x0 frames shown: 1507 (PresentX 1507) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14345 MB ``` (The PR run populated a fresh `translated/v2` namespace because editing `pso.rs` / `dxc.rs` updates `XCL_TRANSLATOR_SOURCE_ID`, then ran at steady `60 60 60` presents per 2 s.) **Not tested** - Wave64-only GPU tests (RTX 5050 is wave32-only), `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0..3}` (#1905), and `pso_measurement_compiles_an_exact_synthetic_record` (Windows Developer Mode not enabled on this host). - An on-disk `translated/v2` corruption triggered by an OS power loss during a retail title run (exercised via unit tests instead). **AI use** Antigravity (Gemini 4 Neon) identified the missing DXIL container validation in `translated/v2`, implemented the fix and regression tests, ran the test suite and smoke runs, and drafted this PR description.
`dxc::compile_cached_in_observed` validates `valid_dxil_container` on
both disk read and fresh writes, and removes corrupt targets before
renaming on Windows. `translated/v2` (`pso.rs`) sits in front of
`dxc::compile_cached` (and is the only disk cache for `XCL_DIRECT_DXIL`),
so a corrupt or zero-filled DXIL payload inside a valid `XCLTRAN2`
header bypassed container validation and was handed straight to D3D12
on every run.

Expose `dxc::valid_dxil_container` to the `recomp` module and check it
in `translated::load_in`, `store_in`, and `cached_in` (along with a
sampler-count bounds check in `load_in` and remove-then-retry rename in
`store_in`).

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:17:14 +00:00
github manually merged commit 743a612e58 into gh-pr/2064/base 2026-11-26 05:17:16 +00:00
Author
Owner

@⁠Parakeet-Wheat on GitHub · 2026-11-25 03:30 UTC · original

NVIDIA RTX 3070 on native Windows, head 743a612 on its base cbc296a (current main): both new tests fail without the fix and pass with it, the whole suite passes, and the smoke pair is within the limits. The smoke run writes 143 translated/v2 entries and logs no invalid DXIL container rejection.

Tested

  • NVIDIA GeForce RTX 3070 8 GB (driver 610.88, 32-lane waves), Ryzen 5 5600X, 32 GB, Windows 11 26300, Rust 1.95.0 stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11, retail 1.0.2.1. Head 743a612 (one commit on main cbc296a), checked out clean. Tests in the debug profile, smoke in release.
  • cargo test -p xcl --lib translated_cache_rejects -- --nocapture --test-threads=1:
    • on cbc296a with the PR's pso.rs but its four hunks above the test module (translated::load_in, store_in, cached_in) reverted: 2 failed, 0 passed, zeroed DXIL payload must not load as a cache hit and invalid fresh DXIL must be rejected;
    • on 743a612: 2 passed, 0 failed.
  • .\scripts\test.ps1 (cargo build --workspace, then cargo test --workspace -- --test-threads=4) on 743a612: 1156 passed, 0 failed, 46 ignored, exit 0. SKIPPED, 25: 20 × no wave64, 3 × per-lane form refused (V_CVT_F16_F32, V_PK_MUL_F16, V_MUL_F16: "its #1426 semantics differ from the console's"), 1 × no heap windows, 1 × cannot disable the driver cache (Windows Developer Mode required).

Regression run (scripts/smoke.ps1 -Game <folder> -Seconds 60, the same title, back to back, menus, no input; unedited). main cbc296a:

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: NVIDIA GeForce RTX 3070
title: 3d7db37d
seconds: 60
exit: 0x0
frames shown: 1415 (PresentX 1415)
presents per 2 s (last 3): 43 60 60
device removals: 0
crashes: 0
peak commit: 16803 MB

PR head 743a612:

xcl-smoke v1
commit: 743a612e5821d88efb96205103b5287110fc3075
gpu: NVIDIA GeForce RTX 3070
title: 3d7db37d
seconds: 60
exit: 0x0
frames shown: 1462 (PresentX 1462)
presents per 2 s (last 3): 18 48 60
device removals: 0
crashes: 0
peak commit: 17470 MB

That is 103 % of main's frames and 104 % of its peak commit. Both runs start with an empty translated/v2 namespace (the source id differs per commit). The PR's run wrote 143 entries there, main's 144; neither log has an ERROR line, both have 76 WARN lines, and the PR's has no translated cache: translator returned an invalid DXIL container, so the validator accepted every fresh translation this title makes in the menus. One run each: the 18 48 60 tail of the PR's run (against 43 60 60 on main) is not something I repeated.

Not tested

  • A real corrupted translated/v2 file on disk in a retail run (the two new unit tests cover it), a world run, AMD, native wave64 (the 20 no wave64 skips above), the tests on game data (XCL_SAMPLE_* not set).

AI use

  • Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report. The account owner has not reviewed it.
**@⁠Parakeet-Wheat** on GitHub · 2026-11-25 03:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/2064#issuecomment-7151976388) NVIDIA RTX 3070 on native Windows, head `743a612` on its base `cbc296a` (current `main`): both new tests fail without the fix and pass with it, the whole suite passes, and the smoke pair is within the limits. The smoke run writes 143 `translated/v2` entries and logs no `invalid DXIL container` rejection. **Tested** - NVIDIA GeForce RTX 3070 8 GB (driver `610.88`, 32-lane waves), Ryzen 5 5600X, 32 GB, Windows 11 26300, Rust 1.95.0 `stable-x86_64-pc-windows-msvc`, DXC 1.8.2502.11, retail 1.0.2.1. Head `743a612` (one commit on `main` `cbc296a`), checked out clean. Tests in the debug profile, smoke in release. - `cargo test -p xcl --lib translated_cache_rejects -- --nocapture --test-threads=1`: - on `cbc296a` with the PR's `pso.rs` but its four hunks above the test module (`translated::load_in`, `store_in`, `cached_in`) reverted: **2 failed, 0 passed**, `zeroed DXIL payload must not load as a cache hit` and `invalid fresh DXIL must be rejected`; - on `743a612`: **2 passed**, 0 failed. - `.\scripts\test.ps1` (`cargo build --workspace`, then `cargo test --workspace -- --test-threads=4`) on `743a612`: **1156 passed, 0 failed, 46 ignored**, exit 0. SKIPPED, 25: 20 × `no wave64`, 3 × per-lane form refused (`V_CVT_F16_F32`, `V_PK_MUL_F16`, `V_MUL_F16`: "its #1426 semantics differ from the console's"), 1 × `no heap windows`, 1 × cannot disable the driver cache (Windows Developer Mode required). **Regression run** (`scripts/smoke.ps1 -Game <folder> -Seconds 60`, the same title, back to back, menus, no input; unedited). `main` `cbc296a`: ``` xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: NVIDIA GeForce RTX 3070 title: 3d7db37d seconds: 60 exit: 0x0 frames shown: 1415 (PresentX 1415) presents per 2 s (last 3): 43 60 60 device removals: 0 crashes: 0 peak commit: 16803 MB ``` PR head `743a612`: ``` xcl-smoke v1 commit: 743a612e5821d88efb96205103b5287110fc3075 gpu: NVIDIA GeForce RTX 3070 title: 3d7db37d seconds: 60 exit: 0x0 frames shown: 1462 (PresentX 1462) presents per 2 s (last 3): 18 48 60 device removals: 0 crashes: 0 peak commit: 17470 MB ``` That is 103 % of `main`'s frames and 104 % of its peak commit. Both runs start with an empty `translated/v2` namespace (the source id differs per commit). The PR's run wrote 143 entries there, `main`'s 144; neither log has an ERROR line, both have 76 WARN lines, and the PR's has no `translated cache: translator returned an invalid DXIL container`, so the validator accepted every fresh translation this title makes in the menus. One run each: the `18 48 60` tail of the PR's run (against `43 60 60` on `main`) is not something I repeated. **Not tested** - A real corrupted `translated/v2` file on disk in a retail run (the two new unit tests cover it), a world run, AMD, native wave64 (the 20 `no wave64` skips above), the tests on game data (`XCL_SAMPLE_*` not set). **AI use** - Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report. The account owner has not reviewed it.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-25 03:27 UTC · original · edited 2026-11-25 03:32 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 743a612 (on its base cbc296a).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1144 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: translated_cache_rejects_corrupt_dxil_payload_and_rebuilds, translated_cache_rejects_invalid_fresh_dxil_without_poisoning_disk.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1155 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 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))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 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))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main cbc296a too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-25 03:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2064#issuecomment-7151935453) · edited 2026-11-25 03:32 UTC Full-suite run, since this PR has no test report yet. Tested exact head `743a612` (on its base `cbc296a`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1144 passed, 0 failed, 44 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `translated_cache_rejects_corrupt_dxil_payload_and_rebuilds`, `translated_cache_rejects_invalid_fresh_dxil_without_poisoning_disk`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1155 passed, 0 failed, 46 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `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))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `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))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `cbc296a` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠AmateurWizrd on GitHub · 2026-11-25 04:41 UTC · original

Test report on 743a612 (head as it is) against its base cbc296a: the new validation rejected no real cache entry on the retail title. On both shader paths, warm runs rewrote 0 cache files on the head, the same as on the base. gpu::recomp tests: RTX 5070 Ti 355 passed / 0 failed; native wave64 on an RDNA2 integrated GPU 353 passed / 2 failed, and the same 2 fail on the base.

Cache, release builds, retail title, 60 s per run (XCL_RUN_SECONDS=60, XCL_NETWORK=0, scripted menu input). Run 1 starts from an empty shader cache, runs 2 and 3 reuse it; "rewritten" counts cache files whose write time is after the run's start:

Build Path Run 1: files written (translated .bin) Run 2: rewritten Run 3: rewritten Exit
base cbc296a HLSL 62 (29) 0 0 0, 0, 0
base cbc296a XCL_DIRECT_DXIL=1 59 (29) 0 0 0, 0, 0
head 743a612 HLSL 62 (29) 0 0 0, 0, 0
head 743a612 XCL_DIRECT_DXIL=1 59 (29) 0 0 0, 0, 0

cargo test -p xcl --lib -- gpu::recomp --test-threads=4, debug:

GPU Commit Passed Failed Ignored
RTX 5070 Ti head 743a612 355 0 19
Radeon integrated (RDNA2), XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64 head 743a612 353 2 19
Radeon integrated (RDNA2), XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64 base cbc296a 351 2 19

The 2 failures on the Radeon, on both commits, are f16_programs_on_the_gpu and f32_programs_on_the_gpu. They come from the harness, not from this PR: their wave32 per-lane cases are refused (unsupported V_MUL_F16 / V_CVT_F16_F32 (its #1426 semantics differ from the console's)), and skip_test (runner.rs:617-628) turns every skip except "no mesh shaders" into a failure when XCL_REQUIRE_GPU=wave64 is set, a refusal included. This is the same pattern as #1651. The head has 2 more passing tests than the base: this PR's two new cache tests.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB, driver 621.01 (32-lane waves only); AMD Radeon integrated graphics of a Ryzen 7 7800X3D (RDNA2, wave32 and wave64), driver 32.0.21045.16010; 32 GB RAM; Windows 11 build 26200; Rust 1.100.0
  • Builds from clean checkouts with --locked --offline; title runs and tests started under a local account without network access

Not tested

  • Cache entries corrupted on purpose (the PR's two new tests cover that); runs longer than 60 s; the full workspace suite on this head

AI use: omp. Claude Opus 5.5 reviewed the diff before the build and planned the comparison; Claude Fable 5.2 ran it and wrote this report.

**@⁠AmateurWizrd** on GitHub · 2026-11-25 04:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/2064#issuecomment-7153069414) **Test report on `743a612` (head as it is) against its base `cbc296a`: the new validation rejected no real cache entry on the retail title. On both shader paths, warm runs rewrote 0 cache files on the head, the same as on the base. `gpu::recomp` tests: RTX 5070 Ti 355 passed / 0 failed; native wave64 on an RDNA2 integrated GPU 353 passed / 2 failed, and the same 2 fail on the base.** Cache, release builds, retail title, 60 s per run (`XCL_RUN_SECONDS=60`, `XCL_NETWORK=0`, scripted menu input). Run 1 starts from an empty shader cache, runs 2 and 3 reuse it; "rewritten" counts cache files whose write time is after the run's start: | Build | Path | Run 1: files written (translated `.bin`) | Run 2: rewritten | Run 3: rewritten | Exit | |---|---|---|---|---|---| | base `cbc296a` | HLSL | 62 (29) | 0 | 0 | 0, 0, 0 | | base `cbc296a` | `XCL_DIRECT_DXIL=1` | 59 (29) | 0 | 0 | 0, 0, 0 | | head `743a612` | HLSL | 62 (29) | 0 | 0 | 0, 0, 0 | | head `743a612` | `XCL_DIRECT_DXIL=1` | 59 (29) | 0 | 0 | 0, 0, 0 | `cargo test -p xcl --lib -- gpu::recomp --test-threads=4`, debug: | GPU | Commit | Passed | Failed | Ignored | |---|---|---|---|---| | RTX 5070 Ti | head `743a612` | 355 | 0 | 19 | | Radeon integrated (RDNA2), `XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64` | head `743a612` | 353 | 2 | 19 | | Radeon integrated (RDNA2), `XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64` | base `cbc296a` | 351 | 2 | 19 | The 2 failures on the Radeon, on both commits, are `f16_programs_on_the_gpu` and `f32_programs_on_the_gpu`. They come from the harness, not from this PR: their wave32 per-lane cases are refused (`unsupported V_MUL_F16` / `V_CVT_F16_F32 (its #1426 semantics differ from the console's)`), and `skip_test` (`runner.rs:617-628`) turns every skip except "no mesh shaders" into a failure when `XCL_REQUIRE_GPU=wave64` is set, a refusal included. This is the same pattern as #1651. The head has 2 more passing tests than the base: this PR's two new cache tests. **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB, driver 621.01 (32-lane waves only); AMD Radeon integrated graphics of a Ryzen 7 7800X3D (RDNA2, wave32 and wave64), driver 32.0.21045.16010; 32 GB RAM; Windows 11 build 26200; Rust 1.100.0 - Builds from clean checkouts with `--locked --offline`; title runs and tests started under a local account without network access **Not tested** - Cache entries corrupted on purpose (the PR's two new tests cover that); runs longer than 60 s; the full workspace suite on this head **AI use**: omp. Claude Opus 5.5 reviewed the diff before the build and planned the comparison; Claude Fable 5.2 ran it and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 04:55 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 04:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/2064#issuecomment-7153284003) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.