Commit Graph

106 Commits

Author SHA1 Message Date
741ae3ed43 Merge pull request #2028 from Bora Sevim
# Conflicts:
#	docs/design.md
2026-11-22 10:40:35 -05:00
4e477e98ab Merge pull request #1959 from SHAFAY04
# Conflicts:
#	docs/design.md
2026-11-22 10:39:49 -05:00
c20586fc58 pknorm_probe: v_cvt_pknorm_* give 0 for NaN on RDNA2, but round the exact product once (SHADER-339)
tools/pknorm_probe.py runs v_cvt_pknorm_i16_f32 / v_cvt_pknorm_u16_f32 through the translator on the CPU interpreter
and, with --oracle hw, natively through tools/hw_oracle in wave32 and wave64 under five MODEs. On an RDNA2 iGPU
(gfx1036) every NaN half (74 of 74: quiet, signalling, both signs, payloads, in S0 and S1) gives 0, as the translator
assumes, whatever IEEE, DX10_CLAMP and the f32 denormal mode are.

The rounding does not match: the hardware rounds the exact product x * 32767 (or 65535) once, while the translator
rounds the f32 OpFMul product and then RoundEven, one off on 28 of 28 near-tie inputs in both directions. Recorded in
docs/design.md and docs/shader_validation.md; the translator is not changed here. tests/test_pknorm_probe.py checks
four near-tie words against a hand derivation and the translator side's double rounding and NaN zero.
2026-11-22 18:35:49 +03:00
4eb6155d3a int_hw_probe: the five gfx1035 divergences are fixed; docs index and four tools follow the repo rules
- int_hw_probe: VOP3 clamp on the carry-out add/sub ops (#1831) and v_cvt_rpi/flr's exact floor(x+0.5) and NaN
  sign saturation (#1856) now translate as gfx1035 measured, so KNOWN_DIVERGENCES is empty. The known-divergence
  test reports a synthetic entry. shader_validation.md says so, and design.md loses the stale duplicate
  v_cvt_flr/rpi row a "both" merge left that still called them open.
- docs/README.md: one Other languages line (fr, pt-BR, zh-CN, pl-PL, tr, ru, ja); docs/i18n/README.md: one row
  each for pt-BR and zh-CN (the newer).
- anim_rigs, d16_format_probe, pe_shader_containers: text writes name newline="\n" (#1615);
  pe_shader_containers guards stdout (#1428).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:22:53 -05:00
d7f89c5af3 BUILD-162: translator also matches all 14,412 sweep cases on gfx1031 2026-11-22 20:08:25 +05:00
321529bf91 BUILD-162: DPP16/DPP8 sweep, measured on RDNA2 (RX 6700 XT, gfx1031)
crosslane_fuzz.py --dpp-sweep runs one program per DPP case instead of random
ones: every DPP16 control (335) x bound_ctrl x fi x 3 EXEC patterns, all 256
row_mask/bank_mask pairs, and 19 DPP8 select sets x fi (7,206 per wave size).
Ops rotate through mov/not/add/xor, half of them in place. Failures print
the case label, and a per-family table follows the summary.

Gen.op_dpp now builds through dpp_op() with the same random draws, so
existing --dpp seeds give the same programs (pinned by a test).

On an RX 6700 XT (gfx1031, Windows HIP oracle): --dpp-sweep --oracle hw
--wave both gives 14,412/14,412 matching, and random --dpp seeds 1-8 give
8,000/8,000. Docs updated (shader_validation.md FUZZ-7, design.md DPP row).

AI-assisted (Claude Code).
2026-11-22 20:04:37 +05:00
19e7023217 Merge pull request #1849 from Vonsek 2026-11-22 09:48:44 -05:00
773807f451 Merge pull request #1774 from Shadman PC
# Conflicts:
#	docs/design.md
#	docs/shader_validation.md
2026-11-22 09:48:15 -05:00
18d6f165cb Merge pull request #1759 from BetterJdue
# Conflicts:
#	docs/design.md
2026-11-22 09:48:12 -05:00
134b29a057 Merge pull request #789 from eIBart0 2026-11-22 09:47:59 -05:00
c51e308305 docs: the XGameSave shim is #279's, not main's; test backticked repo paths
docs/saves.md and the tools/saves.py docstring named
runtime/shims/xgameruntime_services.cpp as the runtime's save store; that file
is only in the open #279, and on main XGameSave* imports get the loader's
default answers. docs/shader_validation.md named spirv_mini_interp without
its .py. tests/test_docs_repo_paths.py checks that backticked tools/,
runtime/, tests/ and scripts/ paths in docs/ name tracked files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:32:24 +01:00
40e17da629 fix(translator): round v_fma_mixlo/hi_f16 once to f16 (SHADER-297)
Hardware measurement on RDNA2 (gfx1036, finding 7079901079) confirms that
v_fma_mixlo_f16 / v_fma_mixhi_f16 round the exact fma once, straight to
f16, across all rounding modes (7 of 7 discriminating cases in
tools/fma_mix_probe.py match single rounding). The translator previously
double-rounded in nearest-even mode (f32 Fma then f16 narrow).

Change v_fma_mixlo_f16 / v_fma_mixhi_f16 to use Gen.fma_mix_odd across all
modes, which rounds to odd at f32 so that narrowing to f16 gives the
exact single-rounded result in both nearest-even and toward-zero modes.

Update tests/test_fma_mix_probe.py and docs/shader_validation.md to reflect
the RDNA2 hardware measurement, and add discriminating semantic tests in
tests/semantic/test_valu_fma_mix.py.

AI-assisted.
2026-11-22 20:25:59 +06:00
6b5c01da49 Merge remote-tracking branch 'upstream/main' into d16-rounding-probe
# Conflicts:
#	docs/design.md
#	tools/rdna2spirv.py
2026-11-22 15:19:54 +01:00
963359576d Merge pull request #1774 from Shadman PC
# Conflicts:
#	docs/design.md
#	docs/shader_validation.md
2026-11-22 09:15:16 -05:00
d5b68b77dc Merge pull request #1746 from Youssef Rahmouni
# Conflicts:
#	docs/design.md
2026-11-22 09:15:02 -05:00
c0c0e8d98d Merge pull request #1741 from Kam471 2026-11-22 09:14:59 -05:00
9c326c2cd4 lds_fuzz.py: exercise ds_permute_b32 collisions and negative control (FUZZ-10) 2026-11-22 11:14:40 -03:00
383c68bb64 fix(translator): round v_fma_mixlo/hi_f16 once to f16 (SHADER-297)
Hardware measurement on RDNA2 (gfx1036, finding 7079901079) confirms that
v_fma_mixlo_f16 / v_fma_mixhi_f16 round the exact fma once, straight to
f16, across all rounding modes (7 of 7 discriminating cases in
tools/fma_mix_probe.py match single rounding). The translator previously
double-rounded in nearest-even mode (f32 Fma then f16 narrow).

Change v_fma_mixlo_f16 / v_fma_mixhi_f16 to use Gen.fma_mix_odd across all
modes, which rounds to odd at f32 so that narrowing to f16 gives the
exact single-rounded result in both nearest-even and toward-zero modes.

Update tests/test_fma_mix_probe.py and docs/shader_validation.md to reflect
the RDNA2 hardware measurement, and add discriminating semantic tests in
tests/semantic/test_valu_fma_mix.py.

AI-assisted.
2026-11-22 20:03:17 +06:00
9fa652f7a2 d16 typed buffer loads round the exact UNORM/SNORM quotient once, as RDNA2 does (BUILD-161)
docs/design.md narrowed the f16 of a typed d16 buffer load from the f32 decode with round to nearest even, and
called that rounding inferred, not measured. tools/d16_format_probe.py measures it through tools/hw_oracle: every
UNORM8, SNORM8, UNORM10, UNORM16 and SNORM16 value through buffer_load_format_d16_x, tbuffer_load_format_d16_x
and buffer_load_format_x, in wave32 and wave64, against several candidate rules, with a 16_FLOAT load, the kept
high half of d16_x and the staged inputs as controls.

On an RX 6700 (gfx1031) the hardware rounds the exact quotient once, straight to f16. Rounding to f32 first is
1 ulp high on exactly four values (UNORM16 0xffaf and 0xffef, SNORM16 0x7ff7 and 0x8009); over every width up to
16 bits only two f32 quotients land on an f16 halfway point (0x3f7ff000, 0x3f7fb000). Gen.d16_norm_f16 takes the
f16 below for those two, for normalized formats only. The f32 (non-d16) result was already right.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:50:45 +01:00
15359fba38 SHADER-137: RDNA2 hardware integer probe and gfx1035 measurements (wave32 & wave64) 2026-11-22 14:47:29 +01:00
17b36d7604 docs: attribute the 26,503 shader result to dcd8ecf, not the 26,501 run 2026-11-22 13:46:18 +00:00
3eea991891 Merge pull request #1722 from Sanonymous01 2026-11-22 08:38:46 -05:00
73c88c6ee2 Merge pull request #1682 from nonverifiedperson 2026-11-22 08:38:22 -05:00
0906a75f3d docs: SHADER-135 on RDNA2 (gfx1036): f16 omod and clamp, v_fma_mix* constants, NaNs, denormals and rounding
Raw kernels through the hardware oracle on a gfx1036 iGPU (AMD Windows driver
32.0.21044.64, HIP backend), 1,385 programs in wave32 and wave64, identical
words in both:

- an omod on an f16 result (v_add/mul/fma/fmac/cvt/exp/rcp_f16) acts only with
  IEEE 0 and denorm_mode_16_64 = 0; omod comes before clamp; clamp gives +0
  for -0 and, with DX10_CLAMP 1, for a NaN;
- v_fma_mix* operands: a float inline constant is f32 or the f16 constant
  (zero high half) by op_sel_hi, an integer constant its 32-bit integer;
  denormals follow the mode of their own width; NaN payloads are kept;
- v_fma_mixlo/mixhi_f16 round once (fma_mix_probe --oracle hw, 7 of 7 ties);
- v_exp_f16 / v_log_f16 repeat gfx1031's sweep counts exactly.

The translator is compared word for word and differs in five ways, listed
in docs/shader_validation.md; none is fixed here. Docs only. AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:32:59 +00:00
8a300e0e98 SHADER-136: measure v_rcp_iflag_f32 clamp/omod and re-run FUZZ-3 on gfx1036 via Windows HIP
tools/f32_fuzz.py gains v_rcp_iflag_f32, sharing v_rcp_f32's model (bit-identical on gfx1030 per design.md);
clamp and omod are what is new. On the integrated GPU of a Ryzen 7 9800X3D (gfx1036, AMD driver 32.0.13036.4,
Windows HIP launcher), seeds 1 to 6:

- full sweep on main 41f44826: 38,858 programs, 28,671 match, 0 mismatch, 56 known deviation, the same in
  every column as the Linux libdrm run on gfx1036; the negative control catches all six wrong models.
- --ops v_rcp_iflag_f32: 6,552 programs, 5,971 match, 0 mismatch, 35 omod_neg_zero deviations.

design.md's output-modifier row no longer says RDNA2 is unmeasured; shader_validation.md records both runs.
Tested: tests/test_f32_fuzz.py, f32_fuzz --self-test, tests/semantic (1,338 tests), compileall. AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:10:25 +01:00
e1ac59e7a0 Merge pull request #1620 from Luiz Neves 2026-11-22 08:08:13 -05:00
af0c2c7608 Merge pull request #1566 from AlxcBTW
# Conflicts:
#	docs/related_projects.md
2026-11-22 08:08:06 -05:00
53064a29fa hw_oracle: a MODE that gfx1170+ cannot set is reported, not assembled (FUZZ-43)
AMD clang rejects .amdhsa_ieee_mode and .amdhsa_dx10_clamp on gfx1170+
(GFX11.7 and GFX12, where the behaviour is fixed). A kernel asking for
either reached the assembler, and when a chunk held only such kernels the
run died with 'the assembler rejected every program in a chunk'.

asm.mode_skip_reason names the field and the architecture; Oracle.run
returns that reason for those kernels and never assembles them, so the
others still run and the MODE probes fail with a clear message. The
denormal and rounding fields are unaffected.

tests/test_hw_oracle.py covers the reason per architecture, a mixed run
and a run where every kernel is skipped. docs/shader_validation.md notes
it.
2026-11-22 09:41:01 -03:00
1ccaeef0c2 Merge pull request #1559 from Sanonymous01 2026-11-22 07:38:11 -05:00
4c544f5a79 Merge remote-tracking branch 'origin/main' into hw-oracle-image
# Conflicts:
#	tools/image_fuzz.py
2026-11-22 13:37:42 +01:00
719565bbc7 image_fuzz: --oracle hw, the image_load fetches as native kernels with a per-family T#
Runs the same texel fetches as raw compute kernels on the AMD GPU through tools/hw_oracle/: a linear texture the
kernel carries in its own code (256-byte aligned, found with s_getpc_b64), a T# built in s[8:15] for the GPU's family
(hw_oracle/tsharp.py: GFX11 on gfx11xx, GFX10 on gfx103x/gfx10xx), image_load with every dmask for one texel per lane,
all four result registers stored and compared word for word with the CPU model. --oracle translator,hw runs both on
the same textures; --negative-control checks seven wrong models and a wrong T# FORMAT are caught. Exit 77 without the
tools. gfx1150 is RDNA3.5, not RDNA2: the docs say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:16:24 +01:00
6b0e3dd1eb docs/shader_validation: valu_fuzz hardware oracle on RDNA2, v_pack_b32_f16 sNaN by IEEE mode
The valu_fuzz hardware oracle (#1365) had not run on RDNA2, and the
v_pack_b32_f16 row said "RDNA2 not measured". On a gfx1036 iGPU (AMD Windows
driver 32.0.21044.64, HIP backend, AMD clang 23):

- f16 and mem, seeds 101-105 x 2000 x wave32/wave64: 40,000 of 40,000 match,
  0 assembler rejections; every negative-control perturbation caught.
- translator,hw at seed 3: mem 200/200, f16 199/200; the difference is an AMD
  Vulkan driver mismatch of the #1506 kind.
- v_pack_b32_f16 quiets a signaling-NaN half under IEEE mode 1 and moves it
  unchanged under IEEE mode 0; neg flips the sign first.

BUILD-422. Docs only. AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:14:07 +00:00
3aeeedb9ac Merge pull request #1487 from Eremia Brinzoi Razvan Andrei 2026-11-22 07:07:52 -05:00
cbb770ff65 Merge pull request #1447 from Claude 2026-11-22 07:07:47 -05:00
2ea930e742 docs(shader): distinguish MTBUF and MUBUF reference channels
The differential fuzzer guide still described MTBUF selector behavior as unmeasured. Record the native bound, unbound and missing-channel behavior exercised by the reference tests.
2026-11-22 08:57:01 -03:00
449cb7b460 fuzzers: skip wave32 runs vk_compute_test could not pin to 32 lanes
valu_fuzz.py, lds_fuzz.py and crosslane_fuzz.py ask vk_compute_test for
32-lane subgroups (VKC_SUBGROUP_SIZE=32) for wave32 programs, but they
ignored its "compute subgroup size: 32 not available" line. On a device
that can't pin that size (Mesa llvmpipe: 8 lanes) every wave32 program
was judged at the driver's size and its cross-lane results came out as
translator mismatches. On main f85582e with llvmpipe, lds_fuzz --emulate
--programs 400 --seed 5150 gave 215 mismatches, all wave32, and
crosslane_fuzz --wave 32 --no-maskdata gave 68 of 100.

Those wave32 programs are now skips, as check.py's unpinned_subgroup_skip
does for its lane-mask dumps. Programs translated with --wave64-emulate
use no subgroup operations, so they are still compared at any size
(400 of 400 match on llvmpipe). crosslane_fuzz counts the skips in its
summary and exits 2 when every program was skipped, as the other two
fuzzers already do.

The line is parsed by compute_fixture.unpinned_subgroup, shared by the
three fuzzers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:33:45 +00:00
013cfb3966 tools: fma_mix_probe tells single from double f16 rounding of v_fma_mix
docs/design.md leaves one f16 question open: in round-to-nearest mode, does
v_fma_mixlo/hi_f16 round the exact x * y + z once to f16, or to f32 first
and then narrow? The translator does the second (f32 Fma, then f16_res).
The RX 6800 word behind the toward-zero rule can't settle it, because
1 * 2 - 2^-30 gives 0x4000 under both readings in nearest mode.

tools/fma_mix_probe.py has seven inputs where the two rules differ by one
f16 ulp, plus a control:
- ties just above and below, for both signs;
- the subnormal tie at 2^-25;
- the overflow tie at 65520;
- a tie made by the product;
- the same with f16 operands.
It reports which rule each side follows:
- the translator, on the CPU interpreter;
- --oracle hw: the native instruction on an AMD GPU, through
  tools/hw_oracle, under the game's inferred MODE;
- --oracle vulkan: the translated compute shader through vk_compute_test,
  with operands in user SGPRs so the driver can't fold them.

tests/test_fma_mix_probe.py checks:
- the expected words against a derivation written out by hand;
- that the translator follows the double rule today;
- that the compute listing gives the pixel shader's words;
- the verdict and exit codes.

On an RTX 5060 (621.24) the translated shader follows the translator's rule
on all eight inputs. A translator copy that uses fma_mix_odd in nearest mode
gives the single-rounded words on the CPU and on the GPU. That is the fix
if AMD hardware turns out to round once. The translator itself is unchanged.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:25:04 +02:00
863dd448a0 Merge pull request #1373 from StebanSchrader 2026-11-22 06:08:05 -05:00
4bde7b4685 Merge origin/main into hw-oracle-valu (one Kernel API: lds, vgprs, sgprs)
asm.py keeps main's lds/vgprs validation, lists in metadata and the 1024 workgroup size and adds sgprs per kernel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:02:18 +01:00
244f1510c4 hw_oracle: work with 2024 HIP runtimes and LLVM 23's true16
LLVM 23 writes code object v6, which amdhip64_6.dll refuses with error
209: retry the probe as v5 and keep that version for the run.

LLVM 23 also wants v8.l for 16-bit operands on GFX11: ask the assembler
once, and use that spelling for the f16 ops the oracle's tools run.

Tested on a Radeon 780M (gfx1103), driver 32.0.11020.1002.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:38:35 +00:00
eef40049f1 valu_fuzz: review fixes (signaling-NaN-only uncertainty, unjudged-word count, --skip-op validation, Kernel resource test)
mem translator path ran on the Radeon 880M: 400 of 400 match. Docs: --show line back in the options list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:35:23 +01:00
8a52cbcdf1 Merge origin/main; lds_fuzz: exit 77 for backends without LDS, GFX11-only cmpstore swap, perturb scoping, docs wording
Merges #1265 (libdrm backend, gfx10_spelling) keeping both raw_kernel_text changes. The kernel
metadata's .max_flat_workgroup_size is now 1024 (was 256) so 256-thread groups launch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:25:34 +01:00
032dfb9183 Merge origin/main into hw-oracle-valu 2026-11-22 11:21:38 +01:00
304a3d8d58 docs: LDS oracle translator results and the RDNA2 backend note
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:16:01 +01:00
c849e07f26 docs: valu_fuzz hardware oracle (f16 and mem), GFX10/GFX11 form table, results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:14:38 +01:00
6dcb298928 Merge remote-tracking branch 'origin/main' into hw-oracle-lds 2026-11-22 11:12:23 +01:00
71c731e394 Merge pull request #1310 from crastinator 2026-11-22 05:08:04 -05:00
734bf2dafe docs: hardware oracle for the LDS programs, SHADER-105 answer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:04:27 +01:00
d3ca882585 Tools: a Linux backend for the hardware oracle through libdrm_amdgpu, and its first runs on RDNA2
tools/hw_oracle ran only on Windows, through the HIP runtime in the AMD
driver, and so far only on gfx1150. On Linux the same kernels now run as
raw compute dispatches through the kernel driver: no ROCm, only clang
with the amdgcn target, gcc and the libdrm headers.

- hw_oracle_drm.c is the launcher. Its command stream is libdrm's own
  compute dispatch test for GFX10 (amdgpu_test_dispatch_memset), with
  what belongs to the kernel put in: the entry point, the group size,
  the kernarg pointer in two user SGPRs, and COMPUTE_PGM_RSRC1,
  COMPUTE_PGM_RSRC2 and the wave size as the kernel's descriptor has
  them. So the .amdhsa_* directives (register counts, float rounding
  and denormal modes, IEEE, DX10 clamp) take effect as under the HIP
  runtime. It prints the same lines as hw_oracle.c. Compute engine
  version 10 only (RDNA1 and RDNA2).
- drm.py is the backend: it assembles with clang, takes .text, the
  kernel offsets and the kernel descriptors out of the object, and runs
  the launcher. A descriptor that asks for what the launcher does not
  provide (LDS, scratch, more user SGPRs) is refused. The render node
  must be named in LEONIDA_HW_DRM_NODE, and a node with a display
  connected is refused unless LEONIDA_HW_DRM_ALLOW_DISPLAY=1.
- runner.open_oracle() picks the backend for the platform. The Windows
  path is unchanged.
- asm.raw_kernel_text puts the GFX10 names of the global memory
  instructions back for gfx10xx. crosslane_fuzz stores with
  global_store_b32, which a GFX10 assembler does not have, so on RDNA2
  every one of its programs was rejected.

One thing the launcher had to learn: while it rewrote one command buffer
in place, the second kernel of every process ran the first kernel's
commands (200 of 200 runs). Every submission now gets command memory of
its own; 24,500 distinct kernels in both wave sizes then each returned
their own words, and a test runs 300 of them.

Results on the integrated GPU of a Ryzen 9 7950X3D (Raphael, gfx1036),
Linux 7.3.5, libdrm 2.4.134, clang 23.1.5:

- salu_diff --oracle hw: 70,000 programs, 69,021 run, 0 mismatches
  (seeds 1-8; seeds 1-4 with --bfe-any; seeds 1-2 with --inline64). The
  s_bfe_i32 rule measured on gfx1150 holds on RDNA2, and s_ff0_i32_b32
  and s_ff0_i32_b64, which gfx1150 lacks, match (2,000 programs).
  --oracle translator,hw: 3,000 programs pass.
- crosslane_fuzz --oracle hw: 32,000 programs, 0 mismatches: seeds 1-6
  (12,000 wave32, 12,000 wave64, 6,586 with the permlane hypothesis)
  and seeds 1-2 with --dpp (8,000, 972 with the DPP hypothesis).
- f32_fuzz --oracle hw, seeds 1-6: 38,858 programs, 28,671 match, 0
  mismatches, 56 known deviations (an output modifier turns -0 into +0,
  as on gfx1150), the rest skipped or not judged. The four MODE settings
  read back as the descriptors set them.
- Controls: a reference with s_min_i32's SCC changed from < to <= gives
  2 mismatches in 5,000 programs, minimized to that instruction;
  crosslane_fuzz --permlane-fetch-inactive mismatches in 239 of 1,000;
  f32_fuzz --negative-control catches all six wrong models.
- No GPU fault, timeout or reset in the kernel log.

Tests: tests/test_hw_oracle.py gains tests of the backend that need no
GPU (reading the object and its descriptors, tokens, the display check,
the platform choice, the GFX10 mnemonics) and two on hardware: 300
distinct kernels, and an f32 rounding mode set in the descriptor that
must change a sum. The HIP-only test skips on Linux.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 04:57:17 -05:00
7c0bb5e17b Tools: every f16 input through the f16 transcendentals on the hardware oracle (FUZZ-29)
tools/f16_trans_sweep.py runs all 65,536 f16 bit patterns through v_exp/log/rcp/rsq/sqrt/sin/cos_f16 natively
(8 raw kernels of 1,024 threads per op), in wave32 and wave64 and five MODEs (IEEE, f16 denormal mode, f16
round toward zero), reads MODE back first, and compares each word with the exact result correctly rounded to
f16 (decimal, 60 digits; sin/cos reduced in turns). It counts bit-exact, 1 ulp, >1 ulp, denormals read or
written as zero, signalling NaNs kept or quieted, and the inputs where SPIR-V is undefined, and lists the words
of 23 special inputs.

On an RX 6700 XT (gfx1031): the five non-trigonometric ops are correctly rounded on every non-NaN input; sin/cos
are exact in turns over the whole f16 range (14 and 4 results 1 ulp off, all at |x| <= 1), while the f32
product 6.2831855 * x is >1 ulp off on 16,366 sin and 2,036 cos inputs (#594). denorm_mode_16_64 = 0 flushes
denormal operands and results, FP_ROUND's f16 field is ignored, IEEE only quiets signalling NaNs. The results
go into docs/design.md (a new f16 transcendentals row) and docs/shader_validation.md.
2026-11-22 11:57:04 +02:00