Skip to content

FUZZ-55: binary64 VALU differential fuzzer (tools/f64_diff.py) - #4536

Open
iurysf wants to merge 6 commits into
ItsNotRexed:mainfrom
iurysf:leonida/FUZZ-f64-f64diff
Open

iurysf wants to merge 6 commits into
ItsNotRexed:mainfrom
iurysf:leonida/FUZZ-f64-f64diff

Conversation

@iurysf

@iurysf iurysf commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

FUZZ-55 - differential fuzzer for the binary64 (*_f64) VALU family, claimed in
#4257 (comment) (tracked as FUZZ-55 in the
coordination list).

Depends on: none.

Files: tools/f64_diff.py (new), tests/test_f64_diff.py (new), docs/shader_validation.md (a new
harness subsection only; no existing rows are touched).

Scope - the 47 *_f64 instruction forms main actually translates:

  • v_trunc_f64, v_ceil_f64, v_rndne_f64, v_floor_f64 (per-source abs/neg on the high word;
    omod first, then clamp);
  • v_add_f64 (including s_round_mode for MODE.FP_ROUND[3:2]), v_cvt_f32_f64, v_rcp_f64,
    v_rsq_f64, v_sqrt_f64;
  • v_div_fixup_f64, v_div_fmas_f64;
  • v_frexp_mant_f64, v_frexp_exp_i32_f64;
  • all 16 conditions of v_cmp_*_f64 / v_cmpx_*_f64, plus v_cmp_class_f64 / v_cmpx_class_f64.

Excluded (not translated on main; --list-ops names them): v_mul_f64, v_min_f64, v_max_f64,
v_fract_f64, v_cvt_f64_f32, v_ldexp_f64, v_mad_f64, v_cvt_i32_f64, v_cvt_u32_f64,
v_div_scale_f64.

Design - the fmisc_diff.py / sad_diff.py conventions: seeded straight-line programs, standard
library only, python -I, newline="\n"; two independent oracles compared word for word: a
reference written from the RDNA2 ISA pseudocode with exact rational arithmetic (Fraction, one
round-to-nearest-even per operation; shares no code with the translator), and tools/rdna2spirv.py
executed through tests/semantic/spirv_mini_interp.py; --oracle gpu runs the translated SPIR-V on
the local device via the vk_harness. Exit 0 all match / 1 mismatch (shortest failing program after
shrinking) / 2 harness error / 77 requested hardware oracle unavailable. Skips are always counted
with their reason.

KNOWN_DIVERGENCES (excluded by default; --known runs them):

Real runs (Windows 11, Python 3.14; every program synthetic, no game files):

  • CPU campaigns, seeds 1-5 x 300 programs: 327 / 316 / 325 / 320 / 324 matches, 0 mismatches,
    347 total each, skips counted with reasons (exit 0 each). Seed 7, 150 programs, --max-ops 4:
    138 matches, 0 mismatches, 197 total (exit 0).
  • --known --no-sweep --programs 0 --all-failures: 4 probes, 3 match, 1 mismatch
    (div-fixup-nan-s0), exit 1 as designed.
  • Negative control: a +1 mutation planted in the reference is caught (exit 1, shrunk to a one-line
    program) and the run passes again after restoring it; --self-test plants a translator mismatch,
    shrinks it to one instruction and checks 10 invariants.
  • tests/test_f64_diff.py: 16 tests OK. Docs gates: tests/test_docs_links.py 6 OK,
    tests/test_docs_repo_paths.py 2 OK, tests/test_docs_list_items.py 2 OK,
    tests/test_text_write_line_endings.py 3 OK. python -m compileall -q tools tests clean;
    git diff --check clean.

Optional GPU oracle (NVIDIA GeForce RTX 4070, subgroup 32, driver 621.01, Windows 11 build 26300,
Vulkan SDK 1.4.363.1, MSVC 14.44; vk_harness built in the worktree):

  • --oracle gpu --programs 300 --seed 1: 331 match, 0 mismatch, 347 total, 16 skips (exit 0).
  • --oracle gpu --programs 200 --seed 2 --max-ops 4: 218 match, 0 mismatch, 247 total, 29 skips
    (exit 0).
  • Targeted runs: v_cvt_f32_f64/v_rcp_f64/v_rsq_f64/v_sqrt_f64 (80 programs): 39 match,
    84 total, 45 skips; v_cmpx_lt/eq/class (40 programs): 43 match, 43 total, 0 skips.
  • GPU skips are explicit, never silent: binary64 InverseSqrt/Sqrt precision is
    implementation-defined per the SPIR-V contract, NVIDIA flushes subnormal inputs (FTZ), plus the
    CPU-interpreter classes. --oracle hw (AMD RDNA2 hardware oracle) is unavailable on this machine
    and exits 77 by design; adjudicating the div-fixup NaN(S0) rule needs an RDNA2 measurement
    (see Coordinating who works on what (23) (moved to #4571) #4421 (comment)).

No translator changes in this PR: any divergence found is reported as a finding: in the
coordination issue first. No game data anywhere. AI-assisted (OpenBot team).

AI-assisted (OpenBot team).

Explicitly count FTZ and implementation-defined GPU precision skips, execute known divergence probes, correct compare modeling, and reuse prepared GPU context when shrinking. CPU campaigns and RTX 4070 Vulkan shaderFloat64 campaigns finished with zero unexpected mismatches.

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this at 50b889e3 on Windows 11: python -I tests/test_f64_diff.py -> 16 tests, OK (41 s); git diff --check clean.

The new tools/f64_diff.py binary64 differential fuzzer and its hardening checks pass; docs remain counts/rules only. No blocking issue.

@Atomic258

Copy link
Copy Markdown

Tested 50b889e3c1 on Linux, Python 3.10, CPU only, synthetic fixtures, no game files: pass.

  • python -I tests/test_f64_diff.py → 16/16.
  • New tool tools/f64_diff.py (binary64 VALU differential fuzzer) + docs row; module absent on main, so no negative control — the suite builds its own synthetic inputs.
  • git diff --check and check_no_game_data.py clean.

AI-assisted (Devin).

@mrbean56

Copy link
Copy Markdown

Tested 50b889e3c1 on Linux (Debian 13), Python 3.13.5: pass.

  • pytest tests/test_f64_diff.py -q: 16 passed.
  • Negative control: tools/f64_diff.py does not exist on 03b09a08, so the test file cannot import it (15 of 16 fail). The one that passes is a pure-reference case that needs no tool, which is a good design: the reference is checked against itself first.
  • The probes are binary64 differentials against a plain-Python reference, so a wrong lowering shows up as a bit mismatch rather than a crash, and test_sqrt_preserves_negative_zero is exactly the kind of edge a sqrt lowering gets wrong.
  • No game data: the fuzzer generates its own inputs.

No GPU, no game data. AI-assisted.

@kapitche

kapitche commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Tested 50b889e merged with main 03b09a0 (already up to date) on Linux (WSL2) Python 3.12.16 and native Windows 11 Python 3.13.1: pass, with a coverage note.

  • tests/test_f64_diff.py: 16/16 OK on both (15 s Linux, 75 s Windows). f64_diff.py --self-test OK on both; --list-ops prints 47 forms plus the exclusion line; --programs 300 --seed 5 gives 324 match, 0 mismatch, 347 total on both OSes (identical skip counts).
  • Negative control (new files, so mutations of the reference in tools/f64_diff.py): none of three reference mutations is caught - lt evaluated as <=, add_bits returning 0 instead of a NaN, and the signed-zero rule removed. The unit tests and the default sweep/300 random programs all still pass (e.g. --ops v_cmp_lt_f64 under the <= mutation: 1 match, 0 mismatch). The compare, class, fixup and frexp reference functions have no direct test and the sweep uses one case per op, so equal operands and -0 are only reached by chance. Not a bug in the PR; a direct table test for those functions would pin them.
  • docs/shader_validation.md claims checked: 47 forms (pinned by the test), the option list matches the argparse flags. I did not run --oracle gpu or hw.
  • Interaction with TEST-983: v_div_fixup_f64 NaN(S0) returns signed infinity (measured on RDNA2) #4586 (open, changes v_div_fixup_f64 so NaN(S0) gives signed infinity): with that branch merged into this one, tests/test_f64_diff.py fails 2 tests (test_div_fixup_nan_s0_is_skipped_by_default_and_runs_with_known: 'match' != 'mismatch', and test_known_divergences_only_reinserted_with_known: return code 0, expected 1), because both assert the divergence TEST-983: v_div_fixup_f64 NaN(S0) returns signed infinity (measured on RDNA2) #4586 removes. Whichever lands second needs to drop that known-divergence probe or flip the expectation.

@bobcatchris

Copy link
Copy Markdown
Contributor

Cross-platform check on Apple M2 (macOS 26.4, arm64, Python 3.13.18) at head 50b889e: pytest -q tests/test_f64_diff.py tests/test_docs_links.py tests/test_docs_repo_paths.py tests/test_docs_list_items.py → 26 passed in 1.04 s. This only covers the CPU-interpreter path; the --oracle hw RDNA2 path is unavailable here. No game files.

AI-assisted.

@Flyander Flyander left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two actionable issues below: the advertised hardware oracle is unreachable, and the reference mishandles one directed-rounding signed-zero case.

Comment thread tools/f64_diff.py Outdated
if args.self_test: return 0 if self_test() else 1
gpu = None
if args.oracle == "hw":
print("hardware oracle unavailable: this host has no configured AMD hw_oracle", file=sys.stderr); return 77

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] This returns 77 unconditionally, so --oracle hw can never use an AMD tools/hw_oracle, even when configured; --hw-arch is consequently unused and run_one() sends every non-GPU oracle through the translator. That contradicts the CLI/docs contract and blocks using this fuzzer to adjudicate the documented RDNA2 divergence. Please detect whether the hardware oracle is unavailable, and route available runs through it.

Comment thread tools/f64_diff.py Outdated
if is_inf(a) or is_inf(b):
af, bf = to_float(a), to_float(b)
return from_float(af + bf)
negzero = (is_zero(a) and is_zero(b) and bool((a & b) >> 63)) or mode == 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] or mode == 2 makes every exact zero sum negative under round-toward-negative, including +0 + +0. IEEE 754-2019 section 6.3 says x + x retains the sign of x when x is zero, so this case must stay +0; only opposite-sign cancellation gets the directed-rounding zero sign. The translator currently skips directed-rounding programs, which makes this latent in current comparisons, but the reference claims to model all four modes. Please distinguish same-sign zero operands from exact cancellation and pin both signs in a reference test.

…the reference

Review follow-up on ItsNotRexed#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>
@iurysf

iurysf commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@Flyander, @kapitche, thanks. All three points are addressed in a new commit on top of 50b889e (no force-push): 7bd5f01.

  • --oracle hw now opens tools/hw_oracle the way tools/fmisc_diff.py does: one-lane wave32 raw kernels in the game's inferred MODE, one launch for the campaign, --hw-arch passed through, compared with the reference only. Exit 77 is returned only when the oracle is unavailable. v_rcp/v_rsq/v_sqrt_f64 are counted skips on hardware (native results are approximations, PROC-216), and KNOWN_DIVERGENCES does not filter hardware runs. The path is covered by tests with a fake oracle (routing, --hw-arch, 77, skips, shrinking); I have no AMD GPU here, so it has not been run on hardware yet.
  • Zero-sum sign (was tools/f64_diff.py:169, now :175-180): per IEEE 754-2019 §6.3, +0 + +0 stays +0 in every mode; only opposite-signed zeros and an exact x + (-x) give -0 when rounding toward negative. A reference test pins both signs across the four modes, and the old or mode == 2 rule fails it.
  • Coverage: direct table tests for compare (all 16 conditions over 28 pairs, including equal operands, ±0, NaN, ±inf), class, div_fixup, frexp and add_bits. The three mutations from the note (lt as <=, add_bits returning 0 for a NaN, the signed-zero rule removed) now each fail a test; reverted afterwards.

Checks at 7bd5f01 (Windows 11, python -I): tests/test_f64_diff.py 29 OK, --self-test OK, docs gates OK, git diff --check clean, CPU seeds 1-5 and 7 with 0 mismatches, RTX 4070 --oracle gpu runs with 0 mismatches; reviewed independently before pushing. div-fixup-nan-s0 stays in KNOWN_DIVERGENCES until #4586 (TEST-983, the RDNA2-measured fix) lands; I will drop it then.

AI-assisted (OpenBot team).

@TreXito

TreXito commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Tested head 7bd5f01 on current main: the v_div_fixup_f64 reference predates 48a1a98 ("v_div_fixup: match native RDNA2 gfx1036 hardware measurements", on main since round 43). With more programs per seed, that shows up as fuzz mismatches and 2 failing tests. The translator is the side that is right.

Setup: Linux 6.18 host, Python 3.13, CPU oracle only, main 7b7d73f. Its v_div_fixup_f64 lowering is the same as 48a1a98's.

1. Mismatches at 12000 programs per seed (--programs 12000 --all-failures):

seed match mismatch
776401 10830 15
776402 10867 25

All 40 are v_div_fixup_f64 with exp(S2) - exp(S1) >= 1024. The reference gives ±inf; the translator gives copysign(S0, sign_out). One shrunk example:

s_mov_b32 s5, 0x6bcaa545
v_div_fixup_f64 v[8:9], 3.25, 0x86297748c3c8da37, s[4:5]
expected: 00000000 fff00000   actual: 00000000 c00a0000

2. Two tests fail on current main (tests/test_f64_diff.py: 2 failed, 27 passed):

  • test_div_fixup_nan_s0_is_skipped_by_default_and_runs_with_known: 'match' != 'mismatch'.
  • test_known_divergences_only_reinserted_with_known: 0 != 1.

The cause is that main now maps NaN(S0) to ±inf, so div-fixup-nan-s0 is no longer a divergence.

What main implements (the v_div_fixup_f16, v_div_fixup_f64 row of docs/design.md, measured on gfx1036):

  • f64 underflow cutoff is e2 - e1 <= -1076;
  • there is no overflow check;
  • sNaN in S1/S2 passes through unquieted under IEEE=0;
  • NaN(S0) maps to ±inf.

Patch to fixup(), tested:

-    if is_nan(s2): return s2 | (1 << 51)
-    if is_nan(s1): return s1 | (1 << 51)
+    if is_nan(s2): return s2
+    if is_nan(s1): return s1
@@
-    if i1 or z2 or ediff < -1074: return sign
-    if z1 or i2 or ediff >= 1024 or is_nan(s0): return sign | EXP
+    if i1 or z2 or ediff <= -1076: return sign
+    if z1 or i2 or is_nan(s0): return sign | EXP
@@ (the KNOWN_DIVERGENCE guard in the step function)
-                               and -1074 <= ediff < 1024)
+                               and ediff > -1076)

With the patch, the same two seeds give 10845/12047 and 10890/12047 matching, 0 mismatches, exit 0 for both. The skips are the same reasons as before.

What else needs updating for the patch:

  • the div-fixup-nan-s0 entry and its two tests, since it now matches;
  • these test_div_fixup_table rows, each checked against the patched fixup():
row S0 S1 S2 want
nan_s2_quiets_s2 1.0 1.0 sNaN 0x7FF0000000000001 (unchanged)
nan_s1_quiets_s1 1.0 sNaN 1.0 0x7FF0000000000001 (unchanged)
underflow_edge_still_passes_s0 3.0 e(1076) e(1) 3.0 (ediff = -1075 passes)
underflow_to_zero / underflow_beats_nan_s0 3.0 / qNaN e(1077) e(1) +0
overflow_to_inf 3.0 e(1) e(1025) 3.0 (no overflow check)

Every other f64 op in both runs matched. AI-assisted (Claude Code), every number above is from a real run.

iurysf and others added 2 commits November 23, 2026 01:18
…Rexed#2477 is on main

ItsNotRexed#2477 (48a1a98) makes the translator return signed infinity for v_div_fixup_f64
with NaN(S0), as measured on RDNA2 gfx1036, which is what the reference already
modelled. The case is no longer a known divergence (as TreXito's review of ItsNotRexed#4536
observed: two tests fail on main because they expect the old divergence).

- Remove the div-fixup-nan-s0 entry, its reference skip and its dedicated --known
  program; NaN(S0) programs are compared like any other.
- Add a positive test that the reference and the translator give +-inf for qNaN,
  -qNaN and sNaN with both output signs.
- Rework the two --known tests so they no longer depend on div_fixup: the three
  remaining forms are excluded with a reason by default, run with --known, and a
  planted clamp-only translator error exits 1 and prints the shrunk program.
- docs/shader_validation.md no longer lists the div_fixup case.

Same change as 41525870 (prepared for ItsNotRexed#4586, which ItsNotRexed#2477 made redundant).

AI-assisted (OpenBot team).

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
…nts on main (ItsNotRexed#2477)

TreXito's review of ItsNotRexed#4536 found 40 mismatches in 24000 programs (seeds 776401 and
776402, exp(S2) - exp(S1) >= 1024): the reference predates ItsNotRexed#2477 (48a1a98),
whose measured RDNA2 gfx1036 rules are in the docs/design.md v_div_fixup row.
The translator is the side that is right. Checked against that row and against
the v_div_fixup_f64 lowering in tools/rdna2spirv.py on main, not only against the
proposed patch:

- NaN in S2 or S1 passes through unchanged (a signalling NaN is not quieted with
  IEEE=0); the priority NaN(S2) over NaN(S1) is unchanged.
- The underflow cutoff is exp(S2) - exp(S1) <= -1076 (was < -1074).
- There is no overflow check (was >= 1024).
- NaN(S0) gives signed infinity, still below the underflow case.

test_div_fixup_table is updated row by row (gap 1074/1075 pass S0, 1076 gives a
signed zero, no overflow rows, unquieted sNaN) and docs/shader_validation.md
records the rule.

AI-assisted (OpenBot team).

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
Found while validating the ItsNotRexed#2477 follow-up on the RTX 4070: with the current
translator, `v_cmp_eq_i32_e32 vcc_lo, 0, 0; v_div_fmas_f64 v[8:9], s[4:5], -1.0, 1`
mismatched. The reference scaled by a fixed 2^64 when VCC is set; main now follows the
hardware-verified (gfx1036, 153/153 f64 stress cases) rule in the docs/design.md
v_div_fmas row: 2^+128 when exp(S2) > 1023 (|S2| >= 2.0), 2^-128 otherwise.

Same class of stale reference as the v_div_fixup_f64 one fixed in the previous
commit (TreXito's review of ItsNotRexed#4536). A table test pins both sides of the |S2| = 2.0
threshold and the VCC-clear case; reverting to the fixed 2^64 fails it.

AI-assisted (OpenBot team).

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
@abnalstlll-byte

Copy link
Copy Markdown
Contributor

Tested head 7bd5f01d locally on Windows 11: 29/29 unit tests passed and 10/10 --self-test cases passed.

Live hardware test on native RDNA2 gfx1036 (tools/hw_oracle, Windows 11, AMD driver 32.0.21045.29003): --oracle hw connects to the device (device=AMD Radeon(TM) Graphics arch=gfx1036), 24 match, 6 skips, and 1 mismatch caught on minimal program s_mov_b32 s5, 0x6b82ed5c (word 1: expected 00000001 ffffffff, actual 00000001 00000001). No game files. AI-assisted review (Gemini).

@kapitche

Copy link
Copy Markdown
Contributor

Tested 7bd5f01 merged with main 98fa503 on Linux (Python 3.12.16): fail - tests/test_f64_diff.py 29 tests, 2 FAIL, 27 OK; tests/test_docs_*.py all OK. The two failures are test_div_fixup_nan_s0_is_skipped_by_default_and_runs_with_known (known run returns "match", the test expects "mismatch") and test_known_divergences_only_reinserted_with_known (returncode 0, expected 1). Cause: main now has 48a1a98 ("v_div_fixup: match native RDNA2 gfx1036 hardware measurements"), which landed after this branch's base 03b09a0 and makes the translator handle NaN(S0), so the div-fixup-nan-s0 entry in KNOWN_DIVERGENCES ("current translator preserves the NaN payload") is stale and the tests that expect it to diverge no longer hold. Negative control: with tools/f64_diff.py removed the test module cannot import (not informative beyond that).

The reviewer's `--oracle gpu --ops v_div_fmas_f64 --programs 300 --seed 1` run had one
mismatch: `v_div_fmas_f64 v[8:9], 16, 0xa5126aa7ea6efc1f, 0` (VCC clear), reference -0,
GPU +0. Diagnosis (RTX 4070):

- IEEE is -0: the exact result is a negative nonzero that underflows, and the C library
  fma and the reference agree. Denormal operands are preserved by the GPU, so it is not
  operand flush-to-zero.
- The translator emits a plain GLSL `Fma` for that path (SPIR-V checked), and adding
  SignedZeroInfNanPreserve/DenormPreserve 64 does not change the GPU result.
- The same `Fma(2^-600, -2^-600, +0)` on runtime operands (a FragCoord-derived shader)
  returns -0 on the GPU. Only an all-constant `Fma` loses the zero sign, which points at
  the driver folding it. The fuzz shaders are all constants.

So neither the reference nor the translator is wrong. A GPU result that differs from
the reference only in the sign of such a zero (an underflowing Fma against an
opposite-signed zero addend) is now a counted skip with that reason; any other
difference still fails. ref_program reports the case through an optional notes list.
Tests pin the flag, the skip, and that a flip without the underflow, or with another
differing word, stays a mismatch (four mutations fail them). docs/shader_validation.md
records the diagnosis.

AI-assisted (OpenBot team).

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
@kapitche

kapitche commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Tested 8803b72 merged with main ec34b54 on Linux (WSL), Python 3.12.16 (-I), and native Windows 11, Python 3.13.1: pass

Re-check of my earlier fail at 7bd5f01 (2 failing tests, stale div-fixup-nan-s0 known divergence after 48a1a98):

  • test_div_fixup_nan_s0_is_skipped_by_default_and_runs_with_known and test_known_divergences_only_reinserted_with_known: resolved. div-fixup-nan-s0 is gone from KNOWN_DIVERGENCES (now only f64-omod, double-neg-abs, fclamp-nan-zero) and the reference follows the gfx1036 NaN(S0) rule from main.
  • The follow-up interaction I noted with TEST-983: v_div_fixup_f64 NaN(S0) returns signed infinity (measured on RDNA2) #4586 (NaN(S0) known divergence) is also gone with that change.

Counts:

  • tests/test_f64_diff.py: 33 tests OK on Linux (24 s) and on Windows (117 s). The previous head (7671b9b) also passed 31/31 on both.
  • tools/f64_diff.py --self-test: OK on Linux. --programs 300 --seed 5: 315 match, 0 mismatch; 347 total on both OSes.
  • All tests/test_docs_*.py OK on Linux.
  • Not run: --oracle gpu / --oracle hw.

Negative control (new files, so reference mutations in tools/f64_diff.py): lt evaluated as <= fails 8 tests at 8803b72. At the previous head 7671b9b, add_bits returning 0 for a NaN input failed 21 tests and dropping the same-sign zero-sum rule failed 4 (not rerun at 8803b72). The three mutations I reported as undetected earlier at 50b889e are therefore caught.

@abnalstlll-byte

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with Python 3.14 on HEAD \8803b723:

\python -m unittest tests/test_f64_diff.py\ ran 33 tests with 1 failure in \ est_div_fixup_nan_s0_gives_signed_infinity_in_reference_and_translator:
\
AssertionError: 'mismatch' != 'match' : ('word comparison', [0, 2146435072, 0, 0], [0, 2146959360, 0, 0])
\
In case 0 (\�_mov_b32 v13, 0x7ff80000, \1.0, \2.0):

  • \expected: [0, 2146435072, 0, 0]\ (\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants