rdna2spirv: index records the --fma mode the shader was translated under (OLD-5267) #181
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!181
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/181/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?
@ItsMrDubey on GitHub · 2026-11-24 02:37 UTC · original
ItsMrDubey:fma-index-options→main· +17 −1 · 2 files · 1 commits · merged 2026-11-24 03:28 UTCClaimed in the coordination issue as: OLD-5267 (#14)
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).