mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:55:52 +01:00
[PR #181] [MERGED] rdna2spirv: index records the --fma mode the shader was translated under (OLD-5267) #233
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#233
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/181
Author: @ItsMrDubey
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism
Base:
main← Head:fma-index-options📝 Commits (1)
e328a59rdna2spirv: the index's fma field is the mode the shader was translated under📊 Changes
2 files changed (+17 additions, -1 deletions)
View changed files
📝
tests/semantic/test_fma_khr.py(+13 -0)📝
tools/rdna2spirv.py(+4 -1)📄 Description
Claimed in the coordination issue as: OLD-5267 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7119646964)
What and why
old #5267:
shader_metafilled the index'sfmafield (glsl,khrorexact) from the module globalsFMA_KHR/FMA_EXACTat indexing time. If a caller translated a shader and changed the option before indexing it, the field showed the later option and not the one the code was emitted under.test_fma_exact.translateis one such caller: it restores the globals right after translating. A--fma khrmodule could then be indexed asglslwhile still listingshaderFmaFloat32, andcheck.pytrusts the recorded mode over everything else (TEST-1147).Fix:
Genstores the mode in effect when translation starts (fma_mode), andshader_metawrites that value. Therdna2spirv.pycommand line behaves as before, because it sets the option once before any translation.Tested
Windows 11, Python 3.11.9, no GPU needed.
origin/main: av_fma_f32listing translated underkhrorexact, then indexed after the option was reset toglsl, was recorded asglsl.test_index_records_the_mode_of_the_translationintests/semantic/test_fma_khr.pycovers khr→glsl, exact→glsl, glsl→khr and glsl→exact. Onorigin/mainall 4 subtests fail. With the fix,python -I -m unittest discover -s tests/semantic -p test_fma_khr.pypasses 10 tests (1 skipped: no SPIRV-Tools).python -I scripts/run_semantic_tests.py tests/semantic: 463 files and 6076 tests. 4 files fail:test_exec_computed,test_image_atomics_guard,test_sopc_validationandtest_unary_f16_validation. They fail the same way on unmodifiedorigin/main(2, 47, 1 and 15 failures).python -I tests/test_shader_checks.pypasses.python -m pytest tests/test_translate.py tests/test_mesh_compute.pypasses, with most tests skipped because there is no llvm-mc.python -I scripts/check_no_game_data.pyon both changed files: clean.AI-assisted: yes
Checklist
docs/design.md(index metadata only; the emitted SPIR-V is unchanged).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.