mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-11 01:41:02 +00:00
The generator emits a guest poll such as `ldr w9, [x19]; cmp w9, #1; b.eq` as a plain C load, and clang hoists it out of the loop: the lock wait in f_7001fa0e2c compiled to `cmp; jne; jmp .`, so a thread that found the lock held spun forever after its holder released it. A fight run hung this way in 3 of 13 launches on an RX 9070, with the UBO snapshot on and off; gdb showed the thread on that `jmp` in every sample. The gate is an opaque call on every back-edge of the 868 loops tools/spin_waits.py lists, so each pass reloads memory: the exe goes from 182 self-jumps to 148, and 144 of those are the game's own `b .` instructions. 8 of 8 fight runs then passed; tests/diff/func.py with --patches passed 5470 cases on 878 functions, and the four probes passed on 1.4.3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>