Shader tests: check 125 more instructions on the hardware #2015
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2015
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2015"
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?
@astrosteveo on GitHub · 2026-11-25 03:07 UTC · original
astrosteveo:test/semantics-gaps→main· +527 −0 · 1 files · 1 commits · openThe translator lowers 125 instructions that
semantics_testshad no probe for (10 of them appear in other test files). This adds five tests that run them on the host GPU against a model of the ISA:more_scalar_alu_matches_the_hardware: logic in both widths with SCC, 64-bit shifts and bit counts, carries and borrows through SCC, SOPK immediates, bit sets and tests, 64-bit compares and selects.more_integers_match_the_hardware: high 24-bit products,v_mad_u64_u32/v_mad_i64_i32,v_sad_*,v_perm_b32,v_swap_b32, the reversed borrows.sixteen_bit_integers_match_the_hardware: add, subtract, multiply, shifts, min and max, with the destination's high half kept.more_floats_match_the_hardware: f16 floor, ceil, trunc and rndne,v_subrev_f16, and the literal f32 multiply-adds over operands whose result is exact.more_compares_match_the_hardware: the i16, u16, i32, u32, i64 and u64 compares, and the f16 ones.All of them pass, so nothing in the translator changes. To see that they can fail, I broke the lowering seven ways (signedness of
v_mad_i64_i32,v_mul_hi_i32_i24and the compares,s_bitset,v_sad_u16,s_flbit_i32,s_addk_i32); each break fails a test.Left out:
v_msad_u8, whose masking rule I could not settle from a public source, andv_mbcnt, which needs the lane's index in the model.Tested on
940d32f, RTX 5080 (driver 620.73.04), MinGW build under Wine 11.22 with vkd3d-proton 3.1, no game data:cargo test -p victory-shader --lib -- --test-threads=1: 243 passed, 4 failed onmain; 248 passed and the same 4 failed here. One of the 4 is fixed by #1994.x86_64-pc-windows-msvc, also with--all-features: clean.cargo xtask policy: ok. The file stays rustfmt-clean.Not tested on Windows, on WARP (there is none under Wine, so "warp" is the same GPU there) or on AMD.
🌴 AI-assisted, made with Claude Code · from astrosteveo/VIctory
@chemist6913 on GitHub · 2026-11-25 03:32 UTC · original
Native Windows result, RTX 5090 + WARP
Ran this branch (
6c88e38, on940d32f) natively on Windows 11 (10.0.26300), RTX 5090 (Blackwell, driver 32.0.16.1692), Rust 1.98.1 MSVC:cargo test -p victory-shader --lib --locked -- --test-threads=1 semantics_tests→ 37 passed, 0 failed, 1 ignored.All five new tests pass on the hardware adapter and on WARP: 0 model mismatches on either, 0 hardware/WARP differences. Validator: Windows SDK
dxil.dll1.6.2112.No game data; the title was not run. AI-assisted (Claude Code), run on my own machine.
@Marvisak on GitHub · 2026-11-25 09:17 UTC · original · edited 2026-11-25 22:21 UTC
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-shader/src/emit/semantics_tests.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
@sinan-cmyk on GitHub · 2026-11-25 09:55 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
6c88e385ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@sinan-cmyk on GitHub · 2026-11-25 10:40 UTC · original
more_floats_match_the_hardwarefails on Ada with driver 32.0.16.1088On an RTX 4070 SUPER (Ada, driver 32.0.16.1088, default adapter,
VICTORY_WARPunset), with head6c88e38merged ontomain940d32f,cargo test --locked -p victory-shader --libgives 248 passed and 4 failed. Three failures are the NVIDIA ones from #1835 thatmainhas too. The fourth is new in this PR:emit::semantics_tests::more_floats_match_the_hardware.Only the two probes with the denormal literal
0x00000001differ. WARP matches the model on all of them:v_fmamk_f32 v5, v1, lit(0x00000001), v2v_fmaak_f32 v5, v1, v2, lit(0x00000001)The other literals (
0x40400000,0xbf800000) and the other new probes match on the hardware too.Every mismatch fits one pattern. The driver seems to flush the literal to 0 and then fold the
+ 0away:fmamk(v1 * K + v2): the result isv2unchanged. For example,v1 = 0, v2 = -0gives0x80000000where the model wants+0.v2 = 0x00000001comes back as0x00000001where the model wants it flushed to0.fmaak(v1 * v2 + K): the result is the product, with no+ 0applied. For example,0 * -1gives-0(0x80000000) where the model wants+0.@chemist6913's RTX 5090 with driver 32.0.16.1692 passes all five probes, so this may be fixed in newer drivers. I can't tell from these two runs whether the driver version or the GPU architecture makes the difference. Still, a merged test that fails on a current Ada driver will show up as red in NVIDIA test reports.
AI-assisted (Claude Code). Synthetic tests only.
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.