Tests: a cross-backend and cross-device VALU fuzzer (ignored by default) #2169
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2169
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2169"
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?
@alexdeliu on GitHub · 2026-11-25 07:01 UTC · original
alexdeliu:recompiler/valu-fuzz→main· +437 −0 · 2 files · 1 commits · openAdds
valu_fuzz_backends_agree. It runs every VOP3 / VOP3P VALU instruction of the RDNA2 table alone in a wave64 kernel, on 64 lanes × 4 rounds of edge and pseudo-random inputs (signed zeros, denormals, infinities, NaNs, integer and f16 edges), through both backends (HLSL + DXC, direct DXIL). It reports every instruction whose results differ between them, with the sources of each case. WithXCL_FUZZ_DIRset, it writes the results per adapter.valu_fuzz_comparethen reports what differs between adapters (run once perXCL_ADAPTER). Both tests are#[ignore]d because they take a minute or two of GPU time, not to hide a failure, and skip without a GPU. A port of the fuzzer behind Marvisak/VIctory#1614 (same author), whose findings include the shared-dword i64 compare that5195e27also handles.Findings so far: #2168 (the HLSL backend's fast-math, and v_dot2_f32_f16 between RDNA4 and RDNA2).
What is in it
crates/xcl/src/gpu/recomp/valu_fuzz_tests.rs: the generator, the per-backend runs, the per-adapter files and the comparison.crates/xcl/src/gpu/recomp/mod.rs: one#[cfg(test)] mod valu_fuzz_tests;line. Test-only, so this asks for thetest-onlylabel.Tested
cargo test --workspace -- --test-threads=4on this branch, RX 9070: 1152 passed, 2 failed, 48 ignored. The 2 failures arefuzz_validate_and_gpu_1/_3(seeds 722 / 1599), which fail onmaintoo on this card. The 2 extra ignored tests are the new ones. 81 tests SKIPPED by validator 1.7, plus 9 others, as onmain.valu_fuzz_backends_agreeon each AMD adapter: 341 instructions, 333 compared on both backends, 6 differ (the issue above), 8 refused by both backends (the f64 div helpers,v_qsad/v_mqsad,v_mullit_f32,v_cvt_off_f32_i4). Rerun of those 6 withXCL_FUZZ_DXC_GIS=1(XCL_FUZZ_OPSset to them, RX 9070): 0 differ.valu_fuzz_compareover the two adapters: onlyv_dot2_f32_f16differs (7 of 256, on both backends).Regression run
scripts/smoke.ps1printed them:mainat568e7db7and this PR's heade792e6b2, same title and time, on an AMD Radeon RX 9070 (32.0.32029.2010). The PR's run shows 104 % ofmain's frames and 100 % of its peak commit, with no crash and no device removal. The change is test-only (an#[ignore]d test and one#[cfg(test)]line), so the title does not reach it.Not tested
cargo test --workspace -- --test-threads=4at this head onmain568e7db, RX 9070: 1152 passed, 2 failed (seeds 722 / 1599, as onmain), 48 ignored, 90 SKIPPED.)AI use
🤖 Generated with Claude Code
@DavidM1911 on GitHub · 2026-11-25 07:28 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!
@DarkPanda69 on GitHub · 2026-11-25 07:36 UTC · original
Fuzzer run on NVIDIA (listed as untested) and on an RX 9070 XT, at head
e792e6bapplied onmain568e7db(the rebased base the description says was not rerun).Tested (debug, Windows 11 Pro 26200,
cargo test -p xcl --lib valu_fuzz_backends_agree -- --ignored --nocapture --test-threads=1, thenvalu_fuzz_compare,XCL_FUZZ_DIRset):v_cos_f328,v_ldexp_f1619,v_mul_f1626,v_pk_mul_f1649,v_sin_f164,v_sin_f327 (of 256). So it reproduces on the rebased tree.v_cubetc_f32: 58 of 256 differ. In every example the HLSL result is a signed zero where the direct result is a denormal, e.g. sourcesff7fffff,0000ffff,54ed8ab5: hlsl0x80000000, direct0x8000ffff; sources7fffffff,00000001,3c01bc00: hlsl0x80000000, direct0x80000001. On the RX 9070 XT the HLSL result keeps the denormal (0x8000ffff), so the NVIDIA driver flushes f32 denormals on the HLSL path for this instruction.valu_fuzz_compareRX 9070 XT vs RTX 3060: 38 instruction/backend pairs differ. Mostly the same on both backends, so between the GPUs rather than the translators:v_add_f16,v_sub_f16,v_subrev_f16(3–6),v_cvt_f16_i16(32),v_fma_f16/v_pk_fma_f16/v_pk_add_f16/v_fma_mixlo_f16(6–14),v_div_fixup_f16(7). E.g.v_cvt_f16_i16result 9: AMD0x77d9, NVIDIA0x77d8.v_fma_mixhi_f16110, e.g. AMD0xfe00…, NVIDIA0x7fff….v_cvt_f32_f644 (AMD0x00000000, NVIDIA0x00014800),v_cvt_f64_f3214 of 512.v_log_f325 (AMD0x3438aa3b, NVIDIA0x3495f600),v_sin_f32134/140,v_sin_f1663/67,v_cos_f3210/17,v_dot2_f32_f167.I have the two per-adapter
.tsvfiles if they are useful for comparing against your RDNA2 iGPU (which should be closest to the console).Not tested:
XCL_FUZZ_DXC_GIS=1on the 3060, Intel, a title.AI use: Claude Code (Claude Opus 5.5) ran the fuzzer on this machine and wrote this report.
@luckyteagirl on GitHub · 2026-11-25 07:49 UTC · original
Independent RDNA2 run of the ignored VALU fuzzer on exact PR head
e792e6b296959c9f1bf680199707aeabce07655d(base568e7db7729c8fa6c8f0f4b32d798faaf11462bb).Environment: Windows 11 build 26200, Ryzen 9 5980HX, Radeon RX 6800M driver
30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5. Clean detached worktree;XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=wave64,XCL_FUZZ_DIRset. Each run usedcargo test --locked -p xcl --lib -j 2 valu_fuzz_backends_agree -- --ignored --test-threads=1 --show-outputand the fuzzer's default four rounds (256 inputs per instruction).XCL_FUZZ_DXC_GIS=1The default run reproduced #2168's six differences with the same counts:
V_COS_F328,V_LDEXP_F1619,V_MUL_F1626,V_PK_MUL_F1649,V_SIN_F164,V_SIN_F327 (each of 256). With-Gis, those six disappeared, but eight FMA-family instructions then differed:V_DIV_FMAS_F322,V_FMAC_F322,V_FMAC_LEGACY_F324,V_FMA_F166,V_FMA_F321,V_FMA_MIXHI_F167,V_FMA_MIXLO_F166,V_PK_FMA_F1614 (each of 256). For example, strict HLSL gave0x3c01for oneV_FMA_F16case where direct DXIL gave0x3c00.I reran only those eight FMA instructions immediately afterward: 0/8 differed without
-Gis; 8/8 differed with it, with the same per-instruction counts. This confirms the change in this fixture. It suggests that applying-Gisglobally would trade one set of backend differences for another on this GPU; the fuzzer does not establish which backend matches the console for every FMA case.All four ignored-test invocations completed with 1 test passed, 0 failed, 0 ignored. That test status means the fuzzer completed; it does not mean the backend outputs matched. I did not run the full workspace suite, a retail title, or a cross-device comparison on this PR head. Local logs and TSV outputs are preserved; no game data was used or uploaded.
AI use: OpenAI Codex ran and repeated the comparisons, checked the exact revision and logs, and prepared this report.
@raylitebull on GitHub · 2026-11-25 10:58 UTC · original
Diff audit on
e792e6b(valu_fuzz_tests.rs+mod.rs) looks clean (#[ignore]fuzzer) and CI run45564995525has been approved.Note that
PR descriptioncurrently fails because notest-onlylabel exists on this repo (or needs a pairedxcl-smoke v1block to clear the check) before this can merge.@Toons29 on GitHub · 2026-11-25 11:15 UTC · original
Regression run of
e792e6b2on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon568e7db7, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 104 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.