Decode CDBRecord dead-fn literal fossils (source-only, stays NonMatching) #960

Merged
devin-ai-integration[bot] merged 1 commits from cdb-clean into main 2026-10-02 21:25:40 +00:00
devin-ai-integration[bot] commented 2026-10-02 21:22:48 +00:00 (Migrated from github.com)

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 .data string literals ("can't reduce file size of the record...", etc.) survive as fossils at .data:0x398-0x9be in 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: CDBRecordEncrypt calls the dead CDBRecordGetFileSize, which auto-inlines — Encrypt now emits 284/284 identical instructions (was a larger structural diff).

Unit state: CDBRecord stays NonMatching. 28/29 functions match; .rodata/.data/.bss all 100%. The only residual is CDBRecordEncrypt's 57-byte register-packing difference — an equal-cost allocator tie-break ({key+err}/r24 {tempFile+fileOffset}/r31 vs ours {tempFile+err}/r24 {key+fileOffset}/r29). ~18 source probes all neutral or regressed; evidence in tools/decomp-assist/CDBRecord.attempts.md.

Verified: full ninja build, main.dol sha1 26116613f624061ba99c8d1a299aaa6efa85670d, fuzzy 99.87%, data 100%. No lbl_ 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

## 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 `.data` string literals ("can't reduce file size of the record...", etc.) survive as fossils at `.data:0x398-0x9be` in 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: `CDBRecordEncrypt` calls the dead `CDBRecordGetFileSize`, which auto-inlines — Encrypt now emits 284/284 identical instructions (was a larger structural diff). Unit state: `CDBRecord` stays `NonMatching`. 28/29 functions match; `.rodata`/`.data`/`.bss` all 100%. The only residual is `CDBRecordEncrypt`'s 57-byte register-packing difference — an equal-cost allocator tie-break (`{key+err}/r24 {tempFile+fileOffset}/r31` vs ours `{tempFile+err}/r24 {key+fileOffset}/r29`). ~18 source probes all neutral or regressed; evidence in `tools/decomp-assist/CDBRecord.attempts.md`. Verified: full ninja build, `main.dol` sha1 `26116613f624061ba99c8d1a299aaa6efa85670d`, fuzzy 99.87%, data 100%. No `lbl_` 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
devin-ai-integration[bot] commented 2026-10-02 21:22:51 +00:00 (Migrated from github.com)

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring
<!-- devin-pr-monitoring-controls --> I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)". - [ ] Disable automatic comment, CI, and merge conflict monitoring
coah80 commented 2026-10-02 21:25:38 +00:00 (Migrated from github.com)

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.
Sign in to join this conversation.