mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #2142] [MERGED] rdna2spirv: take a v_fma_mix literal from the printed encoding when only the text is cut (SHADER-FMA-MIX-TEXT-CUT-LITERAL) #2146
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#2146
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/2142
Author: @DadaCap
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142
Base:
main← Head:mix-literal-text-cut📝 Commits (2)
a449806rdna2spirv: take a v_fma_mix literal from the printed encoding when only the text is cut (SHADER-FMA-MIX-TEXT-CUT-LITERAL)abcccefrdna2spirv: restore a text-cut v_fma_mix literal with no blob too; pin the low-half guard📊 Changes
3 files changed (+31 additions, -1 deletions)
View changed files
📝
docs/design.md(+1 -1)📝
tests/semantic/test_fma_mix_literal.py(+14 -0)📝
tools/rdna2spirv.py(+16 -0)📄 Description
Claimed in the coordination issue as: SHADER-FMA-MIX-TEXT-CUT-LITERAL (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7176772104)
Depends on: nothing
What and why
llvm-mc 21.1.8 can print a
v_fma_mix*literal cut to its low 16 bits in the text only, while the printed encoding keeps all 32 bits. With the test's own values: the stored literal is0x40004200(low half 3.0, high half 2.0), the text says0x4200, and the printed encoding ends in00 42 00 40.same_encoding) passes, because the printed bytes are the stored ones.mix_literal(for an encoding that is cut too), never runs.restore_text_cut_mix_literaltakes the literal from the printed encoding when the text names only its low half and the high half is not zero. It runs on both the clean-listing path (check_printed_encodings) and the re-anchoring path (listings with undecodable words). The samerestore_mix_literalas before gives the 32 bits to every source the bytes encode as the literal.Counts over 1.0.2.1 (one work folder's listings, llvm-mc 21.1.8)
The FSPX program is the upscaler's history pass: one resampling weight lost its high half, so the weights summed to more than 1 and the history grew each frame.
Measured in the game
That one upscaler program retranslated with this change; RTX 5080, NVIDIA 621.24, Windows 11, a local tree with other open work:
That run had other local changes too, so it is not a clean A/B. The whole library retranslated with this change: 2,479 of 2,479 programs translate as before, none lost.
Tested
tests/semantic/test_fma_mix_literal.py: newtest_text_cut_but_printed_encoding_whole(clean and re-anchoring paths). It fails without the change (6.0 instead of 8.0) and passes with it; the file's other 18 tests pass.tests/test_docs_*.py,scripts/check_no_game_data.pyon the changed files.spirv-val.GPUs tested: NVIDIA GeForce RTX 5080, driver 621.24, Windows 11 (the game run above; the hand-written GPU tests were not run)
AI-assisted: yes (Claude Code, Claude Opus 5.5 wrote the change, the test and this text)
Checklist
mainand merges cleanly.docs/design.md, with how it was confirmed.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.