Commit Graph

5 Commits

Author SHA1 Message Date
93de6401c8 Merge #4908 (fuzz/vint-clamp-b64) 2026-11-23 21:45:02 +00:00
41e6f87877 vint_diff: one scalar value on a 64-bit shift; reject clamp before the early returns
The GFX10 constant-bus limit of v_lshlrev_b64, v_lshrrev_b64 and
v_ashrrev_i64 is one, not two: llvm-mc and COMGR reject
`v_lshrrev_b64 v[2:3], 0x12345678, s[4:5]` and `..., s4, s[6:7]`.
With an SGPR pair as S1 the generator now takes a VGPR or an inline
constant as the shift count, and the reference raises RefError on a
second scalar value.

The reference also ran `s_mov_b32 s4, 1 clamp` (and a v_cmp or
v_cndmask with clamp) because those return before the clamp check.
The check now comes first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 08:17:16 +00:00
e5fcd3aa2f tools/vint_diff.py: generate the integer clamp and the 64-bit shifts
No fuzzer generated v_add_nc_i32 / v_sub_nc_i32 or v_lshlrev_b64 /
v_lshrrev_b64 / v_ashrrev_i64, and none put clamp on the unsigned
add/sub with a literal. vint_diff now generates:

- clamp on the e64 / VOP3 form of v_add_nc_u32, v_sub_nc_u32,
  v_subrev_nc_u32 (saturate to [0, 0xffffffff]) and v_add_nc_i32,
  v_sub_nc_i32 (saturate to [0x80000000, 0x7fffffff]), from the
  measured "Integer clamp" row of docs/design.md;
- the three 64-bit shifts into a VGPR pair, S1 a VGPR pair (odd first
  registers included), an SGPR pair or an integer inline constant
  sign-extended to 64 bits. A literal or a float inline constant as S1
  is left out: its widening is not measured.

The destination parser, the observed registers and the shrinker's seed
filter now understand register pairs. Six new tests; a paragraph in
docs/shader_validation.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 06:16:20 +00:00
91a89baac6 diff fuzzers: exit 2 when every program was skipped, not 0 (vint, pk16, salu, sdwa, sad) 2026-11-23 02:07:06 +01:00
1ec817add5 tools: vint_diff.py, a differential fuzzer for 32-bit integer VALU in every encoding and source kind
A separate ISA model for 55 integer opcodes (VOP1/VOP2 as e32 and e64, VOP3-only ops, VOPC e64 + v_cndmask) with VGPR, SGPR, inline, float-inline and literal sources within the encoding and constant-bus rules, compared one lane at a time with rdna2spirv run in tests/semantic/spirv_mini_interp.py, optionally with the hardware through tools/hw_oracle. A mask read as data (#293) only with --known.

AI-assisted.
2026-11-22 17:49:10 +01:00