# run rel0215 wave 3 (lane w3-a): ov065's Ttc CLUSTER.
#
# ###########################################################################
# ##  WIRED, run rel0215 wave 3 (lane w3-a2): port/CMakeLists.txt READS IT. ##
# ###########################################################################
#
# THE BLOCKER SECTION BELOW IS KEPT AS THE RECORD AND ITS VERDICT IS STALE.
# It says the per-loaded-level seat does not exist. It did: run linkw wave 18
# landed port/hal/ttc_level_data_seat.cpp (commit a7e056087), hal/level_boot.cpp
# already called it from port_mount_row_lvl27, and the BASELINE level-27 run on
# this lane's own base printed all eight closures with their readbacks verified
# before a line of this lane was written. That section measured ovdata.py's
# CROSS PASS, which does refuse all twelve exactly as it says; it did not check
# for a HAND SEAT, which is the other route and the one ovdata.py keeps its
# HAND_SEATED table for. An empty cross pass is not evidence that a word is raw.
#
# What was genuinely missing was one DIRECTION. The wave-18 seat only ever
# PATCHED: hung off level 27's thunk alone it could not be told about any other
# level, so once Tick Tock Clock had been entered the eight words named ov035
# for the rest of the process, across a warp anywhere else and back. Lane w3-a2
# moved the call into port_level_mount_at, on both of its paths, and made it
# two-valued -- ov035's copy on level 27, the raw ROM address everywhere else.
# The generalisation that looks right, resolving through the now-loaded level's
# own mount, is WRONG, and it fails two different ways. Swept over the 52
# overlays sharing the level window base for target 0x02112138: ov035 owns the
# block, and of the other 51, twenty-eight CONTAIN the address and every one of
# them reads something that is not a CLPS block there (the readback aborts),
# while twenty-three do not reach it at all (at() returns 0). Level 33 is in
# the second group -- it is ov041, whose window ends 0x3f8 short. Releasing is
# safe by a second measurement: all fifty mounted levels were run and only
# level 27's object table names any of ids 108..118.
#
# PROOF, one process, SM64DS_WARP_SEQ=33@120,27@240 over 400 frames, rc 0:
# SEATED on 27 (8 written, readbacks 'CLPS' entrySize=8 count=1 and frames=91),
# RELEASED on 33 (8 written, every word back to its ROM value), SEATED again on
# the cache-hit re-entry to 27.
#
# Everything else here -- the cast map, the eleven ids, the seven vtables, the
# language sweep, the four G0/G1 decodes, the two C2372 rulings -- is measured
# and reusable as it stands. The lane's finding is that the blocker is a
# different thing from what the tree believed, not that the cast map was hard.
#
# ============================================================================
# WHY THIS IS **NOT** SEATABLE YET, WHICH IS THIS LANE'S RESULT
# ============================================================================
#
# port/ov065_syms.txt parks this subset on ONE blocker, and it is neither the
# registry nor the sinits nor the vtables: every Ttc class reads a CLPS
# collision block or a texture-animation descriptor that lives in whichever
# LEVEL overlay is loaded (ov035 on level 27). Wave 17 seated the cluster
# against that and MEASURED the cost: ids 108 (x8) and 114 (x5) ticked 300
# frames without faulting, SILENTLY, on a garbage CLPS, and id 112 divided by
# zero in Animation::Advance because its descriptor read zero frames. The quiet
# pair is why the seat came back out.
#
# Wave 18 landed port/ov035_syms.txt for exactly this and found TWELVE such
# reads rather than wave 17's five; all twelve are mounted, two with :0x20
# pins. run rel0215 wave 1 then wired port_ov035_syms_patch() into
# port_ov35_bringup(). Both halves are real and both are on this lane's base.
#
# THEY ARE NOT SUFFICIENT. tools/ovdata.py's cross pass still refuses all
# twelve, by design, because its ambiguity test is on WINDOWS and ov065 is an
# actor overlay co-resident with every level overlay -- so every level's whole
# mount contests every target. Measured on cc10acd4e, and REPRODUCIBLE FROM
# THE BUILD'S OWN OUTPUT with no extra tool -- the two "cross:" lines the mount
# pass prints: "cross: 312 pointers rebased across 121 mounts, 9542 left raw (136
# into a window contested by a co-resident mount, ...)" and "cross: ov065 9
# pointers rebased onto another mount" -- those nine being ov065's typeinfo
# words into ov002 gaps (build/port/host-src/ov_cross.c:449-457), with no ov035
# target among them. cross_mode()'s own comment names the remedy: "Resolving it
# correctly needs a seat that RE-PATCHES PER LOADED LEVEL."
#
# THE WORK THAT REMAINS, precisely: a per-loaded-level re-patch of ov065's
# EIGHT mounted data words -- 0x0211cfd8, 0x0211cfe4, 0x0211d16c, 0x0211d170,
# 0x0211d19c, 0x0211d1a8, 0x0211d364, 0x0211d370 -- onto ov035's host storage,
# hooked through level_boot.cpp's port_level_mount_register and obeying its
# per-level idempotency cache and .dsstate bracketing rule
# (level_boot.cpp:1660-1730). The other four of the twelve (0x0211c03c,
# 0x0211a454, 0x0211bb68, 0x0211b314) are literal-pool words inside ov065's
# .text; a recompiled TU resolves those BY NAME and no data patch can reach
# them. Once that seat exists and is proved on level 27, wire this slice.
#
# ============================================================================
# THE CAST: ELEVEN IDS, SEVEN CLASSES, SEVEN VTABLES
# ============================================================================
#
# Not "ten Ttc* classes" (ov065_syms.txt) and not five vtables. Derived four
# independent ways, all agreeing -- see port/ov065_syms.txt's wave-3 section
# for the full derivation and the two corrections it makes to its own header.
#
#   id   SpawnInfo record            vtable      RTTI at vtable[-1]     sinit
#   108  g_profile_CT_MECHA01   0x0211d028  daObjCtRotateBlock_c   c660
#   109  g_profile_CT_MECHA02  0x0211d028  daObjCtRotateBlock_c   c660
#   110  g_profile_CT_MECHA03         0x0211d0ec  daObjCtMecha03_c       c76c
#   111  TtcConveyorBeltLarge_Sp..   0x0211d1ec  daObjCtMecha04_c       c7d8
#   112  TtcConveyorBeltSmall_Sp..   0x0211d1ec  daObjCtMecha04_c       c7d8
#   113  g_profile_CT_MECHA05     0x0211d2b4  daObjCtMecha05_c       c890
#   114  g_profile_CT_MECHA06   0x0211d3b4  daObjCtKaitendai_c     c8fc
#   115  TtcRotatingTriangle_Sp..    0x0211d3b4  daObjCtKaitendai_c     c8fc
#   116  g_profile_CT_MECHA08A    0x0211d494  daObjCtMecha08_c       c9b8
#   117  g_profile_CT_MECHA08B    0x0211d494  daObjCtMecha08_c       c9b8
#   118  g_profile_CT_MECHA09    0x0211d568  daObjCtMecha09_c       ca74
#
# THE dsd BODY NAMES ARE SHIFTED AND THE SpawnInfo NAMES ARE NOT. Every record
# reads its own id back at +4 and every word[0] lands in ov065's own image, so
# the eleven records are trustworthy by name. The BODIES are not: the class
# whose methods dsd spells _ZN15TtcRotatingGear* is ids 116/117, while
# daObjCtKaitendai_c_classInit_CT_MECHA06 is id 114's factory. Read the table above, never the
# prefix. Each row was fixed by the factory's own literal pool (which vtable
# it stores) and by each D0's pool (which table it restores), independently.
#
# ============================================================================
# THE FOUR G0/G1 CleanupResources, AND THE C2372 THAT ALMOST COST TWO TUs
# ============================================================================
#
# Four Cleanups release two SharedFilePtrs each through the shared placeholders
# G0 and G1. Neither placeholder may be left alone: include/decl_common.h:396
# declares `extern int G1[];` and hal/cxx_aliases.cpp binds bare G1 to
# _data_ov002_0210e05c and bare G0 to the game heap -- both wrong here, and
# NEITHER WOULD FAIL A LINK (the ov006 finding at port/CMakeLists.txt:6285).
# Each pair below is decoded from its own body's literal pool, read out of
# extracted/overlays/overlay_0065.bin, never from the alias:
#
#   _ZN16daObjCtMecha03_c16CleanupResourcesEv   (id 110)      pool 0211a198/19c -> 0211d88c / 0211d894
#   _ZN16daObjCtMecha05_c16CleanupResourcesEv   (id 113)      pool 0211ad40/44  -> 0211d904 / 0211d90c
#   ..TtcRotatingGear..   (ids 116/117) pool 0211b8c8/8cc -> 0211d98c / 0211d97c
#   ..TtcMovingCubeA..    (id 118)      pool 0211bd5c/60  -> 0211d9d4 / 0211d9cc
#
# and each pair is confirmed from the other side by the sinit that BUILDS it:
# c76c writes 0211d88c.., c890 writes d904.., c9b8 writes d97c.., ca74 writes
# d9cc.. -- the ownership lane w17 measured.
#
# TWO of the four cannot take a direct -D. decl_common.h ALSO declares their
# targets, at a different type and a different indirection:
#   287 extern char data_ov065_0211d904;    288 extern char data_ov065_0211d90c;
#   289 extern char data_ov065_0211d97c[];  290 extern char data_ov065_0211d98c[];
# so `-DG1=data_ov065_0211d90c` rewrites line 396 into a redefinition of line
# 288 -- the C2372 the ov006 Mg3DEsp_Cleanup block measured and the ov035 lane
# hit again (hal/actor_classes_ov035.cpp:155-163). ov006 answered it with a
# host copy; ov035 found the cheaper answer and this lane uses ov035's: rename
# the placeholder to a LANE-OWNED name that is declared nowhere, then
# /alternatename that onto the mount symbol. Nothing is host-copied, and both
# TUs stay matched. The aliases live in hal/actor_classes_ov065.cpp.
#
# The LHS decoration differs between the two, for the reason ov035 records:
# decl_common.h wraps lines 20..3189 in `extern "C" {`, so a G1 rename is
# always a C name, while a .cpp TU's OWN file-scope `extern int G0[];` sits
# outside that block and decorates. Hence `?port_ov065_m08_file0@@3PAHA` beside
# `_port_ov065_m08_file1`. Both were checked against the link's own unresolved
# list rather than left to the derivation.
#
# The EIGHT ov065 TUs still unlinked after this lane are NOT this lane's --
# the enumeration was always right and only the count above it said five:
# Snufit/Swoop/Dorrie::Behavior and func_ov065_0211691c/02117944 are wave-5
# host copies (five), and Snufit/Swoop/Dorrie::Render are WAVE 19's host copies
# over a real c0000005 (three; the ModelAnim slot-5 collision,
# port/unmatched/W19_Slot5_Renders.cpp). All eight sit on port/slice_w5b.txt
# already.
#
# THAT TRAP DOES NOT REACH THIS CLUSTER, and it was checked rather than
# assumed. Every Ttc Render is the same six-virtual local shadow dispatched at
# +0xd4, but every one of the seven classes holds a plain Model there, not a
# ModelAnim -- read off each class's own D1, which calls _ZN5ModelD1Ev(this +
# 0xd4) in all seven. hal/cxxname_bridge.cpp:507-511 DUAL-FILLS _ZTV5Model at
# slots 4 and 5, so a shadow dispatching the ROM's slot 5 lands on Render;
# _ZTV9ModelAnim is the one that cannot be dual-filled (line 518-520) and no
# Ttc class has one. The five Ttc Renders therefore stay matched TUs.
#
# ============================================================================
# LANGUAGE: swept, not guessed
# ============================================================================
# 25 of the 71 are .cpp by extension. The other 46 were swept comment-stripped
# for the //cpp marker and for `extern "C"`, `virtual`, `class`, `::`,
# `template` and `bool` -- the set port/CMakeLists.txt:804-813 prescribes.
# ZERO hits: no LANGUAGE CXX property block is needed for this slice.

# ---- ids 108/109, daObjCtRotateBlock_c, table 0x0211d028 -------------------
src/d_a_obj_ct_rotate_block_ct_mecha01.c
src/d_a_obj_ct_rotate_block_ct_mecha02.c
src/_ZN15TtcRotatingCubeD1Ev.cpp
# RETIRED at SLICE1: body now in src/_ZN15TtcRotatingCubeD1Ev.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/_ZN15TtcRotatingCubeD0Ev.cpp
src/_ZN15TtcRotatingCube13InitResourcesEv.cpp
src/_ZN15TtcRotatingCube16CleanupResourcesEv.cpp
src/_ZN15TtcRotatingCube8BehaviorEv.cpp
src/_ZN15TtcRotatingCube6RenderEv.cpp
src/_ZN15TtcRotatingCube12UpdateShadowEv.cpp
src/_ZN15TtcRotatingCube10UpdateClsnEv.cpp
src/_ZN15TtcRotatingCube11UpdateModelEv.cpp

# ---- id 110, daObjCtMecha03_c, table 0x0211d0ec ----------------------------
# dsd named no _ZTV here and no class methods, so every body is func_ov065_*.
# The vtable slots say which is which: [0] InitResources 0211a358, [3] Cleanup
# 0211a15c, [6] Behavior 0211a1c8, [9] Render 0211a1a0, [16] D1 02119f3c,
# [17] D0 02119f88.
# RE-KEYED at the main->port sync (lane SYNC7, the wave-9 fold merge): main folded
# this body into src/actors/daObjCtMecha03_c.cpp (ov065 delinks, .text 0x0211a45c..0x0211a494, one
# absorbed range), which port/slice_w3a.txt's daObjCtMecha03_c.cpp row already compiles, so the symbols this row seated
# now come from there and the per-function file is gone from main's tree.
#src/d_a_obj_ct_mecha03.c
src/actors/daObjCtMecha03_c.cpp

# ---- ids 111/112, daObjCtMecha04_c, table 0x0211d1ec -----------------------
# RE-KEYED at the main->port sync (lane SYNC7, the wave-9 fold merge): main folded
# this body into src/actors/daObjCtMecha04_c.cpp (ov065 delinks, .text 0x0211aae0..0x0211ab20, one
# absorbed range), which port/slice_w3a.txt's daObjCtMecha04_c.cpp row already compiles, so the symbols this row seated
# now come from there and the per-function file is gone from main's tree.
#src/d_a_obj_ct_mecha04_ct_mecha04l.cpp
# RE-KEYED at the main->port sync (lane SYNC7, the wave-9 fold merge): main folded
# this body into src/actors/daObjCtMecha04_c.cpp (ov065 delinks, .text 0x0211ab20..0x0211ab60, one
# absorbed range), which port/slice_w3a.txt's daObjCtMecha04_c.cpp row already compiles, so the symbols this row seated
# now come from there and the per-function file is gone from main's tree.
#src/d_a_obj_ct_mecha04_ct_mecha04s.cpp
src/actors/daObjCtMecha04_c.cpp

# ---- id 113, daObjCtMecha05_c, table 0x0211d2b4 ----------------------------
# The other unnamed class. Slots: [0] 0211b1d4, [3] 0211ad04, [6] 0211ae08,
# [9] 0211ad48, [16] 0211ab60, [17] 0211abac.
# RE-KEYED at the main->port sync (lane SYNC7, the wave-9 fold merge): main folded
# this body into src/game/actors/daObjCtMecha05_c.cpp (ov065 delinks, .text 0x0211b328..0x0211b360, one
# absorbed range), which port/slice_w3a.txt's daObjCtMecha05_c.cpp row already compiles, so the symbols this row seated
# now come from there and the per-function file is gone from main's tree.
#src/d_a_obj_ct_mecha05.cpp
src/game/actors/daObjCtMecha05_c.cpp
src/func_ov065_0211b40c.c

# ---- ids 114/115, daObjCtKaitendai_c, table 0x0211d3b4 ---------------------
# dsd spells these bodies _ZN13TTC_MovingBar*, which is id 113's NAME. The
# bodies are 114/115's. See the table at the top.
src/d_a_obj_ct_kaitendai_ct_mecha06.c
src/d_a_obj_ct_kaitendai_ct_mecha07.c
src/_ZN13TTC_MovingBarD1Ev.cpp
# RETIRED at SLICE1: body now in src/_ZN13TTC_MovingBarD1Ev.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/_ZN13TTC_MovingBarD0Ev.cpp
src/_ZN13TTC_MovingBar13InitResourcesEv.cpp
src/_ZN13TTC_MovingBar16CleanupResourcesEv.cpp
src/_ZN13TTC_MovingBar8BehaviorEv.cpp
src/_ZN13TTC_MovingBar6RenderEv.cpp

# ---- ids 116/117, daObjCtMecha08_c, table 0x0211d494 -----------------------
# dsd spells these _ZN15TtcRotatingGear*, which is id 114's name.
src/d_a_obj_ct_mecha08_ct_mecha08a.c
src/d_a_obj_ct_mecha08_ct_mecha08b.c
src/_ZN15TtcRotatingGearD1Ev.cpp
# RETIRED at SLICE1: body now in src/_ZN15TtcRotatingGearD1Ev.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/_ZN15TtcRotatingGearD0Ev.cpp
src/_ZN15TtcRotatingGear13InitResourcesEv.cpp
src/_ZN15TtcRotatingGear16CleanupResourcesEv.cpp
src/_ZN15TtcRotatingGear8BehaviorEv.cpp
src/_ZN15TtcRotatingGear6RenderEv.cpp

# ---- id 118, daObjCtMecha09_c, table 0x0211d568 ----------------------------
# dsd spells these _ZN14TtcMovingCubeA*, which is id 116's name.
src/d_a_obj_ct_mecha09.c
src/_ZN14TTC_MovingBeamD1Ev.cpp
# RETIRED at SLICE1: body now in src/_ZN14TTC_MovingBeamD1Ev.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/_ZN14TTC_MovingBeamD0Ev.cpp
src/_ZN14TTC_MovingBeam13InitResourcesEv.cpp
src/_ZN14TTC_MovingBeam16CleanupResourcesEv.cpp
src/_ZN14TTC_MovingBeam6RenderEv.cpp
src/func_ov065_0211bc88.cpp

# ---- the seven parked sinits ----------------------------------------------
# Ownership was measured by lane w17 (each sinit's bss writes against each
# class's own bss reads) and is reproduced independently here by each
# CleanupResources' literal pool: id 110's reads 0x0211d88c/894 and c76c is
# the sinit that writes there; id 113's reads d904/90c (c890); ids 116/117's
# read d98c/97c (c9b8); id 118's read d9d4/9cc (ca74). All seven run now,
# because this lane registers all eleven ids (the ov019 rule).
src/__sinit_ov065_0211c660.c
src/__sinit_ov065_0211c76c.c
src/__sinit_ov065_0211c7d8.c
src/__sinit_ov065_0211c890.c
src/__sinit_ov065_0211c8fc.c
src/__sinit_ov065_0211c9b8.c
src/__sinit_ov065_0211ca74.c
