From f3efc5806c4f87d13324c24312272cbba7a0157a Mon Sep 17 00:00:00 2001 From: project-snail Date: Sat, 14 Nov 2026 20:49:03 +0800 Subject: [PATCH 1/2] Send an empty charged-attack hit list to the game's own count == 0 check The weapon's hit-record pool holds 10 records, and one charged swing above 60 fps fills it: the insert fails, and the list of hits made this frame stays empty. main+0x2906de0 then reads the empty list's slot, which holds a stale stack value, and passes it to the hit handler before the game's own count == 0 check would return; the stale value here pointed at the temp hit map and the read at main+0x870158 faulted reading 0x100000000a. Both count == 0 branches now go to main+0x2906df0, the game's check, under the realtime set. A non-empty list is unchanged, and below 60 fps the pool never fills. Verified on 1.4.3: a charged spear attack on an enemy at 120 and 144 fps no longer faults, and the damage at 60 and 120 fps matches the build without this patch. --- recomp/patches-v143.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/recomp/patches-v143.txt b/recomp/patches-v143.txt index b1d61295..16f0a79a 100644 --- a/recomp/patches-v143.txt +++ b/recomp/patches-v143.txt @@ -42,6 +42,13 @@ site realtime main 2daa78 1e210800 d503201f # fmul s0, s0, s1 -> nop # keeps equipment locked until a load. Stepping while above 0 takes the remainder below 0 like any other last step. site realtime main 2b036c 0f016681 0f000401 # movi v1.2s, #0x34, lsl #24 (FLT_EPSILON) -> movi v1.2s, #0 +# Charged-attack hit records above 60 fps: the weapon's hit pool holds 10 records and one charged swing at a high +# frame rate fills it; the insert then fails and the list of hits made this frame stays empty. The game reads the +# empty list's slot (main+0x2906de0) and dereferences it before its own count == 0 check, which faults. Send both +# count == 0 branches to that check (main+0x2906df0) instead; a non-empty list is unchanged. +site realtime main 2906d98 34000248 340002c8 # cbz w8, 0x2906de0 -> 0x2906df0 (first loop's empty check) +site realtime main 2906dc0 34000108 34000188 # cbz w8, 0x2906de0 -> 0x2906df0 (second loop's empty check) + # Hair and cloth: the actor animation update builds a second clock {seconds = factor / 30, ratio = factor} per # rendered frame. 1.4.3 inlines it in two actor paths, where the factor was just stored to the ratio slot: the # replacement stores measured ratio * factor there and computes measured seconds * factor. Two other callers share the From c8a6b91c61df6331ba8140f73380dab9e780b536 Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Sun, 15 Nov 2026 09:04:34 +0300 Subject: [PATCH 2/2] The empty hit list sites' comment names the functions, the stale slot and the registers the skipped path reads Co-Authored-By: Claude Opus 5.5 --- recomp/patches-v143.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/recomp/patches-v143.txt b/recomp/patches-v143.txt index 1a2ac31a..0b05ab02 100644 --- a/recomp/patches-v143.txt +++ b/recomp/patches-v143.txt @@ -49,10 +49,13 @@ site realtime main 2daa78 1e210800 d503201f # fmul s0, s0, s1 -> nop # keeps equipment locked until a load. Stepping while above 0 takes the remainder below 0 like any other last step. site realtime main 2b036c 0f016681 0f000401 # movi v1.2s, #0x34, lsl #24 (FLT_EPSILON) -> movi v1.2s, #0 -# Charged-attack hit records above 60 fps: the weapon's hit pool holds 10 records and one charged swing at a high -# frame rate fills it; the insert then fails and the list of hits made this frame stays empty. The game reads the -# empty list's slot (main+0x2906de0) and dereferences it before its own count == 0 check, which faults. Send both -# count == 0 branches to that check (main+0x2906df0) instead; a non-empty list is unchanged. +# Attack hit processing (main+0x2906a24) builds a list of this frame's hit records on its stack (count at [sp], slots +# at [sp+8] -> an inline array that is never cleared). The record insert (main+0x86e1d8) returns null when the +# attacker's record map (+0x190) is full, so a full map leaves the list empty. After its two loops the function +# passes slot 0 to the hit handler (main+0x870158, which dereferences it) unconditionally at main+0x2906de0 and only +# then checks count == 0 at main+0x2906df0; with an empty list slot 0 is stale stack data and the handler faults. +# Charged spear hits above 60 fps fill the map. Both count == 0 branches go to the check instead, which reloads the +# count and leaves through main+0x2906ce8; x19 and x20 are the only registers read there. A non-empty list is unchanged. site realtime main 2906d98 34000248 340002c8 # cbz w8, 0x2906de0 -> 0x2906df0 (first loop's empty check) site realtime main 2906dc0 34000108 34000188 # cbz w8, 0x2906de0 -> 0x2906df0 (second loop's empty check)