diff options
| author | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 17:49:10 +0100 |
|---|---|---|
| committer | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 17:49:10 +0100 |
| commit | 1ec817add5b048d64f1dbb91599bc3a2ad65d2ff (patch) | |
| tree | 3f4e9a4f475d9548364243369e6f817ef096df0e /docs/shader_validation.md | |
| parent | 4eb6155d3ac4f9d3fadb0d095c4ce13e76783615 (diff) | |
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.
Diffstat (limited to 'docs/shader_validation.md')
| -rw-r--r-- | docs/shader_validation.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/shader_validation.md b/docs/shader_validation.md index 97cf8309a..e9147f8c9 100644 --- a/docs/shader_validation.md +++ b/docs/shader_validation.md | |||
| @@ -613,6 +613,24 @@ principle, but it needs the loaded code to be 256-byte aligned, which the kernel | |||
| 613 | section above records a 4096-word output cap there, while a 64x64 case stores 16,384 words. Until that is measured | 613 | section above records a 4096-word output cap there, while a 64x64 case stores 16,384 words. Until that is measured |
| 614 | on a GFX10 card, treat RDNA2 as unverified. | 614 | on a GFX10 card, treat RDNA2 as unverified. |
| 615 | 615 | ||
| 616 | ### 32-bit integer VALU in every encoding (`tools/vint_diff.py`) | ||
| 617 | |||
| 618 | `tools/shader_diff.py` checks the common integer opcodes with VGPR sources in their e32 form. `tools/vint_diff.py` | ||
| 619 | adds the rest of the 32-bit integer VALU a compiler emits: the VOP1/VOP2 opcodes as e32 and e64, the VOP3-only ones | ||
| 620 | (`v_add3_u32`, `v_lshl_add_u32`, `v_alignbit/alignbyte/perm_b32`, `v_min3/max3/med3`, the 24- and 16-bit | ||
| 621 | multiplies with `op_sel`, `v_bcnt`, `v_bfm`, `v_ffbh/ffbl`, `v_cvt_pk_*16_*32`, ...) and VOPC e64 into a mask with | ||
| 622 | `v_cndmask_b32_e64`, with VGPR, SGPR, integer and float inline-constant and literal sources in every position the | ||
| 623 | encoding allows (one literal and two scalar values per VOP3). It runs one lane through | ||
| 624 | `tests/semantic/spirv_mini_interp.py` against its own ISA model, with the shrinking, skips and exit codes of | ||
| 625 | `salu_diff.py`; a compare's mask read as VALU data (#293) is left out unless `--known`. `--oracle hw` runs the same | ||
| 626 | programs on an AMD GPU; on an RDNA2 iGPU (gfx1036) 1,500 programs, the known form included, matched the reference. A 32-bit literal in a 16-bit source of `v_mad_u32_u16`/`v_mad_i32_i16` does not assemble, so literals there have 16 bits (zero-extended, measured). | ||
| 627 | |||
| 628 | ``` | ||
| 629 | python -I tools/vint_diff.py --programs 2000 --seed 1 | ||
| 630 | python -I tools/vint_diff.py --oracle hw --programs 500 --seed 1 | ||
| 631 | python -I tests/test_vint_diff.py | ||
| 632 | ``` | ||
| 633 | |||
| 616 | ### 16-bit and memory ops on the GPU (`tools/valu_fuzz.py`, FUZZ-2, FUZZ-5) | 634 | ### 16-bit and memory ops on the GPU (`tools/valu_fuzz.py`, FUZZ-2, FUZZ-5) |
| 617 | 635 | ||
| 618 | `tools/valu_fuzz.py --family f16|mem` uses the same runner shape as `lds_fuzz.py`. It generates seeded | 636 | `tools/valu_fuzz.py --family f16|mem` uses the same runner shape as `lds_fuzz.py`. It generates seeded |