SPIR-V: a fallback for GlobalAtomicAddF32 at an untracked global address #598
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!598
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/global-atomic-add-f32"
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?
OoT's compute program 499dbfd0721d2858 did not translate on
main(a598b9f):The float add's address isn't tracked to a storage buffer, and unlike the 32-bit integer atomics,
GlobalAtomicAddF32had no fallback.Change (SPIR-V back end only):
EmitGlobalAtomicAddF32now calls aDontInlinehelper built like the integer atomics' fallbacks. It searches the storage buffers by address, then the page table where stores follow it (gp_level >= 3). It computes the sum in a compare-exchange loop, as the storage buffers'f32_add_casdoes, and each attempt expects the word the previous exchange returned. When nothing holds the address it returns 0.0 and stores nothing.Tested on an RTX 4070 Ti (NVIDIA 595.99.02), Ubuntu 26.04, Linux build:
RX_VK_PREPARE_AGAIN=1: the program translates. The 6 failures left on this branch areATOMG.CAS, fixed separately in #597. With both branches together, the run prepares all 31985 programs with 0 failures.RX_VK_DUMP_SPV: this program's SPIR-V and the other 3812 dumped in that run all passspirv-val --target-env vulkan1.3 --scalar-block-layout.tests/test_global_atomic_add_f32.py(added to source-regressions) fails onmainand passes here.I didn't find which effect this program drives, so this shows it now translates and is valid SPIR-V, not a visible change.
Assisted-by: Claude Opus 5.5