Skip to content

61 deleting destructors become real C++ - #1385

Merged
andrewboudreau merged 1 commit into
mainfrom
cpp/part4-d0
Aug 10, 2026
Merged

61 deleting destructors become real C++#1385
andrewboudreau merged 1 commit into
mainfrom
cpp/part4-d0

Conversation

@andrewboudreau

Copy link
Copy Markdown
Collaborator

Part 4 of 4 — the last piece of the split, replayed onto main now that #1384 (part 3) has landed. Originally filed as #1380, which merged into part 2's branch instead of after it; that collapsed the stack into one 436-file PR, so this is re-filed rather than reopened.

155 files, under the 200-file cap.

What this is

61 D0 deleting destructors become real C++. A D0 is never migratable on its own — it only reproduces when an inline operator delete exists on the class or its immediate base, which is what the earlier parts put in place. With that declaration present, a real ~Class() regenerates the deleting variant instead of it being hand-written.

Verified

Cherry-picked onto d334d0e1 with no conflicts, then gated from scratch:

gate result
rombuild.py -j16, full ROM 106/106 exact, 0 mismatching, 10,813 source-built, 87.88%
pr_linkcheck vs main 61 VERIFIED, 0 blocking
function_snapshot vs main lost 0, gained 0, denominator unchanged
port_refcheck 393 checked, 0 stale

Enrollment does not move, and that is expected: a migration replaces the source of an already-enrolled function, so the count holds while the source stops lying. The gain shows up in langmode_audit's shadow-declaration counts, not in source-built.

The split, closed out

part PR files
2 #1382 185
3 #1384 131
4 this 155

Plus #1383, a one-file fix on main for a pre-existing fakematch that part 2 surfaced through header fan-out — func_02057410 relocated its digit-loop divide to _ll_sdiv where the ROM calls __aeabi_uldiv.

Original work is by the author of #1377; this preserves the content, not the history.

🤖 Generated with Claude Code

https://claude.ai/code/session_015AXm5k53WFPjCYcDHRDX3x

* 59 classes get their real base and real member types

The migration half of #1377, split from the layout work it rests on, with the D0
deleting destructors split off again on top so each PR clears the validator's
200-file cap. Stacked on #1378; the D0s are the PR above this one.

131 files. Hand-written .c destructors and methods become real C++ -- classes
deriving from their actual base with typed members, in place of a flattened
struct and a stand-in. Among them: DonutBlock as the worked example for the
shadow-struct classes, thirty Platform subclasses unblocked by the 0x320
correction in #1378, and the array-member classes -- Wiggler's eight, Goomboss's
three, ChainChomp's seven links, PathLift's Model[3], RotatingFirebar's one
collision cylinder per flame.

Six migrations that belong here by subject are in #1378 instead, because that
half does not link without them: ChiefChilly, Unagi, Wiggler D0 and D1, Goomboss
and ChainChomp all call the renamed Vector3 destructors.

VERIFIED

rombuild -j16, full ROM: 106/106 exact, 0 mismatching, 10,813 source-built,
87.88%. eligible.py differs from main only by the rename pair #1378 introduces.
tools suite 265 passed. langmode ratchet PASS. No duplicate stems.
pr_linkcheck: no new WRONG or NO-REPRO.

Enrollment does not move, and that is expected: a migration replaces the source
of a function that was already enrolled, so the count stays while the source
stops lying.

Original work is by the author of #1377; this split preserves the content, not
the 37-commit history, which remains on that branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AXm5k53WFPjCYcDHRDX3x

* Re-request validation against the retargeted base

No content change. This PR's base moved from cpp/platform-enemy-layout to
cpp/layout-headergen when the layout half was split in two, and the relay keys on
head SHA -- retargeting alone does not re-submit, so the check still showed the
431-file count from the old base. This empty commit changes the head so the
validator measures the 131 files this PR actually adds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AXm5k53WFPjCYcDHRDX3x

* 61 deleting destructors become real C++

The D0 half of #1379, split off so each PR clears the validator's 200-file cap.
Stacked on #1379, which carries the class definitions these need.

D0 is vtable slot 17 (or 1, for classes rooted below Actor): destroy, then return
the object to the actor heap. Each of these was a hand-written .c file spelling
out what the compiler emits anyway -- store the vtable, call the member
destructors in reverse declaration order, chain to the base, call
Memory::Deallocate. Declaring the class properly lets the compiler emit all of
it, and the deallocation comes from the inline operator delete rather than
anything in the file.

Not in arm9: those D0s need an operator delete the arm9 classes do not have in
scope, which is a separate problem and is not attempted here.

VERIFIED

rombuild -j16, full ROM: 106/106 exact, 0 mismatching, 10,813 source-built,
87.88%. eligible.py differs from main only by the rename pair #1378 introduces.
tools suite 265 passed. langmode ratchet PASS. No duplicate stems.

Enrollment does not move: a D0 was already enrolled from its .c file, so the
count stays while the source stops hand-spelling the mangled name.

Original work is by the author of #1377; this split preserves the content, not
the 37-commit history, which remains on that branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AXm5k53WFPjCYcDHRDX3x

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@tangos-validator

tangos-validator Bot commented Aug 10, 2026

Copy link
Copy Markdown

✅ PR validation — Passed

Committed merge introduces no reconstruction or attribution regression.

Full merge validation

Check Result
Committed test merge yes
Matched functions 11,178 / 11,347 (98.5%, +0)
Matched code bytes 2,078,800 / 2,211,124 (94.0%, +0)
Tracked source enrollment 10,785 functions, 1,936,196 bytes (87.57%, +0)
Perfect source moves 0 R100
Contributor credit 0 added, 0 changed, 0 lost
Relocation check 61 checked; 61 VERIFIED
Port reference check 393 checked; 0 stale
Module fidelity 106/106 exact; 100.000000% compared bytes
Code linked from verified source 10,813 functions, 1,943,084 bytes (87.88%)
Per-file link-check detail

All 61 changed file(s) compile to the ROM byte-for-byte with correct relocation targets.

File Symbol Result Slots checked
src/_ZN10BulletBillD0Ev.cpp _ZN10BulletBillD0Ev ✅ verified 1
src/_ZN10CheepCheepD0Ev.cpp _ZN10CheepCheepD0Ev ✅ verified 1
src/_ZN10DonutBlockD0Ev.cpp _ZN10DonutBlockD0Ev ✅ verified 1
src/_ZN10KingBobOmbD0Ev.cpp _ZN10KingBobOmbD0Ev ✅ verified 1
src/_ZN10KoopaShellD0Ev.cpp _ZN10KoopaShellD0Ev ✅ verified 1
src/_ZN10ModelAnim2D0Ev.cpp _ZN10ModelAnim2D0Ev ✅ verified 1
src/_ZN10MrBlizzardD0Ev.cpp _ZN10MrBlizzardD0Ev ✅ verified 1
src/_ZN10PyramidTopD0Ev.cpp _ZN10PyramidTopD0Ev ✅ verified 1
src/_ZN10SlidingIceD0Ev.cpp _ZN10SlidingIceD0Ev ✅ verified 1
src/_ZN10StarSwitchD0Ev.cpp _ZN10StarSwitchD0Ev ✅ verified 1
src/_ZN11CannonHatchD0Ev.cpp _ZN11CannonHatchD0Ev ✅ verified 1
src/_ZN11CommonModelD0Ev.cpp _ZN11CommonModelD0Ev ✅ verified 1
src/_ZN11PyramidStepD0Ev.cpp _ZN11PyramidStepD0Ev ✅ verified 1
src/_ZN12FortressWallD0Ev.cpp _ZN12FortressWallD0Ev ✅ verified 1
src/_ZN12SwitchPillarD0Ev.cpp _ZN12SwitchPillarD0Ev ✅ verified 1
src/_ZN12WaterSuctionD0Ev.cpp _ZN12WaterSuctionD0Ev ✅ verified 1
src/_ZN13BigBrickBlockD0Ev.cpp _ZN13BigBrickBlockD0Ev ✅ verified 1
src/_ZN13ExpandingHeapD0Ev.cpp _ZN13ExpandingHeapD0Ev ✅ verified 1
src/_ZN13FortressTowerD0Ev.cpp _ZN13FortressTowerD0Ev ✅ verified 1
src/_ZN13MontyMoleRockD0Ev.cpp _ZN13MontyMoleRockD0Ev ✅ verified 1
src/_ZN13PoleBillboardD0Ev.cpp _ZN13PoleBillboardD0Ev ✅ verified 1
src/_ZN13QuestionBlockD0Ev.cpp _ZN13QuestionBlockD0Ev ✅ verified 1
src/_ZN13TTC_MovingBarD0Ev.cpp _ZN13TTC_MovingBarD0Ev ✅ verified 1
src/_ZN14ArrowSignRightD0Ev.cpp _ZN14ArrowSignRightD0Ev ✅ verified 1
src/_ZN14BlueCoinSwitchD0Ev.cpp _ZN14BlueCoinSwitchD0Ev ✅ verified 1
src/_ZN14KnockDownPlankD0Ev.cpp _ZN14KnockDownPlankD0Ev ✅ verified 1
src/_ZN14MovingBarSmallD0Ev.cpp _ZN14MovingBarSmallD0Ev ✅ verified 1
src/_ZN14SquarePathLiftD0Ev.cpp _ZN14SquarePathLiftD0Ev ✅ verified 1
src/_ZN14TtcMovingCubeAD0Ev.cpp _ZN14TtcMovingCubeAD0Ev ✅ verified 1
src/_ZN15ChainChompFenceD0Ev.cpp _ZN15ChainChompFenceD0Ev ✅ verified 1
src/_ZN15FireSeaElevatorD0Ev.cpp _ZN15FireSeaElevatorD0Ev ✅ verified 1
src/_ZN15MaterialChangerD0Ev.cpp _ZN15MaterialChangerD0Ev ✅ verified 1
src/_ZN15TextureSequenceD0Ev.cpp _ZN15TextureSequenceD0Ev ✅ verified 1
src/_ZN15TtcRotatingGearD0Ev.cpp _ZN15TtcRotatingGearD0Ev ✅ verified 1
src/_ZN16RotatingCogSmallD0Ev.cpp _ZN16RotatingCogSmallD0Ev ✅ verified 1
src/_ZN17BowserPuzzlePieceD0Ev.cpp _ZN17BowserPuzzlePieceD0Ev ✅ verified 1
src/_ZN17SlidingPlatformWfD0Ev.cpp _ZN17SlidingPlatformWfD0Ev ✅ verified 1
src/_ZN18MovingCylinderClsnD0Ev.cpp _ZN18MovingCylinderClsnD0Ev ✅ verified 1
src/_ZN18MovingMeshColliderD0Ev.cpp _ZN18MovingMeshColliderD0Ev ✅ verified 1
src/_ZN18TextureTransformerD0Ev.cpp _ZN18TextureTransformerD0Ev ✅ verified 1
src/_ZN19CylinderClsnWithPosD0Ev.cpp _ZN19CylinderClsnWithPosD0Ev ✅ verified 1
src/_ZN19FloatingFloorLllBigD0Ev.cpp _ZN19FloatingFloorLllBigD0Ev ✅ verified 1
src/_ZN19RotatingPlatformLllD0Ev.cpp _ZN19RotatingPlatformLllD0Ev ✅ verified 1
src/_ZN19RotatingPlatformWdwD0Ev.cpp _ZN19RotatingPlatformWdwD0Ev ✅ verified 1
src/_ZN21ExtendingMeshColliderD0Ev.cpp _ZN21ExtendingMeshColliderD0Ev ✅ verified 1
src/_ZN25MovingCylinderClsnWithPosD0Ev.cpp _ZN25MovingCylinderClsnWithPosD0Ev ✅ verified 1
src/_ZN5SharkD0Ev.cpp _ZN5SharkD0Ev ✅ verified 1
src/_ZN5StumpD0Ev.cpp _ZN5StumpD0Ev ✅ verified 1
src/_ZN8IceBlockD0Ev.cpp _ZN8IceBlockD0Ev ✅ verified 1
src/_ZN8IceSheetD0Ev.cpp _ZN8IceSheetD0Ev ✅ verified 1
src/_ZN8MetalNetD0Ev.cpp _ZN8MetalNetD0Ev ✅ verified 1
src/_ZN8PathLiftD0Ev.cpp _ZN8PathLiftD0Ev ✅ verified 1
src/_ZN8ShipWingD0Ev.cpp _ZN8ShipWingD0Ev ✅ verified 1
src/_ZN8SquasherD0Ev.cpp _ZN8SquasherD0Ev ✅ verified 1
src/_ZN8WallSignD0Ev.cpp _ZN8WallSignD0Ev ✅ verified 1
src/_ZN9HugeCoverD0Ev.cpp _ZN9HugeCoverD0Ev ✅ verified 1
src/_ZN9SeesawBobD0Ev.cpp _ZN9SeesawBobD0Ev ✅ verified 1
src/_ZN9ShipWaterD0Ev.cpp _ZN9ShipWaterD0Ev ✅ verified 1
src/_ZN9SolidHeapD0Ev.cpp _ZN9SolidHeapD0Ev ✅ verified 1
src/_ZN9TinyCoverD0Ev.cpp _ZN9TinyCoverD0Ev ✅ verified 1
src/_ZN9TowerStepD0Ev.cpp _ZN9TowerStepD0Ev ✅ verified 1

The private worker commits a test merge, builds the stock ROM profile, compares every executable module, measures matched and source-built code, checks contributor lineage, and verifies affected relocations. The mod profile is opt-in and is not part of this merge gate.

@andrewboudreau
andrewboudreau merged commit 7e0f6dc into main Aug 10, 2026
3 checks passed
@andrewboudreau
andrewboudreau deleted the cpp/part4-d0 branch August 10, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant