Shader tests: differential fuzzing against an RDNA2 interpreter ("oracle"), port of avatarmanz#403 #70
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!70
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-70"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@simbaui4life on GitHub · 2026-11-27 16:14 UTC · original
test/rdna2-oracle→main· +1854 −0 · 2 files · 1 commits · closed without mergingA port of avatarmanz/VIctory-7900XTX#403: a differential fuzzer for the shader translator, as tests. One commit on
d12eb1b. It does not change the translator.Why: the translator's tests check chosen cases. This one checks whole random programs against a model of the RDNA2 ISA that shares no code with the translator, on the GPU the translation runs on. It covers EXEC-narrowed branches, SCC, VCC and cross-lane reads and writes. On this fork's RTX target, wave64 runs as two 32-lane host waves, which is where most of its findings are.
How it works (
crates/victory-shader/src/emit/oracle_tests.rs,cfg(all(test, windows)))v_readlane/v_writelane/v_readfirstlane.spill::build,structure,resource::track,io::raise, thenemitretried astranslatedoes (FIRST_HALF).emit::hostand are compared lane by lane with an interpreter that shares nothing with the translator. A program that differs is minimized and printed as a listing.Running it
oracle_encoding_reads_back_as_the_instructions_meantandoracle_interpreter_follows_the_isa_on_known_cases.#[ignore]d:VICTORY_ORACLE_RUNS=200 VICTORY_ORACLE_SEED=1 cargo test -p victory-shader --lib oracle_fuzz -- --ignored --nocapture --test-threads=1VICTORY_ORACLE_OUT=<file>writes the report.VICTORY_ORACLE_AVOID=salu_in_branch,minmax_scc,lane_range,writelane_inactive,mask_dataleaves out the known classes.Findings (the fixes are the two companion PRs from
simbaui4life:fix/salu-minmax-scc-lane-masksandsimbaui4life:fix/scalars-after-lane-branches)v_writelaneto a lane EXEC leaves out.v_cmpunder narrowed EXEC.v_readfirstlaneper 32-lane half.Tested (RTX 4070 Ti, driver 621.01, Windows 11 26200)
d12eb1b:cargo test -p victory-shader288 passed.cargo clippy -p victory-shader --all-targets -- -D warningsis clean.Not tested: AMD hardware.
No game data in the commits.
🤖 Generated with Claude Code
@Aniseto on GitHub · 2026-11-27 18:10 UTC · original
Ran the differential oracle fuzzer from PR #70 at
62eed99on an NVIDIA Blackwell part. The PR body lists several oracle differences as still open, so this is a report of what this adapter produced, not a review of the change.System
Results
cargo test -p victory-shader --lib oracle -- --test-threads=4: 2 passed, 0 failed, 1 ignored (exit 0). The ignored test is oracle_fuzz.VICTORY_ORACLE_RUNS=200 VICTORY_ORACLE_SEED=1 VICTORY_REQUIRE_HW_GPU=1 cargo test -p victory-shader --lib oracle_fuzz -- --ignored --nocapture --test-threads=1: FAILED, 0 passed, 1 failed, exit 101. The test panicked at oracle_tests.rs:1851 with "exact translations that differ from the oracle": left 171, right 0.What this adds
The PR's Tested section lists the default suite on an RTX 4070 Ti (290 passed) but no run of the fuzzer itself. This adds a Blackwell wave32 host with the fuzzer enabled and VICTORY_REQUIRE_HW_GPU set, so a silent skip would have failed the run. Both fuzzer runs executed on the real D3D12 device and ended at the oracle comparison with a nonzero difference count; the second run still reported 23 differences after the documented AVOID classes. I did not investigate the cause of those differences.
Not tested
Other seeds or run counts, AMD hardware, Intel adapters, Wine, release profile, game data. The default suite at this head was not run here; the non-ignored filter covers emit::oracle only.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR head in a detached worktree, ran the commands above and wrote this report; no game data was used.
@simbaui4life on GitHub · 2026-11-27 19:57 UTC · original
Thanks for running it on Blackwell. I reproduced the same command here (RTX 4070 Ti, driver 621.01, Windows 11 26200,
VICTORY_ORACLE_RUNS=200 VICTORY_ORACLE_SEED=1 VICTORY_REQUIRE_HW_GPU=1) and get the same totals: 171 without the filter and 23 with it. So these are not specific to your card.The fuzzer is meant to fail while known classes are open: it asserts zero differences so that every remaining one is listed and minimized. With your filter, the 23 are these (wave64 programs count twice, once for the "default" and once for the "exact" form):
62eed99)d212aea)VICTORY_WAVE_WIDE=1v_cmpunder narrowed EXEC must leave 0 in the VCC bits of the lanes it skips. #116 fixes them.VICTORY_WAVE_WIDE=1, because a wave64 run as two 32-lane waves needs group barriers there. So they remain by default.v_readfirstlane_b32. On a 32-lane host each half of a wave64 reads its own first lane, so lanes 32–63 get lane 32's value instead of lane 0's (e.g.s20: GPU 0x20, oracle 0x0). This is a known open class with no fix and noVICTORY_ORACLE_AVOIDkey yet.🤖 Reproduced and classified with Claude Code
Pull request closed