mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:50:52 +01:00
[PR #1287] [MERGED] rdna2spirv: flush literal MAD denormals (SHADER-LITERAL-MAD-DENORM) #1317
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#1317
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/1287
Author: @anonymechab-droid
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:fix/literal-mad-denorm📝 Commits (1)
fed33berdna2spirv: flush literal MAD denormals (SHADER-LITERAL-MAD-DENORM)📊 Changes
5 files changed (+119 additions, -18 deletions)
View changed files
📝
docs/design.md(+1 -1)➕
tests/semantic/fixtures/literal_mad_denorm.asm(+17 -0)➕
tests/semantic/test_literal_mad_denorm.py(+77 -0)📝
tests/semantic/test_valu_mad_lit.py(+19 -15)📝
tools/rdna2spirv.py(+5 -2)📄 Description
Claimed in the coordination issue as: SHADER-LITERAL-MAD-DENORM — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144562403
Depends on: none.
What and why
Literal MAD currently preserves f32 subnormals, unlike the existing
v_mad_f32lowering and Mesa ACO's documented always-flush rule forv_madak_f32/v_madmk_f32. For example, the synthetic calculation0x00000001 * 0x7e800000 + 0returns0x34000000instead of zero.Flush each operand, the separately rounded product and the final sum with the existing
Gen.flush_f32helper. Keep the literal operand order, separate rounding and destination masking. Add a hand-written fixture and 64 boundary/control combinations across both instructions and their_e32spellings, plus NaN propagation checks. Update the contract row with the Mesa reference and the limits of the verification.The existing negative controls now locate the multiply and add independently, preserving the intervening flush chain while still proving that operand swapping and accidental fusion change the result.
Tested
python -m unittest discover -s tests/semantic -p test_valu_mad_lit.py: 15 tests passed, including the adapted negative controls.python -I scripts/run_semantic_tests.py tests/semantic -j 12: 472 files, 6,180 tests, 0 files failed in 446 seconds, on the final commitfed33bea.python -m compileall -q make_game.py tools tests: passed.python -I tests/test_semantic_translator_use.py: 3 tests passed.python -I tests/test_docs_links.py: 16 tests passed.python -I tests/test_text_write_line_endings.py: 3 tests passed.python -I make_game.py --help,git diff --check, andscripts/check_no_game_data.pyon all five changed files: passed.Host: Windows, Python 3.14.7. GPUs tested: n/a (CPU interpreter only). No game files were used. Game-corpus translation/validation counts and
spirv-valresults are not available in this environment; the denormal rule has not been measured on a GPU here.Upstream GitHub Actions currently reports
action_requiredwith no jobs started for CI, No Game Data and Runtime; those remote workflows still need maintainer intervention.AI-assisted: yes (OpenAI Codex).
Checklist
mainat6261ca91; no dependencies.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.