WIP: Reproduce game weak data with a PCH - #130
Draft
KakarottoCake wants to merge 2 commits into
Draft
Conversation
Report for GMSJ01 (b1cfdf6 - 6854611)📈 Matched code: 35.50% (+0.30%, +10592 bytes) ✅ 35 new matches
...and 5 more new matches 📈 39 improvements in unmatched items
...and 9 more improvements in unmatched items 📉 5 regressions in unmatched items
|
KakarottoCake
force-pushed
the
pch-j3djoint
branch
from
July 26, 2026 15:09
d8cac9d to
6a41574
Compare
KakarottoCake
force-pushed
the
pch-j3djoint
branch
2 times, most recently
from
July 26, 2026 16:01
2002949 to
a927788
Compare
Mrkol
requested changes
Jul 26, 2026
KakarottoCake
force-pushed
the
pch-j3djoint
branch
4 times, most recently
from
July 26, 2026 17:36
533a056 to
f8aa717
Compare
Contributor
Author
|
Follow-up commit a7e5756 centralizes the common game compiler profile in cflags_game: -opt all,nostrength, -inline deferred, and -prefix SMS.mch. The PCH build and the three evidence-backed no-PCH object exceptions retain explicit flag lists; THPPlayer remains on its separate profile. Verified with a full build (mario.dol: OK), ninja baseline/changes_all (no regressions), Python syntax validation, and git diff --check. |
KakarottoCake
force-pushed
the
pch-j3djoint
branch
from
July 27, 2026 16:49
a7e5756 to
6854611
Compare
KakarottoCake
force-pushed
the
pch-j3djoint
branch
from
July 27, 2026 19:37
6854611 to
9b9140b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This reproduces the MWCC precompiled-header behavior responsible for the J3DJoint weak Vec literals appearing in
.datain retail game objects.extra_cflags=["-prefix SMS.mch"]-opt all,nostrengthand-inline deferredcentralized incflags_gameTMBindShadowBodyTWW references:
Results
Against current main:
build/GMSJ01/mario.dol: OKAdditional improvements include:
M3DUtil/SampleCtrlNodedata: 83.33% -> 100%Player/MarioParticledata: 88.24% -> 100%Enemy/gessodata: 47.74% -> 100%Strategic/liveinterpcode: 41.69% -> 72.24%Enemy/namekuricode: 40.30% -> 49.86%Enemy/gatekeeperdata: 16.82% -> 99.74%The project sweep also fixes retail behavior/layout mistakes: Kumokun now initializes
mSLAttackHeightinstead of overwritingmSLAttackRadius, TCoasterEnemy initializesmPathDir, and TMareWallRock callsawakerather thanalive.Per review, this revision contains no manual volatile stack padding. Stack-related near-matches are intentionally left unmatched for future inline work.
Selective PCH audit
I rebuilt all 387 game units both with and without the PCH and compared every unit against retail. The final selection combines the original 28 data-layout candidates with 12 additional units whose matching results improved in the controlled A/B build. Only these 40 units receive
-prefix SMS.mch; all remaining game objects compile without it.The global experiment was useful for identifying the additional candidates, but is no longer the submitted configuration. This preserves all verified match gains without imposing PCH state on unrelated translation units.
The audit also proved three notable no-PCH cases:
MarioUtil/RumbleData: PCH adds 40 bytes absent from retail; no-PCH restores exact data and linked statusMarioUtil/gd-reinit-gx: PCH adds 64 bytes of.dataand 4 bytes of.sdataabsent from retail and breaks exactReInitTransformStrategic/spcinterp: PCH adds 40 bytes of.dataand 4 bytes of.sdataabsent from retail and breaks exactTSpcInterp::updateNo padding or source fakematch is used for these results.
Known edge case
MapObjInit retains its existing stand-in literals. Its retail object owns
TMapObjGeneral's vtable,getFlushTimeweak body, and adjusted destructor thunk, while the current decomp does not emit the latter two there. Removing the stand-ins exposes that pre-existing ownership failure. This needs the real ownership/source correction rather than another fakematch.Validation
-prefix SMS.mchninjabuild and retail DOL checksumgit diffchecks