# run rel0215 wave 2, lane w2-ov074: ov074, the GOOMBOSS pack.
# GOOMBOSS (198) and EXPLOSION_GOOMBA (199), both 12daKuriKing_c, level 45
# (Mario's key arena, ex_mario, ov053). Fresh per-symbol mount, Phases A-E.
#
# ==== 1. THE SOURCE INVENTORY, COUNTED THREE WAYS ==========================
# config/arm9/overlays/ov074/symbols.txt has 56 kind:function rows.
# config/arm9/overlays/ov074/delinks.txt has 52 file blocks. The three sums:
#
#   48  delinked COMPLETE to a src TU
#    4  present but NOT complete in delinks
#         _ZN8Goomboss13InitResourcesEv.c   (0x404, the resource load)
#         daKuriKing_c_classInit_KURIKING_VANISH.cpp         (0xd4)
#         daKuriKing_c_classInit_KURIKING.cpp                (0xd4)
#         __sinit_ov074_02122978.c          (0x3f8, the static initialiser)
#    4  no delink block at all
#         func_ov074_02121800  0x15c  -- src EXISTS, //cpp NONMATCHING banner
#                                        ("base materialization / addressing
#                                        (div=21). Logic verified correct vs
#                                        ROM"). A decompiled body; the port
#                                        runs it, the ov005/ov075 precedent.
#         func_ov074_021201f0  0x1f0  -- MATCHED on the decomp line and
#                                        PROPAGATED here by run rel0215 lane
#                                        prop17, off main 6906f2af5 (PR #2006).
#                                        Still no delink block, so it stays in
#                                        this count, but src/ has it and the
#                                        port runs it.
#         func_ov074_021204c0  0x208  -- same, same commit, same lane.
#         func_ov074_02121380  0x374  -- src EXISTS, declared NONMATCHING body
#                                        with a differential-execution audit
#                                        (main 6d4ffd596, PR #2018). Still no
#                                        delink block, so it stays in this
#                                        count, but src/ has it and the port
#                                        runs it -- the collision-cylinder
#                                        rebuild.
#   ---
#    56  = 48 + 4 + 4.  Sum checks against symbols.txt.
#
# So 55 source TUs now exist (52 delink blocks + func_ov074_02121800.c + the
# two prop17 propagations). Before prop17 there were 53, which was linkage.py's
# ov074 total of 53 TUs, 1 linked, 52 unlinked.
#
# ==== 2. WHAT IS AND IS NOT IN THIS SLICE ==================================
# 49 of the 55 (it was 47 of the 53 before lane prop17 added
# src/func_ov074_021201f0.c and src/func_ov074_021204c0.c). The six held out,
# each for a named reason, and prop17 held out none of them:
#
#   src/actors/Goomboss.cpp        ALREADY LINKED. port/slice_gate32.txt:356
#       compiles it -- the goomba's knocked-back state asks the Goomboss
#       overlay for a launch vector, and gate 32 took the CODE while ov074 was
#       unmounted. It is the "1 linked" in ov074's 1/53 and is not this lane's
#       yield. Re-listing it would be a second absolute path for the same file
#       and CMake would dedupe it, but leaving it out keeps the slice honest
#       about what this lane adds.
#   src/_ZN8Goomboss6RenderEv.cpp    HOST COPY (ModelAnim slot 5), see 3 below
#   src/func_ov074_021222e0.cpp      HOST COPY (ModelAnim slot 5), see 3 below
#   src/actors/Goomboss.cpp      HOST COPY (PMF state ENTER), see 3 below
#   src/actors/Goomboss.cpp      HOST COPY (PMF state TICK),  see 3 below
#   src/_ZN8Goomboss13InitResourcesEv.cpp  HOST COPY (MSVC C2561), see 3 below
#
# ==== 3. THE REFUSALS, SMALLEST SUBTREE EACH ===============================
# (a) TWO ModelAnim slot-5 dispatch sites -> port/unmatched/Goomboss_HostSites.cpp
#     Goomboss HOLDS a ModelAnim at +0x210 (both factories construct it there,
#     both destructors tear it down there) and both TUs dispatch its ROM slot 5
#     through a LOCAL six-virtual shadow. hal/cxxname_bridge.cpp fills
#     _ZTV9ModelAnim in MSVC numbering, where slot 5 is Virtual18 -- a
#     two-argument method reached with the shadow's one. Model's table is
#     dual-filled and would serve; ModelAnim's cannot be. The fifteenth
#     instance of this shape; see port/unmatched/ModelAnim_Renders.cpp.
# (b) TWO pointer-to-member state dispatch sites ->
#     port/unmatched/Goomboss_StateDispatch.cpp
#     mwcc's PMF is an 8-byte {fn, delta}; MSVC's PMF for an INCOMPLETE class
#     is the generalised 16-byte one dispatched through a thunk. Nine
#     {enter, tick} cells; the eighteen source records are seated with host
#     bodies by hal/actor_classes_ov074.cpp's port_ov074_states_seat().
# (c) ONE MSVC C2561 -> port/unmatched/Goomboss_InitResources.cpp
#     src/_ZN8Goomboss13InitResourcesEv.cpp is declared int-returning and uses
#     mwccarm's bare `return;` on its mParam == 0x1111 early exit. MSVC's C++
#     front end rejects that outright ("function must return a value") -- an
#     ERROR, not a warning, so there is no /wd -- and it cannot be compiled as
#     C either (top-level `extern "C" {`, `RG rg;` without the struct keyword).
#     The host copy is the src TU VERBATIM with one statement changed,
#     `func_ov074_02122634(self); return;` -> `return func_ov074_02122634(self);`,
#     which is what the ROM does: src/func_ov074_02122634.cpp is byte-matched,
#     `int`, and ends `return 1;`, so r0 holds 1 on that path either way.
#     The WaterBomb_State0 / Cannon_Behavior / Coin_Behavior idiom.
# NO ARM ASM, no thread scheduler, no card loader, no wireless: the sweep for
# `asm` over all 53 TUs comes back empty, so no other subtree is refused. Lane
# prop17 re-ran that sweep over its two additions and it is still empty.
#
# (d) THE ONE BODY STILL MISSING -- NOW CLOSED (SEATED 2026-09-17).
#     func_ov074_02121380 (0x374) is the collision-cylinder rebuild. Its single
#     reference is an arm_call at 0x02121ccc, inside Goomboss::Behavior, which
#     runs it unconditionally every frame; it in turn is the only caller of
#     func_ov074_02121270 (its own arm_call at 0x02121548). It was faced loudly
#     in hal/actor_classes_ov074.cpp under the ROM's own name; that face is now
#     deleted.
#     WHAT NOW HAPPENS: the audited body runs (see section 1's inventory row
#     and the SEATED comment above src/func_ov074_02121380.c below), so the
#     four MovingCylinderClsnWithPos members at +0x110 stride 0x40 follow the
#     boss instead of sitting where the constructor left them. The paragraph's
#     own stated reason for func_ov074_02121270 staying out of the link --
#     that its only caller stayed faced -- is exactly what changed: the caller
#     is compiled now, so 02121270 comes into the link from
#     src/actors/Goomboss.cpp, which was already an input.
#
# ==== 4. THE TWO ALIAS RACES THIS MOUNT SETTLES (T6) =======================
# ov074 shares the load window at base 0x0211f000 with ov070, ov071 and ov073,
# all three already mounted. Two /alternatename pragmas in the tree today have
# an ov074 NAME as their LHS, put there by lanes that mounted a sibling while
# ov074 was unmounted. Both are DEFEATED THE MOMENT THIS LANE LANDS (a defined
# LHS defeats /alternatename silently -- the wave-5 R1/R2 class), and
# port/tools/alternatename_guard.py fails the build post-link when they are.
# Neither is fixable by dropping a symbol: ov074 genuinely owns both objects.
# Both are re-cut as per-source -D renames on the SIBLING's consumer TU, which
# is the PLAN's own remedy, and both dead pragmas are deleted.
#
# (4a) 0x02123038 -- ov071 bss vs ov074 bss.
#      src/func_ov071_021209c8.cpp spells its texture-sequence SharedFilePtr
#      `data_ov074_02123038`; hal/actor_classes_ov071.cpp:224 aliased that
#      spelling onto data_ov071_02123038 and its own comment records the
#      ruling (ov071's relocation from 0x02120a1c is module:overlay(71)).
#      That ruling is unchanged and stays right -- only the mechanism moves.
#      ov074's OWN relocations cite 0x02123038 three times as
#      module:overlay(74) (from 0x02122948 rodata, 0x02122c9c in the sinit,
#      0x02122f34 in the file table) and src/__sinit_ov074_02122978.c
#      Constructs it with file id 0x38f, so the mount keeps the symbol.
#      NEW:     set_source_files_properties(src/func_ov071_021209c8.cpp
#                   COMPILE_DEFINITIONS data_ov074_02123038=data_ov071_02123038)
#      DELETED: hal/actor_classes_ov071.cpp:224 pragma
#
# (4b) 0x021222e0 -- ov070 rodata vs ov074 CODE.
#      src/game/actors/daBrq_c.cpp reads
#      `struct SharedFilePtr *func_ov074_021222e0[2]` -- ov070's own
#      two-pointer file table -- under the ov074 FUNCTION spelling;
#      hal/cxx_aliases.cpp:995 aliased it onto data_ov070_021222e0 and its own
#      comment predicts this exact collision ("linking it would collide with
#      this storage rather than replace it"). ov074's function at that address
#      is real, 0xdc bytes, and Goomboss::Render CALLS it, so the name has to
#      resolve to CODE in this link.
#      NEW:     set_source_files_properties(src/game/actors/daBrq_c.cpp
#                   COMPILE_DEFINITIONS func_ov074_021222e0=data_ov070_021222e0)
#      DELETED: hal/cxx_aliases.cpp:995 pragma
#
# The reverse direction was swept too: every ov074 TU was scanned for a
# sibling-overlay symbol name. Six references, none in this window --
# data_ov002_0210da30, _ZN12dEnemyBase_cD2Ev, data_ov084_0213089c,
# data_ov084_02130cc8, data_ov084_02130cf8 and func_ov084_021296b0. ov002 and
# ov084 are both mounted and both are genuinely co-resident with ov074 on
# level 45 (its roster is ov067 ov074 ov084 ov089 ov098 ov102), so all six are
# real cross-overlay reads and none is a race.
#
# ==== 5. NO PLACEHOLDER RENAMES ============================================
# The comment-stripped sweep for G0..G9 / VT / VT0..VT9 / HEAP / R0..R2 over
# all 53 TUs comes back EMPTY -- the first cast lane of either wave with no
# placeholder at all. Both destructors spell _ZTV8Goomboss directly, both
# factories store that same table, and the table's own vtable[-1] typeinfo
# reads through to "12daKuriKing_c", so dsd's label is on the right class and
# the ov026/ov030/ov036 label shift does not fire. src/_ZN8GoombossD0Ev.cpp even
# spells the game heap `data_020a0eac` outright instead of G0.
#
# ==== 6. LANGUAGE ==========================================================
# 10 of the 20 slice lines are .cpp. Of the 10 .c lines, the comment-stripped
# token sweep (`extern "C"`, virtual, class, namespace, bool, new, delete,
# template, true, false, ::) plus the //cpp marker check finds TWO that are
# really C++ and get LANGUAGE CXX in port/CMakeLists.txt (a third,
# src/_ZN8Goomboss13InitResourcesEv.cpp, is a host copy and not a slice line):
#     src/actors/Goomboss.cpp             //cpp + a top-level extern "C"
#     src/func_ov074_02121800.c             //cpp + the NONMATCHING banner
# One more file matched the sweep and is NOT C++: src/actors/Goomboss.cpp
# matches `false` because it DEFINES it (`#define false 0` on line 7), which
# is the false positive the sweep has to tolerate to stay cheap -- and
# compiling that file as C++ would break on the macro.
# (counts remeasured 2026-09-17, fixer GOOMBOSS: 18/47/29 above had gone stale
# against this file's current row list, independent of the row this card adds)
# src/func_ov074_02121380.c, the new row this card seats, was swept for the
# same token list and the //cpp marker: no hit, plain C, so it takes no
# LANGUAGE CXX row.
#
# ==== 7. THE MEASURED EXTERNAL CLOSURE =====================================
# THREE plain C names off the FIRST link's own LNK2019/LNK2001 list, taken from
# the linker rather than guessed (slice_vs.txt section 3, "THE MEASURED GAP").
# Two are missing bodies and are appended at the end of the slice below; the
# third is a name, not a body.
#
#   _func_02011d20        src/func_02011d20.c exists and was in no slice.
#                         func_ov074_0212018c (state 1's tick) calls it.
#   _func_ov084_021296b0  src/func_ov084_021296b0.c exists and was in no
#                         slice. func_ov074_0211fd74 (state 2's tick) calls
#                         it; ov084 is co-resident with ov074 on level 45.
#   _func_020aed98        NOT A MISSING BODY. It is the ENEMY CONSTRUCTOR,
#                         which both factories call as `func_020aed98(p)`.
#                         ov074's own relocation reads
#                         `from:0x02122850 kind:arm_call to:0x020aed98
#                         module:overlays(2,7)` -- ambiguous, and the class's
#                         own base typeinfo settles it: _ZTV8Goomboss's
#                         vtable[-1] names base 0x021081c0, whose name string
#                         reads "12dEnemyBase_c". The port's spelling of that
#                         constructor is _ZN12dEnemyBase_cC2Ev (hal/cxx_aliases.cpp
#                         :1434 and the ov073 lane's port_factory_chief_chilly,
#                         which calls it by that name), so the two factory TUs
#                         get a per-source -D onto it in port/CMakeLists.txt.
#                         BOTH OF THIS LANE'S FACTORIES NAME THE RECEIVER
#                         (`func_020aed98(p)`), so the ChainChomp/ChiefChilly
#                         r0-ride-through problem does not apply and no host
#                         copy is needed here.
#
# The first link named TWENTY-FOUR unresolved externals in all: the three plain
# C names above and TWENTY-ONE C++-MANGLED SPELLINGS, the ov025/ov058 class (a
# //cpp TU declares a global, or a static member, at file scope with no
# extern "C", so MSVC decorates it with its declared type while the mount and
# the port's own bodies emit the one C name).
#   TWELVE were in the InitResources host copy and are fixed AT THE SOURCE, not
#     bridged: ten by moving its declarations INSIDE its extern "C" block, and
#     two -- func_021123f4 and func_021124ac -- by resolving through
#     port_ov053_at(). Those two are ov053's own data at a level-window address
#     and the src TU takes their ADDRESS; ov053 is mounted WHOLE, which offers
#     no C name for any interior byte, so an alias could not have served them.
#   NINE come from src/func_ov074_02121a4c.cpp and src/func_ov074_02122634.cpp,
#     which this lane does not own, and are bridged in
#     hal/actor_classes_ov074.cpp. Every LHS is declared-and-never-defined, so
#     alternatename_guard stays clean.
# A SECOND ROUND followed the first: adding src/func_02011d20.c pulled in
# __ZN5Sound13Func_02048ee4Ev, whose body (src/_ZN5Sound13Func_02048ee4Ev.cpp,
# also appended below) declares it a static member of class Sound, so MSVC
# emits ?Func_02048ee4@Sound@@SAXXZ -- the same shape the other way round,
# bridged with the rest and confirmed with dumpbin /symbols on the object.
src/d_a_kuri_king_kuriking_vanish.cpp
src/d_a_kuri_king_kuriking.cpp
src/_ZN8Goomboss16CleanupResourcesEv.cpp
src/_ZN8Goomboss8BehaviorEv.cpp
# RETIRED at SLICE1: body now in src/_ZN8GoombossD1Ev.cpp. MSVC folds the ROM destructor variants into one symbol, so only one of a class two per-function destructor TUs can be compiled.
#src/_ZN8GoombossD0Ev.cpp
src/_ZN8GoombossD1Ev.cpp
src/__sinit_ov074_02122978.c
src/actors/Goomboss.cpp
# RETIRED at SLICE1: body now in src/actors/Goomboss.cpp. main consolidation put this body in the class TU, which the build already compiles, so the per-function leftover is a second definition.
#src/func_ov074_021201f0.c
# RETIRED at SLICE1: body now in src/actors/Goomboss.cpp. main consolidation put this body in the class TU, which the build already compiles, so the per-function leftover is a second definition.
#src/func_ov074_021204c0.c
src/func_ov074_021216f4.c
src/func_ov074_02121800.c
# SEATED 2026-09-17 (run link100 wave 10, fixer GOOMBOSS, card
# out/TRIAGE3/card_goomboss.md). The collision-cylinder rebuild, and the last hole in this
# overlay. main 6d4ffd596 (PR #2018) landed it as a DECLARED NONMATCHING body: 11 residue
# words of 221, size and the 0x74 frame exact, prologue and tail byte-exact, the ordering
# floor measured closed over 4320 order cells and all 25 archived mwccarm builds, two full
# sieges on record in config/match_attempts.jsonl, and the compiler hunt closed. The
# residue is permanent, so the port runs the body on its AUDIT rather than on a byte gate:
# differential execution against the cartridge over a 2700-state discriminating lattice,
# IDENTICAL on every state -- same calls with the same arguments, same final value of all
# 216 written bytes, same return, all 12 branch arms exercised, and the harness proved by
# 8 deliberately broken size-neutral controls that it catches. src/func_ov074_02121380.c
# lines 1 to 90 carry the whole record. This is the func_ov074_02121800 shape one row up
# (the ov005/ov075 precedent that slice section 1 names), and the face it replaces in
# hal/actor_classes_ov074.cpp is deleted rather than left beside a live body.
src/func_ov074_02121380.c
src/func_ov074_0212195c.c
src/func_ov074_0212199c.c
src/func_ov074_02121a20.c
src/func_ov074_02121a4c.cpp
src/func_ov074_0212229c.c
src/func_ov074_021223bc.cpp
src/func_ov074_02122634.cpp
src/func_02011d20.c
src/func_ov084_021296b0.c
src/_ZN5Sound13Func_02048ee4Ev.cpp
