tools: f32_fuzz translator-oracle applies the omod KNOWN_DEVIATIONS the GPU path applies (FUZZ-F32-ORACLE-DEV) #1498

Closed
thiefyzheng wants to merge 1 commit from upstream-pr/1498 into main
thiefyzheng commented 2026-11-25 02:15:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-11-25T02:15:28Z.


What

tools/f32_fuzz.py's translator-oracle check() path (line ~726) now consults the same KNOWN_DEVIATIONS rules the GPU-compare path already applies (line ~941): after the exact-match check fails, it asks each rule for an alternate expectation, classifies a hit as deviation:<name>, and counts/prints them per rule and op (known deviation omod_neg_zero x1: v_mul_legacy_f32). Match/mismatch verdicts and the undefined/skip accounting are untouched.

Why

The finding is @whoalin1's (coordination issue #14, 02:02Z, posted twice): the oracle path counted as a mismatch exactly the translator output that is measured hardware behavior — an active mul:2 turning a -0 result into +0, documented in docs/design.md's v_mul_legacy_f32 and output-modifier rows (native gfx1031/gfx1036 measurements: with IEEE off and f32 denormals flushed the omod is applied every time, and the 66 -0-result programs become +0). A differential fuzzer whose oracle path false-positives on documented-and-measured behavior trains people to ignore its output.

What I ran (CPU-only, current main lineage 3ff2a2adc, no GPU, no game files)

  • Seed 53 before: 1000 programs (seed 53): 936 match, 1 mismatch, 34 undefined in SPIR-V, 29 skipped + mismatch x1: v_mul_legacy_f32 (program 246, the finding's exact operands). After: 936 match, 0 mismatch, 34 undefined, 29 skipped + known deviation omod_neg_zero x1: v_mul_legacy_f32.
  • Regression sweep, seeds 1–30, before vs after: every summary line byte-identical (952 match, 0 mismatch… etc. per seed), zero new deviations, zero regressions — the classification only changes for the one program that hit the rule.
  • --self-test OK; tests/test_f32_fuzz.py — 29 tests OK (1 skipped, GPU).
  • scripts/check_no_game_data.py exit 0.

Not run

The GPU-compare path and any hardware oracle (no GPU needed or used; the path is untouched).

AI-assisted: a pi coding agent operated by the repo contributor ran the verification sweep and built the single-file diff; the finding is @whoalin1's.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5483837725 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1498). Originally posted by [thiefyzheng](https://github.com/thiefyzheng) on 2026-11-25T02:15:28Z. --- ## What `tools/f32_fuzz.py`'s translator-oracle `check()` path (line ~726) now consults the same `KNOWN_DEVIATIONS` rules the GPU-compare path already applies (line ~941): after the exact-match check fails, it asks each rule for an alternate expectation, classifies a hit as `deviation:<name>`, and counts/prints them per rule and op (`known deviation omod_neg_zero x1: v_mul_legacy_f32`). Match/mismatch verdicts and the undefined/skip accounting are untouched. ## Why The finding is @whoalin1's (coordination issue #14, 02:02Z, posted twice): the oracle path counted as a **mismatch** exactly the translator output that is measured hardware behavior — an active `mul:2` turning a `-0` result into `+0`, documented in docs/design.md's `v_mul_legacy_f32` and output-modifier rows (native gfx1031/gfx1036 measurements: with IEEE off and f32 denormals flushed the omod is applied every time, and the 66 `-0`-result programs become `+0`). A differential fuzzer whose oracle path false-positives on documented-and-measured behavior trains people to ignore its output. ## What I ran (CPU-only, current main lineage 3ff2a2adc, no GPU, no game files) - **Seed 53 before:** `1000 programs (seed 53): 936 match, 1 mismatch, 34 undefined in SPIR-V, 29 skipped` + `mismatch x1: v_mul_legacy_f32` (program 246, the finding's exact operands). **After:** `936 match, 0 mismatch, 34 undefined, 29 skipped` + `known deviation omod_neg_zero x1: v_mul_legacy_f32`. - **Regression sweep, seeds 1–30, before vs after:** every summary line byte-identical (`952 match, 0 mismatch…` etc. per seed), zero new deviations, zero regressions — the classification only changes for the one program that hit the rule. - `--self-test` OK; `tests/test_f32_fuzz.py` — 29 tests OK (1 skipped, GPU). - `scripts/check_no_game_data.py` exit 0. ## Not run The GPU-compare path and any hardware oracle (no GPU needed or used; the path is untouched). **AI-assisted**: a pi coding agent operated by the repo contributor ran the verification sweep and built the single-file diff; the finding is @whoalin1's.
PierreEbele commented 2026-11-25 02:17:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T02:17:16Z.


For the maintainers: this fixes the same false mismatch as #1459. Same function (check() in tools/f32_fuzz.py), same reproducer (--seed 53, program 246, v_mul_legacy_f32_e64 ... mul:2, model -0 vs translated +0). #1459 was claimed in #14 as F32-FUZZ-LEGACY-OMOD-ZERO at 00:36Z (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148694041) and opened at 00:39Z. I opened #1459 from this account.

The two diffs merge without a textual conflict, but only one is needed. How they differ:

  • #1459 changes the expected word to +0 for v_mul_legacy_f32 when an omod is active. The program then counts as a match. It adds test_legacy_mul_omod_turns_an_underflowed_minus_zero_into_plus_zero to tests/test_f32_fuzz.py, which fails on main for mul:2, mul:4 and div:2.
  • This PR reuses the KNOWN_DEVIATIONS rules from the GPU-compare path. The program is reported as deviation:omod_neg_zero instead of a match. It changes only tools/f32_fuzz.py and adds no test.

The maintainers can choose either approach. If they choose this one, #1459 can be closed.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7150535772 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1498#issuecomment-7150535772). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T02:17:16Z. --- For the maintainers: this fixes the same false mismatch as #1459. Same function (`check()` in `tools/f32_fuzz.py`), same reproducer (`--seed 53`, program 246, `v_mul_legacy_f32_e64 ... mul:2`, model -0 vs translated +0). #1459 was claimed in #14 as F32-FUZZ-LEGACY-OMOD-ZERO at 00:36Z (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148694041) and opened at 00:39Z. I opened #1459 from this account. The two diffs merge without a textual conflict, but only one is needed. How they differ: - #1459 changes the expected word to +0 for `v_mul_legacy_f32` when an omod is active. The program then counts as a match. It adds `test_legacy_mul_omod_turns_an_underflowed_minus_zero_into_plus_zero` to `tests/test_f32_fuzz.py`, which fails on main for `mul:2`, `mul:4` and `div:2`. - This PR reuses the `KNOWN_DEVIATIONS` rules from the GPU-compare path. The program is reported as `deviation:omod_neg_zero` instead of a match. It changes only `tools/f32_fuzz.py` and adds no test. The maintainers can choose either approach. If they choose this one, #1459 can be closed. AI-assisted.
ytsodacan commented 2026-11-25 03:36:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ytsodacan on 2026-11-25T03:36:36Z.


[KEEP]

  • Small and scoped (tools/f32_fuzz.py, +14/-1): check() now consults KNOWN_DEVIATIONS so the v_mul_legacy_f32 omod -0/+0 case is reported as deviation:omod_neg_zero instead of a mismatch.
  • Duplicates the fix in open #1459 (same function and reproducer, --seed 53 program 246), as the existing author comment notes. #1502 (f32_fuzz: judge translator-oracle mismatches against KNOWN_DEVIATIONS) is also open and appears to overlap. Only one approach should land; that is a maintainer decision.
  • Unlike #1459, this PR adds no test in tests/test_f32_fuzz.py.
  • No CI checks have run on head 262b1771.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7152074658 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1498#issuecomment-7152074658). Originally posted by [ytsodacan](https://github.com/ytsodacan) on 2026-11-25T03:36:36Z. --- **[KEEP]** - Small and scoped (`tools/f32_fuzz.py`, +14/-1): `check()` now consults `KNOWN_DEVIATIONS` so the `v_mul_legacy_f32` omod -0/+0 case is reported as `deviation:omod_neg_zero` instead of a mismatch. - Duplicates the fix in open #1459 (same function and reproducer, `--seed 53` program 246), as the existing author comment notes. #1502 (`f32_fuzz: judge translator-oracle mismatches against KNOWN_DEVIATIONS`) is also open and appears to overlap. Only one approach should land; that is a maintainer decision. - Unlike #1459, this PR adds no test in `tests/test_f32_fuzz.py`. - No CI checks have run on head `262b1771`.
ytsodacan commented 2026-11-25 03:42:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ytsodacan on 2026-11-25T03:42:37Z.


[CLOSE] as duplicate of #1459.

Reasons:

  • No tests. The PR changes only tools/f32_fuzz.py (+14/-1), so nothing guards the new behavior; the existing suite passes the same with or without it (29 tests OK on both main and this branch).
  • It is broader than the bug. check() now runs every KNOWN_DEVIATIONS entry for every op, but the only mismatch seen (seed 53 program 246) is v_mul_legacy_f32 with omod, where the translator already models +0 on purpose. For that case check now returns deviation:omod_neg_zero, which hides the fact that the model/translator disagree rather than fixing the oracle for that op.
  • It adds a new status string, deviation:<name>, that leaves check()'s documented match/mismatch/skip/undefined contract. Other callers would see an unexpected status, and translate_cases stops counting these cases as match or mismatch.
  • Because alt is judged with the same relaxed NaN rule, any KNOWN_DEVIATIONS added later is silently accepted on the translator path with no per-op scoping.

Worth porting (separately, with a test): the "known deviation ... xN: op n" summary lines in translate_cases. Reporting excused cases is useful, as long as they are asserted in a test.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7152169952 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1498#issuecomment-7152169952). Originally posted by [ytsodacan](https://github.com/ytsodacan) on 2026-11-25T03:42:37Z. --- **[CLOSE]** as duplicate of #1459. Reasons: - No tests. The PR changes only tools/f32_fuzz.py (+14/-1), so nothing guards the new behavior; the existing suite passes the same with or without it (29 tests OK on both main and this branch). - It is broader than the bug. `check()` now runs every `KNOWN_DEVIATIONS` entry for every op, but the only mismatch seen (seed 53 program 246) is `v_mul_legacy_f32` with omod, where the translator already models +0 on purpose. For that case `check` now returns `deviation:omod_neg_zero`, which hides the fact that the model/translator disagree rather than fixing the oracle for that op. - It adds a new status string, `deviation:<name>`, that leaves `check()`'s documented match/mismatch/skip/undefined contract. Other callers would see an unexpected status, and `translate_cases` stops counting these cases as match or mismatch. - Because `alt` is judged with the same relaxed NaN rule, any KNOWN_DEVIATIONS added later is silently accepted on the translator path with no per-op scoping. Worth porting (separately, with a test): the "known deviation ... xN: op n" summary lines in `translate_cases`. Reporting excused cases is useful, as long as they are asserted in a test.
thiefyzheng commented 2026-11-25 19:56:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-11-25T19:56:34Z.


Closing as a duplicate of #1459 (same function, same --seed 53 program 246 reproducer), as the reviewer noted: #1459 carries a regression test and this one does not. No objection to #1459 landing instead.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7172971787 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1498#issuecomment-7172971787). Originally posted by [thiefyzheng](https://github.com/thiefyzheng) on 2026-11-25T19:56:34Z. --- Closing as a duplicate of #1459 (same function, same `--seed 53` program 246 reproducer), as the reviewer noted: #1459 carries a regression test and this one does not. No objection to #1459 landing instead. AI-assisted (Claude Code).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1498
No description provided.