Decode CDBRecord dead-fn literal fossils (source-only, stays NonMatching) #960
Reference in New Issue
Block a user
Delete Branch "cdb-clean"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Restores ~15 link-deadstripped retail functions in
CDBRecord.c(CDBRecordReduceFileSize,CDBRecordReduceDataSize,CDBRecordSetFileType,CDBRecordGetFileType,CDBRecordGetGameCode,CDBRecordGetMakerCode,CDBRecordGetModifiedTime,CDBRecordGetModifiedCount,CDBRecordSetName,CDBRecordGetKeyword,CDBRecordGetKey,CDBRecordGetCalendarTime,CDBRecordDuplicate,CDBRecordGetFileSize).These functions exist in the retail object — the linker dead-strips their code from the DOL, but their emitted
.datastring literals ("can't reduce file size of the record...", etc.) survive as fossils at.data:0x398-0x9bein the orig object. Adding the real functions reproduces those literals byte-identically at the exact orig vaddrs (DOL-verified). These are real retail functions evidenced by the fossil literals, not score-padding objects.A side benefit:
CDBRecordEncryptcalls the deadCDBRecordGetFileSize, which auto-inlines — Encrypt now emits 284/284 identical instructions (was a larger structural diff).Unit state:
CDBRecordstaysNonMatching. 28/29 functions match;.rodata/.data/.bssall 100%. The only residual isCDBRecordEncrypt's 57-byte register-packing difference — an equal-cost allocator tie-break ({key+err}/r24 {tempFile+fileOffset}/r31vs ours{tempFile+err}/r24 {key+fileOffset}/r29). ~18 source probes all neutral or regressed; evidence intools/decomp-assist/CDBRecord.attempts.md.Verified: full ninja build,
main.dolsha126116613f624061ba99c8d1a299aaa6efa85670d, fuzzy 99.87%, data 100%. Nolbl_names, no volatile tricks, no invented objects.Link to Devin session: https://app.devin.ai/sessions/222dce3cd2364f14bc9a8d5ef82cda00
Open in Devin Desktop: https://app.devin.ai/desktop/session/222dce3cd2364f14bc9a8d5ef82cda00?variant=devin
Requested by: @coah80
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.