upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authoriurysf <98192149+iurysf@users.noreply.github.com>2026-11-22 23:55:19 -0300
committeriurysf <98192149+iurysf@users.noreply.github.com>2026-11-22 23:55:19 -0300
commit7bd5f01dd166dfcf80f4f96bb678cccc5918a7bc (patch)
treec7e5c084d5948036e64649f848f9c690930c60b2 /docs
parent50b889e3c19360e96eaa1c14a0e216f4fb8c0cfa (diff)
FUZZ-55: Route --oracle hw through hw_oracle, fix zero-sum sign, pin the reference
Review follow-up on #4536 (CHANGES_REQUESTED by Flyander; coverage note by kapitche). - --oracle hw no longer always exits 77. It opens tools/hw_oracle (same pattern as tools/fmisc_diff.py), runs each program as a one-lane wave32 raw kernel in the game's inferred MODE, honours --hw-arch, and compares the four words with the reference. 77 is returned only when the oracle is unavailable. v_rcp/v_rsq/v_sqrt_f64 are counted skips there (native results are approximations, PROC-216); the translator-only known-divergence exclusions do not apply to hardware. - add_bits: an exact zero sum now follows IEEE 754-2019 6.3. +0 + +0 stays +0 in every mode; only opposite-signed zeros and x + (-x) give -0 when rounding toward negative. Before, every exact zero was -0 in that mode. - tests: direct table tests for compare (16 conditions x 28 operand pairs), class (10 classes plus boundaries), div_fixup, frexp and add_bits (NaN, inf, zero signs in all four modes), plus fake-oracle tests for hw routing, --hw-arch, exit 77, skips and shrinking. Mutating lt to <=, add_bits NaN to 0, or dropping the signed-zero rule now fails them. - docs/shader_validation.md describes the hw contract. No AMD hardware run has been done. KNOWN_DIVERGENCES keeps div-fixup-nan-s0 (it waits for TEST-983 to reach main). AI-assisted (OpenBot team). Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/shader_validation.md13
1 files changed, 12 insertions, 1 deletions
diff --git a/docs/shader_validation.md b/docs/shader_validation.md
index caa54dc4e..5eb987cb5 100644
--- a/docs/shader_validation.md
+++ b/docs/shader_validation.md
@@ -1238,7 +1238,17 @@ the minimized case is printed. `--oracle gpu` translates the same
1238fragment shader and runs it through `runtime/build/vk_harness`, comparing the raw RGBA32F output words. It assembles 1238fragment shader and runs it through `runtime/build/vk_harness`, comparing the raw RGBA32F output words. It assembles
1239the fragment module with `spirv-as` and the full-screen vertex shader with the Vulkan SDK's `glslc`; use `--exe PATH` 1239the fragment module with `spirv-as` and the full-screen vertex shader with the Vulkan SDK's `glslc`; use `--exe PATH`
1240to select another `vk_harness`. It exits 77 if the executable, SDK tools, Vulkan device or required `shaderFloat64` 1240to select another `vk_harness`. It exits 77 if the executable, SDK tools, Vulkan device or required `shaderFloat64`
1241feature is unavailable. `--oracle hw` requires the AMD `tools/hw_oracle` setup and likewise exits 77 when unavailable. 1241feature is unavailable. `--oracle hw` runs the same programs natively on an AMD GPU through `tools/hw_oracle` (one lane
1242of a wave32 compute kernel, as `tools/fmisc_diff.py` does) and compares the four words with the reference only, not with
1243the translator; `--hw-arch` picks the architecture to assemble for (default: detected). The campaign is one launch, and a
1244failing program is re-run alone while it is shrunk. The hardware runs every form, so the known-divergence exclusions
1245(translator limits) do not apply: output modifiers, clamp, negated/absolute operands and directed rounding are compared
1246too, and the kernels start in the game's inferred float MODE (IEEE off, DX10_CLAMP on). `v_rcp_f64`, `v_rsq_f64` and
1247`v_sqrt_f64` are counted skips there, because the native results are approximations (PROC-216) and the reference is exact;
1248an architecture that cannot set that MODE (gfx1170 and later) or a program the assembler rejects is a counted skip with the
1249runner's reason. It exits 77 only when the `tools/hw_oracle` tools or device are missing. The path is covered by
1250`tests/test_f64_diff.py` with a fake oracle (routing, `--hw-arch`, exit 77, skips, shrinking); **no AMD hardware run has
1251been done for it yet**.
1242Exit codes are 0 for no unexpected 1252Exit codes are 0 for no unexpected
1243mismatch, 1 for a mismatch (with instruction-removal shrinking), 2 for CLI/harness errors and 77 for unavailable 1253mismatch, 1 for a mismatch (with instruction-removal shrinking), 2 for CLI/harness errors and 77 for unavailable
1244oracles. Skips always include a reason. 1254oracles. Skips always include a reason.
@@ -1247,6 +1257,7 @@ oracles. Skips always include a reason.
1247python -I tools/f64_diff.py --programs 300 --seed 1 1257python -I tools/f64_diff.py --programs 300 --seed 1
1248python -I tools/f64_diff.py --known --programs 300 --seed 1 1258python -I tools/f64_diff.py --known --programs 300 --seed 1
1249python -I tools/f64_diff.py --oracle gpu --programs 300 --seed 1 1259python -I tools/f64_diff.py --oracle gpu --programs 300 --seed 1
1260python -I tools/f64_diff.py --oracle hw --programs 300 --seed 1
1250python -I tools/f64_diff.py --self-test 1261python -I tools/f64_diff.py --self-test
1251python -I tests/test_f64_diff.py 1262python -I tests/test_f64_diff.py
1252``` 1263```