Skip to content

Tests: report failures when replaying a single DXIL fuzz seed - #2124

Draft
mokkamokacaffe wants to merge 1 commit into
xcl-dev:mainfrom
mokkamokacaffe:tests/dxil-debug-seed-verdict
Draft

mokkamokacaffe wants to merge 1 commit into
xcl-dev:mainfrom
mokkamokacaffe:tests/dxil-debug-seed-verdict

Conversation

@mokkamokacaffe

@mokkamokacaffe mokkamokacaffe commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2115. Replaying a failing seed with the existing ignored debug_seed test can print a validator error, a driver error, or a count of mismatches and still exit successfully. Make a single-seed run return the same failure as the batch when it reaches that check.

What is in it

  • In crates/xcl/src/gpu/dxil/fuzz_tests.rs, reuse the batch's validator and GPU comparison in the single-seed diagnostic. Both paths identify the first mismatching output index and the GPU and CPU values. The diagnostic still prints the disassembly and honors FUZZ_WATCH. Validation-only seeds and unavailable wave32 hardware get a skip message.
  • To replay on Windows PowerShell, set $env:FUZZ_SEED='722' and run cargo test -p xcl --lib gpu::dxil::fuzz_tests::debug_seed -- --exact --ignored --nocapture.

Tested

  • git diff --check passed. Checked the shared comparison against the original batch loop, including its result indexing and dispatch arguments.
  • Linux CPU-only control-flow check using the edited diagnostic functions and stub validator/runner responses: matching output and capability skip exited 0, and validator rejection, driver error and mismatching output each exited 101 with the expected message (5 cases).

Independent Windows tests on head ced97c2af0c5cca480b4aa926681896cfa9cf3b9:

  • On an RX 6800M, seed 530 produced the same pipeline error (0x887A0005) on main f5c5bdf0e91035f8f1404f46f4f2f7aedc259e7f and the PR. Main exited 0 and the PR correctly exited 101. Seed 503 passed on the GPU and seed 500 reported a validation-only skip. luckyteagirl's paired run
  • On an RX 9070 XT, seed 0 passed. Seeds 722 and 1599 exited 101 and identified the first mismatch at indices 30 and 193 respectively. On an RTX 3070, seed 1599 passed, seed 56927 reported a mismatch, and seed 6286 reported a pipeline creation error. Lum7nt's AMD results · upipibi's NVIDIA results
  • With a separate CPU-only companion patch, 2,000 synthetic seeds passed Windows DXIL validation with zero GPU comparisons. A deliberately inconsistent container made the replay exit 101. anes66's control and companion revision

Regression run

Test harness only.

Not tested

AI use

  • OpenAI Codex (GPT-6.2 Astra) traced the batch and diagnostic paths, edited the test harness, attempted the cross-check and drafted the description.
  • OpenAI Codex summarized the linked contributor reports for this update.

@luckyteagirl

Copy link
Copy Markdown
Contributor

Windows/RX 6800M verification on exact head ced97c2af0c5cca480b4aa926681896cfa9cf3b9 (clean detached worktree). Main control was f5c5bdf0e91035f8f1404f46f4f2f7aedc259e7f.

Tested: Windows 11 build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M (RDNA2), driver 30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5. Debug test profile, XCL_ADAPTER=6800M, XCL_REQUIRE_GPU=1, XCL_DIRECT_DXIL=0. For each seed I set FUZZ_SEED and ran cargo test --locked -p xcl --lib -j 2 gpu::dxil::fuzz_tests::debug_seed -- --exact --ignored --test-threads=1 --show-output.

Seed Main PR head
530, GPU-safe Printed CreateComputePipelineState device suspension 0x887A0005 but exited 0 (1 passed) Printed the same error and exited 101 (1 failed)
503, GPU-safe Not run Exited 0 (1 passed, no skip)
500, validation-only Not run Exited 0 with SKIPPED ... seed is validation-only

This verifies the new diagnostic propagates a real Windows GPU pipeline failure while a GPU-safe success still passes. It does not explain the driver suspension or verify the seed 722 result mismatch from issue #2115. I did not run the full workspace suite, other adapters, or a retail title.

AI use: OpenAI Codex (GPT-6, exact variant not exposed in this session) built the PR head, ran and compared the seed probes, reviewed the diff, and drafted this report.

@upipibi

upipibi commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Checked on an RTX 3070 (Ampere, driver 616.56), Windows 11, debug, at ced97c2, with seeds whose outcome on this card is known:

  • FUZZ_SEED=56927 (wrong results on NVIDIA): debug_seed now fails (exit 101).
  • FUZZ_SEED=6286 (the driver refuses the pipeline: CreateComputePipelineState returns E_OUTOFMEMORY): fails and reports the driver error.
  • FUZZ_SEED=1599 (clean): passes.
  • cargo test -p xcl --lib -- fuzz_: 5 passed, 2 ignored.

Both failing seeds are NVIDIA driver issues, not translator bugs. 56927 is an i64 multiply of a zero-extended 0x80000000 by a sign-extended value, with the wrong sign. 6286 is an i32 urem by a constant ≥ 2^31 of a WaveReadLaneFirst value inside a loop, which the driver refuses to compile. Neither form comes out of XCL's translators.

AI-assisted (Claude Code). Synthetic tests only.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

@ettehn

ettehn commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

One remaining diagnostic edge on ced97c2: debug_seed unwraps disassembly before check_valid. If the emitter produces a container that both reject, the replay exits with a generic unwrap panic and no seed, while the batch names the seed and validator error. A local test using an empty container (rejected by XCL’s length check before DXC) reproduced that discrepancy. Moving check_valid ahead of disassembly made it pass with seed 314: validator rejected the module. A disassembly-only error can also include the seed.

Native Windows with WARP: seed 722 still prints FUZZ_WATCH=30 with CPU 0x7fffffff and explicitly skips no wave32. Seed 500 reports seed is validation-only. With XCL_REQUIRE_GPU=wave64, the missing wave32 result on seed 722 exits 101, as directed by the existing strict skip policy. No hardware adapter was exercised.

AI use — OpenAI Codex (GPT-6) ran the checks and wrote the local diagnostic patch.

@Lum7nt

Lum7nt commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Windows hardware check on clean head ced97c2af0c5cca480b4aa926681896cfa9cf3b9: Radeon RX 9070 XT, driver 32.0.32029.2010, DXC 1.9.2609.5. For each seed I set FUZZ_SEED and ran:

cargo test --offline --locked --release -p xcl --lib gpu::dxil::fuzz_tests::debug_seed -- --exact --ignored --nocapture --test-threads=1

  • Seed 0: 1 passed, 0 failed, 0 ignored, exit 0.
  • Seed 722: 0 passed, 1 failed, 0 ignored, exit 101; mismatch at result 30 (GPU 1, CPU 0x7fffffff).
  • Seed 1599: 0 passed, 1 failed, 0 ignored, exit 101; mismatch at result 193 (GPU 1, CPU 0).

These are synthetic diagnostic runs, not a full workspace or retail test. The corresponding batch failures also reproduced on the tested main control; this report does not establish their cause.

AI use: OpenAI Codex (GPT-6; exact variant unavailable) ran the checks and drafted this report.

@anes66

anes66 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Native Windows CPU-only verification of exact head ced97c2af0c5cca480b4aa926681896cfa9cf3b9 passed, using optional test-only companion 0a5cdfb. It adds XCL_FUZZ_CPU_ONLY=1 to avoid capability queries as well as dispatch, including single-seed diagnostics. The normal GPU path remains selected when unset.

Tested

  • Windows 10 Pro 19045, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, debug, SDK DXC/DXIL 1.9.2602.17. No GPU device or title execution.
  • XCL_FUZZ_CPU_ONLY=1 cargo test --locked -p xcl --lib gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_ -j 2 -- --nocapture --test-threads=1: 4 passed / 0 failed / 0 ignored; 2,000 validated, 0 GPU-compared. The same corpus also passed on the combined local optimizer tree based on main 06c9f55 (another 4/0/0, 0 GPU comparisons).
  • FUZZ_SEED=722, FUZZ_WATCH=0, CPU-only mode, debug_seed --exact --ignored --nocapture: 1 passed / 0 failed, with one explicit GPU-comparison skip. Disassembly and the CPU watch output were produced.
  • Native error-path control: toggle the synthetic container's Int64Ops feature bit and recompute its digest. The real SDK validator rejects it with Container part 'Feature Info' does not match expected for module; this PR's diagnostic exits 101. Restoring only the old print-the-Result behavior on the same invalid container exits 0, demonstrating the false success the PR fixes. All temporary mutations were removed before the final passing runs and commit.

Not tested
GPU comparison/error/mismatch paths, AMD seed 722 execution, full workspace or a title. The two 2,000-seed results are validator coverage, not shader-output parity.

@github-actions

Copy link
Copy Markdown

Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

@github-actions github-actions Bot added stale No activity for 3 days; closed 4 days later unless something happens area:recompiler RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32 area:tests Unit, integration, e2e tests, or testtitle gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) labels Nov 29, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head ced97c2

No open PR makes the same change. #2875 also edits fuzz_tests.rs but only run_seeds' skip reporting, so the two will conflict on text but do not overlap in behaviour. #2231 (same issue #2115) changes the Countbits folding in ops.rs and is unrelated.
debug_seed still calls validate::disassemble(&c).unwrap() before check_valid, so a container that fails to disassemble panics without the seed or the validator error. The description already lists this gap.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:recompiler RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32 area:tests Unit, integration, e2e tests, or testtitle gpu:nvidia Code is specific to NVIDIA / wave32 GPUs (scope tag; see needs:nvidia-test) stale No activity for 3 days; closed 4 days later unless something happens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants