rdna2spirv: flush literal MAD denormals (SHADER-LITERAL-MAD-DENORM) #1287
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1287
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1287/head"
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?
@anonymechab-droid on GitHub · 2026-11-24 21:16 UTC · original
anonymechab-droid:fix/literal-mad-denorm→main· +119 −18 · 5 files · 1 commits · merged 2026-11-25 02:38 UTCClaimed in the coordination issue as: SHADER-LITERAL-MAD-DENORM — #14
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.@aslan2142 on GitHub · 2026-11-25 02:39 UTC · original
Merged. Thanks.
SHADER-LITERAL-MAD-DENORM, valid.v_madak_f32andv_madmk_f32flush denormals the same waymain'sv_mad_f32path already does; the contract row is updated and says the rule is confirmed on the CPU.main; all pass with the change.main82f033512+fed33beaf: the semantic suite passes (486 files, 6,275 tests, 0 files failed); the 14 docs and writer tests pass;check_no_game_data.pyis clean on the 5 changed files.AI-assisted (Claude Code, Claude Opus 5.5).