Shaders: reject invalid direct shader hash filters #1754

Closed
github-bot wants to merge 1 commit from gh-pr/1754/head into gh-pr/1754/base
Owner

@⁠NemesisDawn on GitHub · 2026-11-24 20:16 UTC · original
NemesisDawn:fix/direct-shader-hash-validation → main · +44 −3 · 2 files · 1 commits · closed without merging

Reject missing or malformed --hash values before a direct shader sweep. Bare hexadecimal and both forms of the 0x prefix remain supported.

What is in it

  • crates/xcl/src/shaders.rs validates the filter. crates/xcl/tests/shaders_e2e.rs adds a regression test.

Tested

  • At aa0f52f, the direct hash regression passed on Windows using a standalone fixture compiled with rustc 1.100.0. The fixture exercises the argument-validation code with stubbed shader dependencies.

Regression run

  • Pending comparable retail-title runs on upstream main and this PR’s commit.

Not tested

  • Full XCL build, Cargo workspace suite on a GPU, and retail-title smoke runs.

AI use

  • OpenAI Codex (GPT-6, exact variant unavailable) wrote the patch and regression tests, ran the focused checks, and drafted this description.
**@⁠NemesisDawn** on GitHub · 2026-11-24 20:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/1754) `NemesisDawn:fix/direct-shader-hash-validation` → `main` · +44 −3 · 2 files · 1 commits · closed without merging Reject missing or malformed `--hash` values before a direct shader sweep. Bare hexadecimal and both forms of the `0x` prefix remain supported. **What is in it** - `crates/xcl/src/shaders.rs` validates the filter. `crates/xcl/tests/shaders_e2e.rs` adds a regression test. **Tested** - At `aa0f52f`, the direct hash regression passed on Windows using a standalone fixture compiled with `rustc` 1.100.0. The fixture exercises the argument-validation code with stubbed shader dependencies. **Regression run** - Pending comparable retail-title runs on upstream `main` and this PR’s commit. **Not tested** - Full XCL build, Cargo workspace suite on a GPU, and retail-title smoke runs. **AI use** - OpenAI Codex (GPT-6, exact variant unavailable) wrote the patch and regression tests, ran the focused checks, and drafted this description.
Reject absent or malformed --hash values before sampling to avoid
silently running an unfiltered sweep. Accept bare hexadecimal and
both forms of the 0x prefix.

Assisted-by: OpenAI Codex (GPT-6, exact variant unavailable)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:03:51 +00:00
github-bot closed this pull request 2026-11-26 05:03:51 +00:00
Author
Owner

@⁠Anon64 on GitHub · 2026-11-24 20:28 UTC · original

Regression run for this PR: head aa0f52f, based on main 9039900. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, XCL_NETWORK=0, A pressed every 4 s from 20 s, scripts/smoke.ps1 on a retail title for 60 s, back to back with the main run.

main 9039900:

xcl-smoke v1
commit: 9039900ba3710fda9d791db589d548b1aaeb3cf8
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1363 (PresentX 1363)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 91477 MB

this PR:

xcl-smoke v1
commit: aa0f52f86fe725d3c76172219c846a6f9fd17052
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1567 (PresentX 1567)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 102048 MB

No device removals or crashes; 115 % of main's frames, 112 % of its peak commit.

Peak commit on this machine is mostly the pipeline preload's DXC compiles (#1035) and varies a lot from run to run, so it says little about this PR.

Not tested: the whole suite; the xcl shaders direct-dump path this PR changes (the title run does not use it).

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

**@⁠Anon64** on GitHub · 2026-11-24 20:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1754#issuecomment-7143609197) Regression run for this PR: head `aa0f52f`, based on `main` `9039900`. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, `XCL_NETWORK=0`, A pressed every 4 s from 20 s, `scripts/smoke.ps1` on a retail title for 60 s, back to back with the `main` run. main `9039900`: ``` xcl-smoke v1 commit: 9039900ba3710fda9d791db589d548b1aaeb3cf8 gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1363 (PresentX 1363) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 91477 MB ``` this PR: ``` xcl-smoke v1 commit: aa0f52f86fe725d3c76172219c846a6f9fd17052 gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1567 (PresentX 1567) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 102048 MB ``` No device removals or crashes; 115 % of main's frames, 112 % of its peak commit. Peak commit on this machine is mostly the pipeline preload's DXC compiles (#1035) and varies a lot from run to run, so it says little about this PR. **Not tested:** the whole suite; the `xcl shaders` direct-dump path this PR changes (the title run does not use it). Written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 21:19 UTC · original · edited 2026-11-24 22:00 UTC

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

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, 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 pso_measurement_compiles_an_exact_synthetic_record: 858 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: direct_sweep_rejects_invalid_hash_filters.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 859 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Two tests were skipped with --skip on NVIDIA. Both fail on main 7f7e768 too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. heap_window_out_of_memory_falls_back_to_the_switch_form skips when XCL_HEAP_WINDOWS is unset (#1651), and shaders::tests::pso_measurement_compiles_an_exact_synthetic_record skips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not set XCL_REQUIRE_GPU, so there both just print SKIPPED.

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-24 21:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/1754#issuecomment-7144775271) · edited 2026-11-24 22:00 UTC Full-suite run, since this PR has no test report yet. Tested exact head `aa0f52f` (on its base `9039900`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, 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 pso_measurement_compiles_an_exact_synthetic_record`: **858 passed, 0 failed, 42 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `direct_sweep_rejects_invalid_hash_filters`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **859 passed, 0 failed, 42 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - Two tests were skipped with `--skip` on NVIDIA. Both fail on main `7f7e768` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns their skips into failures. `heap_window_out_of_memory_falls_back_to_the_switch_form` skips when `XCL_HEAP_WINDOWS` is unset (#1651), and `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` skips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not set `XCL_REQUIRE_GPU`, so there both just print SKIPPED. **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

@⁠DavidM1911 on GitHub · 2026-11-24 23:04 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main in crates/xcl/src/shaders.rs — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-24 23:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/1754#issuecomment-7146984554) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** in `crates/xcl/src/shaders.rs` — needs a rebase before it can be tested.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 04:09 UTC · original

XCL PR #1754 Windows / Intel Arc verification

Clean detached head aa0f52f86fe725d3c76172219c846a6f9fd17052 on STOR-WINLAB. Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 (16,258 MiB reported VRAM), driver 32.0.101.9175, DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386 2026-11-09, x86_64-pc-windows-msvc). Dev and test profiles were unoptimized, with debug info and incremental compilation disabled.

Tested

  • cargo build --workspace and cargo test --workspace --no-run succeeded outside the Arc lock. Both reported two Atomic::fetch_update deprecation warnings.
  • cargo test -p xcl --test shaders_e2e direct_sweep_rejects_invalid_hash_filters -- --exact --nocapture with XCL_ADAPTER=NONE_CPU_ONLY reported 1 passed, 0 failed, 0 ignored, 0 explicit skips. The new CLI integration test passed here and in the workspace suite. It verified exit 2, empty stdout, and a diagnostic for missing, empty, nonhexadecimal, and overflowing hash arguments. On two synthetic files, plain hex and both prefix forms (0x, 0X) selected the two-record search. The no-hash control reported one sampled record.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. It exited 101. Across 19 test binaries and one doctest harness, pr1754-suite.log recorded 841 passed, 18 failed, 42 ignored, and 6 explicit SKIPPED lines.

Workspace failures and skips

Thirteen GPU unit tests reported CreateComputePipelineState returning 0x80070057. Four others reported mismatches in FMA, implicit texture LOD, f16 lane preservation, and wave64 pixel reduction. The test-title e2e failed its RSSetDepthBiasX check (blue pixel, expected green). Explicit skips cited missing wave64 (2), D3D12 debug layer availability (2), tiled-resource tier below 2 (1), and no heap windows (1). Those skips provide zero coverage.

Not tested

Matched main baseline, retail-title smoke and shader hash matches on retail data, optional XCL_SAMPLE_* fixtures, and other GPU adapters.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1754-suite.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 04:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/1754#issuecomment-7152582509) # XCL PR #1754 Windows / Intel Arc verification Clean detached head `aa0f52f86fe725d3c76172219c846a6f9fd17052` on STOR-WINLAB. Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 (16,258 MiB reported VRAM), driver 32.0.101.9175, DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386 2026-11-09, x86_64-pc-windows-msvc). Dev and test profiles were unoptimized, with debug info and incremental compilation disabled. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` succeeded outside the Arc lock. Both reported two `Atomic::fetch_update` deprecation warnings. - `cargo test -p xcl --test shaders_e2e direct_sweep_rejects_invalid_hash_filters -- --exact --nocapture` with `XCL_ADAPTER=NONE_CPU_ONLY` reported 1 passed, 0 failed, 0 ignored, 0 explicit skips. The new CLI integration test passed here and in the workspace suite. It verified exit 2, empty stdout, and a diagnostic for missing, empty, nonhexadecimal, and overflowing hash arguments. On two synthetic files, plain hex and both prefix forms (`0x`, `0X`) selected the two-record search. The no-hash control reported one sampled record. - `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`. It exited 101. Across 19 test binaries and one doctest harness, `pr1754-suite.log` recorded 841 passed, 18 failed, 42 ignored, and 6 explicit `SKIPPED` lines. **Workspace failures and skips** Thirteen GPU unit tests reported `CreateComputePipelineState` returning `0x80070057`. Four others reported mismatches in FMA, implicit texture LOD, f16 lane preservation, and wave64 pixel reduction. The test-title e2e failed its `RSSetDepthBiasX` check (blue pixel, expected green). Explicit skips cited missing wave64 (2), D3D12 debug layer availability (2), tiled-resource tier below 2 (1), and no heap windows (1). Those skips provide zero coverage. **Not tested** Matched main baseline, retail-title smoke and shader hash matches on retail data, optional `XCL_SAMPLE_*` fixtures, and other GPU adapters. **AI use** T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1754-suite.log` and published.
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 01:19 UTC · original

Closing because main already rejects invalid --hash values, from 9a7e0edd ("CLI: reject unknown options and invalid values in xcl rpf and xcl shaders", #2266, merged via #2285). xcl shaders now parses --hash with cli::parse_hex_u64. That accepts an optional 0x/0X prefix, requires 1 to 16 hex digits, and refuses a missing value or a following flag, which covers what this PR adds.

Compared at head aa0f52f8 against main 08db802. Reviewed with Claude Code (Claude Opus 5.5); I checked the comparison before closing.

**@⁠Prime1997** on GitHub · 2026-11-26 01:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/1754#issuecomment-7179663618) Closing because main already rejects invalid `--hash` values, from 9a7e0edd ("CLI: reject unknown options and invalid values in xcl rpf and xcl shaders", #2266, merged via #2285). `xcl shaders` now parses `--hash` with `cli::parse_hex_u64`. That accepts an optional `0x`/`0X` prefix, requires 1 to 16 hex digits, and refuses a missing value or a following flag, which covers what this PR adds. Compared at head aa0f52f8 against main 08db802. Reviewed with Claude Code (Claude Opus 5.5); I checked the comparison before closing.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.