mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:35:53 +01:00
[PR #1459] f32_fuzz: judge v_mul_legacy_f32 omod -0 against the +0 the translator models #1489
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1489
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1459
Author: @PierreEbele
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:f32-fuzz-legacy-omod-zero📝 Commits (1)
93d0c20f32_fuzz: judge v_mul_legacy_f32 omod -0 against the +0 the translator models📊 Changes
2 files changed (+20 additions, -0 deletions)
View changed files
📝
tests/test_f32_fuzz.py(+12 -0)📝
tools/f32_fuzz.py(+8 -0)📄 Description
tools/f32_fuzz.pyreports a false translator mismatch forv_mul_legacy_f32with an output modifier when the product underflows to -0.Reproducer on main (CPU only):
python3 -I tools/f32_fuzz.py --programs 1500 --seed 53exits 1:The translator's +0 is intended. Its
v_mul_legacy_f32branch intools/rdna2spirv.pyapplies the measured IEEE-off omod rule (a -0 result becomes +0 undermul:2/mul:4/div:2; docs/design.md rows "v_mul_legacy_f32default-mode f32 denormal flushing" and "Output modifiers on hardware"). The fuzzer's hardware side already treats this as the known deviationdev_omod_neg_zero. The translator-sidecheck(), however, still compared against the ISA-text model's -0.Change:
check()now expects +0 in that case (only for the ops listed inTRANSLATOR_OMOD_POS_ZERO, currentlyv_mul_legacy_f32).model()and the hardware path are unchanged, andv_mul_f32, whose translation keeps -0, is still judged as before.Tests (Linux arm64, no GPU):
test_legacy_mul_omod_turns_an_underflowed_minus_zero_into_plus_zerointests/test_f32_fuzz.py: fails on main (3 subtests:mul:2,mul:4,div:2) and passes on this branch. The whole file gives 30 tests, OK (1 skipped: needs the hw oracle).python3 -I tools/f32_fuzz.py --programs 1500 --seed 53: exit 1 on main, exit 0 here.scripts/check_no_game_data.pyon both files: clean.The case was found by a translator-oracle fuzzing campaign (seeds 41–56). No game data is involved and no GPU is needed.
AI-assisted.
Claimed in the coordination issue as: F32-FUZZ-LEGACY-OMOD-ZERO
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.