From f1cdd21134348251cccd98b1c0631e5fdd053e91 Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Tue, 1 Sep 2026 21:54:17 -0600 Subject: [PATCH] =?UTF-8?q?fix(jtbl=5Fcarve):=20consult=20island=5Fprobe?= =?UTF-8?q?=20before=20the=20LEADING-ISLAND=20refusal=20=E2=80=94=20+1=20b?= =?UTF-8?q?ank,=20unblocks=20the=20carve=20route?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `migrated_tables()` can flag a function whose table is actually in the DATA TAIL, and the §154-A island branch then refused the whole batch with "a tail carve cannot help ... the carve model covers jump tables only, not an island of mixed included data". That reads as a permanent toolchain wall. It is a ROUTING error: island_probe classifies the same function 'tail', and its own detail says "standard §8a carve at gate time" -- i.e. it names the ordinary lane as the owner (R43: each probe kind names the lane that owns it). The refusal was about the branch we entered, not the function. Consult the probe first and let a 'tail' function fall through to build_carve. Byte-proven immediately: ov_SC02_000/func_8017F950 -- three full parallel_gate passes had booked it CARVE-REFUSED -- now reports `[jtbl] carved func_8017F950`, `verified 1 / failed 0`, BYTE-IDENTICAL, and corpus.stubs confirms it banked. No config change was needed: its carve was already committed and merely PENDING an owner (the class identified while fixing jr_inventory), so banking the function completed the 1:1 ownership the assertion wanted. This was blocker 3 of 3 on the §322b route; 1 and 2 were cleared earlier in S70. --- src/ov_SC02_000/ov_SC02_000_jr_8017F950.c | 78 ++++++++++++++++++++++- tools/jtbl_carve.py | 13 ++++ 2 files changed, 90 insertions(+), 1 deletion(-) diff --git a/src/ov_SC02_000/ov_SC02_000_jr_8017F950.c b/src/ov_SC02_000/ov_SC02_000_jr_8017F950.c index 209db63b5e..d0b85d3a6b 100644 --- a/src/ov_SC02_000/ov_SC02_000_jr_8017F950.c +++ b/src/ov_SC02_000/ov_SC02_000_jr_8017F950.c @@ -1,3 +1,79 @@ #include "common.h" -INCLUDE_ASM("asm/ov_SC02_000/nonmatchings/ov_SC02_000_jr_8017F950", func_8017F950); + +void func_8017F950(s32 arg0) +{ + typedef struct { u32 w[4]; } St801D9204; + extern void func_80019064(void *a0); + extern void func_8012A828(s32 a0, void *a1); + extern void func_8012B23C(s32 a0); + extern void func_8012B2CC(s32 a0); + extern void func_8012E9C0(s32 a0); + extern s32 func_80143B6C(s32 a0, s32 a1); + extern void func_8017FC9C(s32 a0); + extern void func_8017FCB0(s32 a0); + extern void func_8017FD2C(s32 a0); + extern void func_8017FD44(s32 a0); + extern void func_8017FD80(s32 a0); + extern void func_8017FDE8(s32 a0); + extern void func_8017FE68(s32 a0); + extern void func_801801EC(s32 a0); + extern void func_80180A64(s32 a0); + extern u8 D_80062BDC; + extern char D_801A681C[]; + extern St801D9204 D_801E6A00; + St801D9204 local = D_801E6A00; + + if (*(u8 *)(arg0 + 0x5E) == 5) { + func_80019064(&D_80062BDC); + } + if (*(u16 *)(arg0 + 0x5E) == 0x1F) { + func_80180A64(arg0); + return; + } + *(u8 *)(arg0 + 0xC1) = 0; + func_8012E9C0(arg0); + *(u16 *)(arg0 + 0x76) = *(u16 *)(arg0 + 0x76) - *(u16 *)(arg0 + 0x60); + *(u16 *)(arg0 + 0x5C) &= 0xFFFE; + *(u16 *)(*(s32 *)(arg0 + 0x20) + 0x12) = (*(u16 *)(arg0 + 0x62) + 0x800) & 0xFFF; + func_8012B2CC(arg0); + func_8012B23C(arg0); + *(s16 *)(arg0 + 2) = 3; + func_80143B6C(arg0, 0); + switch (*(u8 *)(arg0 + 0x5E)) { + case 13: + func_8017FC9C(arg0); + return; + case 14: + func_8017FCB0(arg0); + return; + case 10: + func_8017FD44(arg0); + return; + case 9: + func_8017FD80(arg0); + return; + case 17: + func_8017FDE8(arg0); + return; + case 33: + func_8017FD2C(arg0); + return; + case 15: + if (*(s16 *)(arg0 + 0x76) > 0) { + func_801801EC(arg0); + return; + } + break; + default: + if (*(s16 *)(arg0 + 0x76) > 0) { + *(u16 *)(arg0 + 0x34) = 0; + *(s32 *)(arg0 + 0x1C) = 0x10; + func_8012A828(arg0, D_801A681C); + return; + } + break; + } + func_8017FE68(arg0); +} + diff --git a/tools/jtbl_carve.py b/tools/jtbl_carve.py index afaeba830a..c894c3828e 100644 --- a/tools/jtbl_carve.py +++ b/tools/jtbl_carve.py @@ -1018,6 +1018,19 @@ def migrated_tables(ov, funcs): def apply(ov, funcs): mig = migrated_tables(ov, funcs) + # THE PROBE OVERRIDES THE CLASSIFIER FOR 'tail' (P31 S70). `migrated_tables` can flag a function + # whose table is actually in the DATA TAIL, and the island branch below then refuses the whole + # batch — even though `island_probe` classifies it 'tail' and its own detail says "standard §8a + # carve at gate time", i.e. it names the ordinary lane as the owner (R43: each kind names its + # lane). That refusal reads as a permanent wall while the function is simply in the wrong branch: + # measured on ov_SC02_000/func_8017F950, which is 'tail' yet died on the LEADING-ISLAND exit. + # Consult the probe FIRST and let a tail function fall through to build_carve below. + if mig: + _tail = [f for f in mig if island_probe(ov, f)[0] == "tail"] + if _tail: + print(f"jtbl_carve {ov}: {sorted(_tail)} probe as 'tail' (data-tail table) — routing to " + f"the standard §8a carve, not the §154-A island branch") + mig = [f for f in mig if f not in _tail] if mig: # §154-A migrated tables. Two states, byte-distinguished by island_probe: # * 'covered' — the §260 island split is IN PLACE (the fn is isolated into its own