OLD-3011: tests/semantic: run v_div_fixup_f32 through the translator, not a mock oracle (TEST-545) #762

Open
github-bot wants to merge 1 commit from github-bot/gh-762 into main AGit
Owner

@⁠whoalin1 on GitHub · 2026-11-24 13:34 UTC · original
whoalin1:test-545-real-oracle → main · +402 −903 · 3 files · 1 commits · open

Restores my open PR from the original repository (OLD-3011 / TEST-545), rebased onto current main (2d73c242f).

Claim: #14

Summary

  • tests/semantic/test_valu_div_fixup.py previously compared a hand-written Python model against itself without importing tools/rdna2spirv.py, so it passed regardless of what the translator emitted.
  • Replaces the self-testing mock oracle with real translator assertions against tools/rdna2spirv.py and spirv_mini_interp: pure-integer lowering op order and measured classification constants, NaN(S2) over NaN(S1) read off the dataflow, measured rule words, clamp/omod ordering, EXEC-masked preservation, and null-destination behavior.
  • Adds tests/semantic/fixtures/div_fixup_f32.asm and updates tests/semantic/README.md.

Verification (rebased on 2d73c242f)

  • py -3.14 -m unittest discover -s tests/semantic -p test_valu_div_fixup.py -v — 8/8 passed
  • py -3.14 -m unittest discover -s tests/semantic -p test_alu_div_fixup_f32.py -v — 4/4 passed
  • py -3.14 -I tests/test_text_write_line_endings.py — 3/3 passed

AI-assisted (Gemini 4 Neon).

**@⁠whoalin1** on GitHub · 2026-11-24 13:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/762) `whoalin1:test-545-real-oracle` → `main` · +402 −903 · 3 files · 1 commits · open Restores my open PR from the original repository (OLD-3011 / TEST-545), rebased onto current `main` (`2d73c242f`). Claim: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 ### Summary - `tests/semantic/test_valu_div_fixup.py` previously compared a hand-written Python model against itself without importing `tools/rdna2spirv.py`, so it passed regardless of what the translator emitted. - Replaces the self-testing mock oracle with real translator assertions against `tools/rdna2spirv.py` and `spirv_mini_interp`: pure-integer lowering op order and measured classification constants, `NaN(S2)` over `NaN(S1)` read off the dataflow, measured rule words, `clamp`/`omod` ordering, EXEC-masked preservation, and null-destination behavior. - Adds `tests/semantic/fixtures/div_fixup_f32.asm` and updates `tests/semantic/README.md`. ### Verification (rebased on `2d73c242f`) - `py -3.14 -m unittest discover -s tests/semantic -p test_valu_div_fixup.py -v` — **8/8 passed** - `py -3.14 -m unittest discover -s tests/semantic -p test_alu_div_fixup_f32.py -v` — **4/4 passed** - `py -3.14 -I tests/test_text_write_line_endings.py` — **3/3 passed** AI-assisted (Gemini 4 Neon).
tests/semantic/test_valu_div_fixup.py compared a hand-written Python model of the
fixup against itself and never imported tools/rdna2spirv.py, so it passed whatever
the translator did, and its rules had drifted from native RDNA2 (gfx1036) on six
points (NaN priority, the sign of 0/0 and inf/inf, inf(S2), the copysign of the
pass-through, NaN(S0), and the exponent-difference cutoff).

It now translates hand-written listings and asserts what the translator emits: the
pure-integer lowering's op order and classification constants, NaN(S2) above
NaN(S1) read off the dataflow, one word per measured rule through
spirv_mini_interp, and the EXEC-masked and null-destination cases. The f16 model
is gone rather than ported: the translator has no v_div_fixup_f16 lowering yet
(#2477 adds it with its own translator tests).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:20:08 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 13:35 UTC · original · approved these changes

Audited and verified. Clean-room compliant.

  • Connects v_div_fixup_f32 tests to the actual tools/rdna2spirv.py translator in tests/semantic/test_valu_div_fixup.py.
  • Validates pure-integer lowering op order, classification constants, and NaN priority through spirv_mini_interp execution.
  • Replaces disconnected model simulation with genuine translator test coverage.
**@⁠abnalstlll-byte** on GitHub · 2026-11-24 13:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/762#pullrequestreview-6040136231) · **approved these changes** Audited and verified. Clean-room compliant. - Connects v_div_fixup_f32 tests to the actual tools/rdna2spirv.py translator in tests/semantic/test_valu_div_fixup.py. - Validates pure-integer lowering op order, classification constants, and NaN priority through spirv_mini_interp execution. - Replaces disconnected model simulation with genuine translator test coverage.
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-25 20:02 UTC · original

Rebased cleanly onto current main (db1a22d29) to refresh the stale CI baseline; no conflicts. The branch remains the single TEST-545 semantic-oracle replacement commit. AI-assisted with Devin.

**@⁠whoalin1** on GitHub · 2026-11-25 20:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/762#issuecomment-7173114981) Rebased cleanly onto current main (`db1a22d29`) to refresh the stale CI baseline; no conflicts. The branch remains the single TEST-545 semantic-oracle replacement commit. AI-assisted with Devin.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/762/head:github-bot/gh-762'
git switch 'github-bot/gh-762'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-762'
git switch 'github-bot/gh-762'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-762'
git switch 'github-bot/gh-762'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-762'
git switch 'main'
git merge --squash 'github-bot/gh-762'
git switch 'main'
git merge --ff-only 'github-bot/gh-762'
git switch 'main'
git merge 'github-bot/gh-762'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.