Compare commits

...

6 Commits

Author SHA1 Message Date
Devin AI
50c607f457 wad: BackupEx dead-compare fossil + file_done label + header ptr web
- file_done: 'if (flags[2]==1) fileFd=-1' overwritten by later
  unconditional 'fileFd=-1' reproduces orig's branch-free lbz+cmplwi
  fossil; label placed before the if (inner gotos land past it).
- Drop redundant result=0 in path==0 arm (orig dedups it).
- WADBackupHeader* headerBlockHeader for member-address args gives
  orig's base+member two-addi shape (remat-vs-keep residual remains).

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 19:05:44 +00:00
Devin AI
d5133925f4 symbols: rename www_wiisetting pooled local
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 18:01:16 +00:00
Devin AI
f26eeb4527 wad: decode BackupEx file_done label placement, document remaining walls
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 18:01:12 +00:00
Devin AI
559687ce69 wad: vestigial buffer frees + contentSize check fossil in WADImportGetBlocks/DVDExForBS
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 17:50:41 +00:00
coah
ff90063ef9 match(NWC24MBoxCtrl 25/25) (fz21d) (worker 710e3312) (#836) 2026-10-02 12:19:14 -05:00
devin-ai-integration[bot]
c1183780c2 eggAudioExpMgr: emit-gate headers for orig symbol set (stays Equivalent) (#835)
Split 2 of 2 from #815. Removes the invented 'Sample' class. The
EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS gates (ArcPlayerMgr 9 virtuals,
SoundHeapMgr loadState/getCurrentLevel, nw4r AutoLock ct/dt) reproduce
orig's .o emit set exactly: same 8 .text symbols at the same offsets plus
__vt__ at .data+0/0x78.

Stays Equivalent: orig orders the secondary-vtable thunks
[@52@dt][@52@calc] while MWCC emits [@52@calc][@52@dt] here, and orig
emits them GLOBAL while ours are WEAK. Verified across 6 other orig
units that thunk order follows most-derived declared-virtual order; the
only lever found that flips it is a second ODR-used derived class's
vtable build - invented code, rejected. See
tools/decomp-assist/linkgap-audio.attempts.md.

Co-authored-by: devin <devin@cognition.ai>
Co-authored-by: coah80 <usernamecole7@gmail.com>
2026-10-02 12:07:38 -05:00
12 changed files with 602 additions and 15 deletions

View File

@@ -55,7 +55,7 @@ Progress
|:---:|:---:|:---:|:---:|
| 99.57% | 90.47% | 70.31% | 99.37% |
units 952/1027 complete, functions 12350/12563 matched.
units 952/1027 complete, functions 12351/12563 matched.
decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data
<!-- progress:end -->

View File

@@ -21841,7 +21841,7 @@ globalNames__Q23www9trasition = .sdata:0x81696300; // type:object size:0x8 scope
@1425 = .sdata:0x81696308; // type:object size:0x1 scope:local
gEnableDpd = .sdata:0x81696310; // type:object size:0x4 data:4byte
globalNames__Q23www10wiisetting = .sdata:0x81696314; // type:object size:0x8
lbl_8169631C = .sdata:0x8169631C; // type:object size:0x1
@17315 = .sdata:0x8169631C; // type:object size:0x1 scope:local
lbl_8169631D = .sdata:0x8169631D; // type:object size:0x8 data:string
lbl_81696325 = .sdata:0x81696325; // type:object size:0x4 data:string
lbl_81696329 = .sdata:0x81696329; // type:object size:0x8 data:string

View File

@@ -38,6 +38,19 @@ namespace EGG {
virtual void calc(); // 0x30
#ifdef EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, u32 id); // 0x34
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, unsigned int id); // 0x38
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, const char* pName); // 0x3C
virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, u32 id); // 0x44
virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, unsigned int id); // 0x44
virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, const char* pName); // 0x48
virtual bool holdSound(nw4r::snd::SoundHandle* pHandle, u32 id); // 0x50
virtual bool holdSound(nw4r::snd::SoundHandle* pHandle, unsigned int id); // 0x50
virtual bool holdSound(nw4r::snd::SoundHandle* pHandle, const char* pName); // 0x58
#else
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, u32 id) { return mSoundArchivePlayer.StartSound(pHandle, id); } // 0x34
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, unsigned int id) { return mSoundArchivePlayer.StartSound(pHandle, id); } // 0x38
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, const char* pName) NO_INLINE {
@@ -66,6 +79,7 @@ namespace EGG {
u32 id = changeNameToId(pName);
return mSoundArchivePlayer.HoldSound(pHandle, id);
} // 0x58
#endif
u32 changeNameToId(const char* pName) { return mpArchive->ConvertLabelStringToSoundId(pName); }
const char* changeIdToName(u32 id) { return mpArchive->GetSoundLabelString(id); }

View File

@@ -19,6 +19,10 @@ namespace EGG {
~SoundHeapMgr() { destroySoundHeap(); }
#ifdef EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
virtual bool loadState(s32 id); // 0x08
virtual s32 getCurrentLevel(); // 0x0C
#else
virtual bool loadState(s32 id) {
#ifdef IPL_SOUND_MATCHING
if (id > 0 && mHeap.GetCurrentLevel() >= id) {
@@ -35,6 +39,7 @@ namespace EGG {
} // 0x08
virtual s32 getCurrentLevel() { return mHeap.GetCurrentLevel(); } // 0x0C
#endif
s32 saveState() { return mHeap.SaveState(); }

View File

@@ -1,3 +1,5 @@
#define EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
#include <egg/core.h>
namespace EGG {

View File

@@ -19,8 +19,13 @@ namespace nw4r {
template <typename T>
class AutoLock : private NonCopyable {
public:
#ifdef EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
explicit AutoLock(T& rLockObj);
~AutoLock();
#else
explicit AutoLock(T& rLockObj) : mLockObj(rLockObj) { Lock(rLockObj); }
~AutoLock() { Unlock(mLockObj); }
#endif
private:
T& mLockObj; // 0x00

View File

@@ -753,8 +753,7 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
if (!componentTable) {
componentCount = Zi8GetTableCount(1, 7, work);
componentOrdinals = (ziU8*)Zi8GetTableAddress(1, 7, work);
componentCursor = (ziU8*)Zi8GetTableAddress(1, 2, work);
componentTable = componentCursor;
componentTable = componentCursor = (ziU8*)Zi8GetTableAddress(1, 2, work);
componentCursor += 8;
--componentCount;
componentIndex = componentCount;

View File

@@ -397,6 +397,8 @@ s32 WADImportGetBlocks(char* path, MEMAllocator* allocator, WADLocation location
s32 result;
u32 fileOffset;
WADFileEntry* allocatedFiles;
void* fileNames;
void* titleList;
BOOL streamOpened;
u32 transferId;
u32 contentCount;
@@ -406,9 +408,11 @@ s32 WADImportGetBlocks(char* path, MEMAllocator* allocator, WADLocation location
u32 skipTitleMeta = flags & 4;
WADFileHeader* fileHeader;
streamOpened = FALSE;
fileOffset = 0;
fileNames = 0;
titleList = 0;
allocatedFiles = 0;
streamOpened = FALSE;
memset(&workspace.unpackInfo, 0, sizeof(WADUnpackInfo));
if (fileListOut != 0) {
*fileListOut = 0;
@@ -521,6 +525,12 @@ s32 WADImportGetBlocks(char* path, MEMAllocator* allocator, WADLocation location
cleanup:
_WADFreeMemory(&workspace.unpackInfo, allocator);
if (fileNames != 0) {
_WADMemFree(allocator, fileNames);
}
if (titleList != 0) {
_WADMemFree(allocator, titleList);
}
if ((fileListOut != 0) && (result != 0)) {
if (allocatedFiles != 0) {
_WADMemFree(allocator, allocatedFiles);
@@ -535,7 +545,7 @@ cleanup:
static s32 WAD_815BFFA8(WADImportLoopArgs* args) {
s32 fd = args->fd;
s32 result = 0;
s32 result;
u32 remaining = args->size;
WADImportTransfer* transfer = args->transfer;
u32 bufferIndex = 0;
@@ -561,7 +571,7 @@ static s32 WAD_815BFFA8(WADImportLoopArgs* args) {
s32 WADImportEx(char* path, MEMAllocator* allocator, WADLocation location, u32 offset, u32 flags,
WADProcessCallback processCallback) {
s32 result = 0;
s32 result;
ESHash* sharedContentHashes = 0;
ESContentId* installedContentIds = 0;
ESContentMeta* matchingContents = 0;
@@ -1181,7 +1191,7 @@ static s32 WAD_815C1288(WADExportLoopArgs* args) {
u32 remaining = args->size;
u32 bufferIndex = 0;
WADImportTransfer* transfer = args->transfer;
s32 result = 0;
s32 result;
for (; (remaining != 0) && (result == 0); bufferIndex ^= 1) {
OSMutex* mutex;
@@ -1257,6 +1267,7 @@ s32 WADBackupEx(u64 titleId, u32 flags, MEMAllocator* allocator, char* path, u32
s32 contentExportStarted;
s32 threadCreated = FALSE;
s32 fileFd;
WADBackupHeader* headerBlockHeader;
titleMetaSize = 0;
contentDataSize = 0;
@@ -1377,7 +1388,6 @@ s32 WADBackupEx(u64 titleId, u32 flags, MEMAllocator* allocator, char* path, u32
result = 0;
if (path == 0) {
*sizeOut = totalSize + 0x340;
result = 0;
goto cleanup;
}
outputBuffer = _WADMemAlloc(allocator, 0x10000);
@@ -1398,6 +1408,7 @@ s32 WADBackupEx(u64 titleId, u32 flags, MEMAllocator* allocator, char* path, u32
if (result != 0) {
goto cleanup;
}
headerBlockHeader = &headerBlock.header;
paddedSize = sizeof(headerBlock);
memset(&headerBlock, 0, paddedSize);
if ((u32)WADWriteStream(&stream, &headerBlock, paddedSize) != paddedSize) {
@@ -1414,12 +1425,12 @@ s32 WADBackupEx(u64 titleId, u32 flags, MEMAllocator* allocator, char* path, u32
headerBlock.header.fileSize = fileDataSize;
headerBlock.header.numFiles = fileCount;
headerBlock.header.backupAreaLen = totalSize + 0x340;
result = ES_GetDeviceId(&headerBlock.header.deviceId);
result = ES_GetDeviceId(&headerBlockHeader->deviceId);
if (result != 0) {
goto cleanup;
}
if ((flags & 1) != 0) {
memcpy(&headerBlock.header.cidx, &existingContentMask, sizeof(existingContentMask));
memcpy(&headerBlockHeader->cidx, &existingContentMask, sizeof(existingContentMask));
}
if ((flags & 2) != 0) {
u32 currentTitleLow;
@@ -1442,7 +1453,7 @@ s32 WADBackupEx(u64 titleId, u32 flags, MEMAllocator* allocator, char* path, u32
headerBlock.header.titleId = ((u64)currentTitleHigh << 32) | currentTitleLow;
}
if (_WADGetTransferId(transferMac) != 0) {
memcpy(headerBlock.header.deviceMac, transferMac, sizeof(headerBlock.header.deviceMac));
memcpy(headerBlockHeader->deviceMac, transferMac, sizeof(headerBlockHeader->deviceMac));
}
}
SHA1Reset(hashContext);
@@ -1683,9 +1694,13 @@ s32 WADBackupEx(u64 titleId, u32 flags, MEMAllocator* allocator, char* path, u32
}
}
file_done:
if (fileHeaderBuffer->flags[2] == 1) {
fileFd = -1;
}
if (fileOpened) {
NANDClose(&savedFile);
}
fileFd = -1;
if (result != 0) {
readSize = (fileHeaderBuffer->fileSize + 0x3F) & ~0x3F;
totalSize -= readSize;
@@ -2921,7 +2936,7 @@ static void _WADRandPad(void* buffer, u32 size) {
static s32 WAD_815C43E0(WADHashThreadArgs* args) {
void* context = args->context;
s32 result = 0;
s32 result;
u32 remaining = args->size;
WADImportTransfer* transfer = args->transfer;
u32 bufferIndex = 0;
@@ -3524,6 +3539,9 @@ s32 WADImportDVDExForBS(const char* path, void* buffer, u32 bufferSize) {
parts.titleMeta = readBuffer + sectionOffset;
sectionOffset += (header.tmdSize + 0x3F) & ~0x3F;
}
if (header.contentSize != 0) {
contentBuffer = readBuffer + sectionOffset;
}
contentBuffer = readBuffer + sectionOffset;
remainingBufferSize = bufferSize - sectionOffset;
if ((u32)sectionOffset > bufferSize) {

View File

@@ -64,7 +64,7 @@ static NWC24Err ClearMBCEntry(MBCHeader* header, NWC24File* file, u32 offset);
static NWC24Err MountVFMBox(NWC24MBoxType type);
static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entry);
static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* msg) NO_INLINE;
BOOL NWC24iIsMsgObjReadable(const MBCEntry* entry) NO_INLINE;
BOOL NWC24iIsMsgObjReadable(MBCEntry* entry) NO_INLINE;
NWC24Err NWC24CreateVF(const char* path, u32 size);
static inline NWC24Err MakeCtrlPath(char* path, NWC24MBoxType type) {
@@ -221,7 +221,7 @@ NWC24Err NWC24GetMsgObj(NWC24MsgObj* msg, NWC24MBoxType type, u32 id) {
return result;
}
BOOL NWC24iIsMsgObjReadable(const MBCEntry* entry) {
BOOL NWC24iIsMsgObjReadable(MBCEntry* entry) {
if (!(entry->type & 0x200000))
return FALSE;
if (entry->type & 0xFE000000)

View File

@@ -455,3 +455,417 @@ GATE PASS
```
HIGH before -> after, instruction-exact/code/data bytes: zi8cgetc 5/4168/144 -> 5/4168/144; zmtkey 3/1488/60 -> 3/1488/60; zconvert 3/1380/112 -> 3/1380/112; tiPcKeyboard 140/28064/18548 -> 140/28064/18564. The gate passes, DOL SHA1 is exact, no regressions. The required instruction-exact count increase is still unmet. The retained data correction makes keyboard data 100% without changing section size or any code.
## MAX continuation, 2026-10-02
HEAD 5518cb16fda3091c727d974aacf477a2cf89b74a; fetched origin/main; owned sources and symbol config equal origin/main. No source changes carried from XHIGH. Parked zmtkey/zconvert/tiPcKeyboard excluded.
Baseline quick gate:
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] objdiff: code 4168/47816 data 144/536 functions 5/8 fuzzy 96.4008 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] instruction-exact functions: 5/8
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .data size 392 match None
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sbss2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sdata2 size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .text size 47816 match 96.40079
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: ZiMatchZHSpelling 98.80165
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: zi8InternalGetZH 95.99054
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: Zi8GetElementCount 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] baseline: code 4168/47816 data 144 functions 5 fuzzy 96.4008
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] objdiff: code 10376/10604 data 192/192 functions 24/25 fuzzy 99.8491 linked code 0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] instruction-exact functions: 24/25
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .data size 168 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sbss size 8 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sdata size 16 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .text size 10604 match 99.84911
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] below 100: NWC24iIsMsgObjReadable 92.98245
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] baseline: code 10376/10604 data 192 functions 24 fuzzy 99.8491
[libs/RVL_SDK/src/fa/pf_cache] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_cache] objdiff: code 6464/7396 data None/None functions 35/36 fuzzy 99.7755 linked code 0
[libs/RVL_SDK/src/fa/pf_cache] instruction-exact functions: 35/36
[libs/RVL_SDK/src/fa/pf_cache] section .text size 7396 match 99.77555
[libs/RVL_SDK/src/fa/pf_cache] below 100: PFCACHE_DoWriteNumSectorAndFreeIfNeeded 98.21889
[libs/RVL_SDK/src/fa/pf_cache] baseline: code 6464/7396 data None functions 35 fuzzy 99.7755
regressions vs baseline: 0
global matched_code_percent: 90.40604 -> 90.40604
global fuzzy_match_percent: 99.56056 -> 99.56056
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36596 -> 99.36596
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
All three pools checked first: IDENTICAL (0/0, 8/8, 0/0).
MAX spelling diagnosis: 121/121 instructions, same 0x130 frame, array positions 0x88/0x8, branch operands and inline call boundaries. Only consistent coloring differs: candidate r27->r28, spelling r22->r23, length parameter r23->r24, work r28->r29, match r29->r27, candidateLength r24->r22. Function extent 0x1e4 ends exactly at next engine. No immediate stack store/reload; volatile unproven and excluded.
- MAX sM01 ZiMatchZHSpelling: keep candidate length as declared unsigned word returned by the counting helper; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM02 ZiMatchZHSpelling: keep prefix status as unsigned integer Boolean; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM03 ZiMatchZHSpelling: keep both prefix status and candidate count unsigned; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM04 ZiMatchZHSpelling: compute candidate length through a signed count conversion; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM05 ZiMatchZHSpelling: reuse prefix index as candidate length after prefix comparison; insns 122/121, structural/exact diffs (4, 92), fuzzy 97.31405, code 4168, data 72. Restored pending gates.
- MAX sM06 ZiMatchZHSpelling: initialize candidate cursor from incoming candidate before initial length call; insns 122/121, structural/exact diffs (1, 116), fuzzy 97.975204, code 4168, data 72. Restored pending gates.
- MAX sM07 ZiMatchZHSpelling: hold candidate length as signed long; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM08 ZiMatchZHSpelling: scope candidate length around both prefix and phonetic processing; insns 125/121, structural/exact diffs (16, 123), fuzzy 91.818184, code 4168, data 24. Restored pending gates.
- MAX sM09 ZiMatchZHSpelling: use caller-saved count result with a signed helper return declaration; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM10 ZiMatchZHSpelling: use a Boolean-byte prefix status with explicit full-word return; insns 122/121, structural/exact diffs (4, 98), fuzzy 97.06612, code 4168, data 72. Restored pending gates.
- MAX sM11 ZiMatchZHSpelling: use halfword candidate character count; insns 121/121, structural/exact diffs (1, 29), fuzzy 98.34711, code 4168, data 144. Restored pending gates.
- MAX sM12 ZiMatchZHSpelling: use narrow candidate character count matching space-helper argument; insns 121/121, structural/exact diffs (1, 29), fuzzy 98.34711, code 4168, data 144. Restored pending gates.
- MAX sM13 ZiMatchZHSpelling: reuse incoming candidate for phonetic traversal instead of a second pointer; insns 121/121, structural/exact diffs (0, 31), fuzzy 98.67769, code 4168, data 96. Restored pending gates.
- MAX sM14 ZiMatchZHSpelling: reuse incoming spelling for phonetic traversal instead of a second pointer; insns 121/121, structural/exact diffs (0, 34), fuzzy 98.59504, code 4168, data 96. Restored pending gates.
- MAX sM15 ZiMatchZHSpelling: derive prefix failure status from the compared candidate character; insns 134/121, structural/exact diffs (23, 122), fuzzy 87.181816, code 4168, data 24. Restored pending gates.
- MAX sM16 ZiMatchZHSpelling: scope candidate length to initial declaration and prefix status separately; insns 125/121, structural/exact diffs (16, 123), fuzzy 91.818184, code 4168, data 24. Restored pending gates.
MAX spelling declaration search after 16 source trials: declaration block: | ziWChar* candidateCursor; | ziWChar* spellingCursor; | int index; | int matches; | int candidateLength; | ziWChar spacedSpelling[64]; | ziWChar spacedCandidate[64]; | start (0, 29) | best (0, 29) after 52 builds; source restored; best order was: | ziWChar* candidateCursor; | ziWChar* spellingCursor; | int index; | int matches; | int candidateLength; | ziWChar spacedSpelling[64]; | ziWChar spacedCandidate[64]; |
MAX engine diagnosis: target/source 10676/10676 instructions, frame 0x4e0 and all local stack offsets identical. No neighbour overlap (0xa6d0 ends at Zi8NewMatchPhonetic). After branch-aware alignment and register normalization, the known residual structural stream comprises 12 extra and 10 missing return-register copies plus two missing halfword conversions. These are real code-generation differences; the four generated switch-table relocations refer into this inexact function, so their .data gap is code work. Prior width/cast correction alone grows by two instructions.
- MAX gM01 zi8InternalGetZH: spell traditional charset result as an explicit nonzero bit test; insns 10676/10676, structural/exact diffs (9080, 10068), fuzzy 95.99054, code 4168, data 144. Restored pending gates.
- MAX gM02 zi8InternalGetZH: invert traditional charset branch around the shared range reset; insns 10676/10676, structural/exact diffs (9080, 10068), fuzzy 95.99054, code 4168, data 144. Restored pending gates.
- MAX gM03 zi8InternalGetZH: perform traditional charset short-circuit through nested negative guard; insns 10676/10676, structural/exact diffs (9080, 10068), fuzzy 95.99054, code 4168, data 144. Restored pending gates.
- MAX gM04 zi8InternalGetZH: make component cursor a const pointer to const record data for read-only traversal; BUILD FAIL ext/src/clib/zi8cgetc.d build/43U/src/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 757: componentTable = componentCursor; # Error: ^ # (10209) illegal implicit conversion from 'const unsigned char *' to # 'unsigned char *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM05 zi8InternalGetZH: give component cursor definition volatile storage shown by immediate stack reload after assignment; BUILD FAIL ddleware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 2106: &componentIndex, &componentCursor, work)) { # Error: ^ # (10209) illegal implicit conversion from 'unsigned char *volatile *' to # 'unsigned char **' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM06 zi8InternalGetZH: give frequency cursor definition volatile storage shown by immediate stack reload after table call; insns 10676/10676, structural/exact diffs (9080, 10068), fuzzy 95.99054, code 4168, data 144. Restored pending gates.
- MAX gM07 zi8InternalGetZH: narrow paired code returns and order masks on the left; insns 10678/10676, structural/exact diffs (10222, 10519), fuzzy 96.090294, code 4168, data 72. Restored pending gates.
- MAX gM08 zi8InternalGetZH: consume counted table address through one assignment to both cursor and table; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM09 zi8InternalGetZH: emit context character after advancing the emitted-word count separately; insns 10673/10676, structural/exact diffs (9040, 10045), fuzzy 95.96759, code 4168, data 72. Restored pending gates.
- MAX gM11 zi8InternalGetZH: use signed full-word result for phonetic-code interface without changing casts; insns 10676/10676, structural/exact diffs (9080, 10068), fuzzy 95.99054, code 4168, data 144. Restored pending gates.
- MAX gM12 zi8InternalGetZH: declare phonetic and context record tables as const input arrays; BUILD FAIL are/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 874: match.phon[0], match.phon2[0], charset, work)) candidateStatus = 1; # Error: ^ # (10209) illegal implicit conversion from 'const unsigned char *' to # 'void *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM10 zi8InternalGetZH: keep options parameter read-only in engine and private phonetic helper; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM13 zi8InternalGetZH: group all match scalars at their first use through initialized local declarations; insns 10676/10676, structural/exact diffs (7830, 9407), fuzzy 96.202415, code 4168, data 144. Restored pending gates.
MAX retained gM08: combine cursor/table initialization into the natural chained assignment. The two pointers intentionally receive the same dictionary address. Engine fuzzy 95.99054 -> 96.27482, instruction count still 10676/10676; no new exact function. Quick authority gate PASS, all exact functions preserved, data 144/536 unchanged, pool identical, DOL exact, no regressions/forbidden/readability failures.
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] objdiff: code 4168/47816 data 144/536 functions 5/8 fuzzy 96.6547 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] instruction-exact functions: 5/8
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .data size 392 match None
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sbss2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sdata2 size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .text size 47816 match 96.65468
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: ZiMatchZHSpelling 98.80165
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: zi8InternalGetZH 96.27482
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: Zi8GetElementCount 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] baseline: code 4168/47816 data 144 functions 5 fuzzy 96.4008
regressions vs baseline: 0
global matched_code_percent: 90.40604 -> 90.40604
global fuzzy_match_percent: 99.56056 -> 99.56462
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36596 -> 99.36596
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
- MAX gM14 zi8InternalGetZH: on chained-table baseline, narrow both paired phonetic codes to target halfword width; insns 10678/10676, structural/exact diffs (8713, 9803), fuzzy 96.492134, code 4168, data 72. Restored pending gates.
- MAX gM15 zi8InternalGetZH: narrow paired codes and express simplified charset as separate branches; insns 10678/10676, structural/exact diffs (7258, 9196), fuzzy 96.048615, code 4168, data 72. Restored pending gates.
- MAX gM16 zi8InternalGetZH: narrow paired codes and express traditional charset as separate branches; insns 10678/10676, structural/exact diffs (7250, 9196), fuzzy 96.048615, code 4168, data 72. Restored pending gates.
- MAX gM17 zi8InternalGetZH: keep all table addresses as byte-pointer interface returns within this unit; BUILD FAIL zi8cgetc.d build/43U/src/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 2648: phoneticOffsets = Zi8GetTableAddress(1, 13, work); # Error: ^ # (10209) illegal implicit conversion from 'unsigned char *' to # 'unsigned short *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM18 zi8InternalGetZH: use native int return for secondary matcher while preserving byte truncation; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM19 zi8InternalGetZH: chained initialization of frequency table and its starting cursor; insns 10682/10676, structural/exact diffs (10304, 10644), fuzzy 95.96422, code 4168, data 24. Restored pending gates.
- MAX gM20 zi8InternalGetZH: replace phrase-pattern union integer member with native unsigned-long member; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM21 zi8InternalGetZH: correct phonetic-code return to ziU16 on chained table baseline; insns 10678/10676, structural/exact diffs (8713, 9803), fuzzy 96.492134, code 4168, data 72. Restored pending gates.
- MAX gM22 zi8InternalGetZH: use explicit narrow conversion at every returned format-version test; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM23 zi8InternalGetZH: split successful table presence and format-version conditions into nested checks; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM24 zi8InternalGetZH: spell primary matcher branch failure with an explicit byte comparison; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM25 zi8InternalGetZH: scope the option pointer as a read-only local view; BUILD FAIL ibs/RVLMiddleware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 2312: charsetFilter, output, work)) goto engine_finish; # Error: ^ # (10209) illegal implicit conversion from 'const struct *' to # 'struct *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM04 zi8InternalGetZH: make component cursor a const pointer to const record data for read-only traversal; BUILD FAIL bs/RVLMiddleware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 756: tTable = componentCursor = (ziU8*)Zi8GetTableAddress(1, 2, work); # Error: ^ # (10209) illegal implicit conversion from 'const unsigned char *' to # 'unsigned char *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM05 zi8InternalGetZH: give component cursor definition volatile storage shown by immediate stack reload after assignment; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM12 zi8InternalGetZH: declare phonetic and context record tables as const input arrays; BUILD FAIL eware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 1619: phraseOrdinal, &candidateOrdinal, 0, work)) continue; # Error: ^ # (10209) illegal implicit conversion from 'const unsigned char *' to # 'unsigned char *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
MAX GetElementCount diagnosis: source/target 115/115 instructions, 0x230 frame and array/separator offsets identical, branch forms and all operand orders equal. Consistent count/elementCount r28/r27 swap gives 13 differences. No store followed immediately by reload at helper boundary (the saved separator reload follows a call), so no volatile. Extent 0x1cc reaches next symbol exactly. Prior return-elementIndex variation had one return-register difference, worth following with explicit count synchronization and initialization-order trials. Fetched origin/main again; still open.
- MAX cM01 Zi8GetElementCount: return the consumed-input index equivalent to the separately counted inputs; insns 115/115, structural/exact diffs (0, 1), fuzzy 99.95652, code 4168, data 144. Restored pending gates.
- MAX cM02 Zi8GetElementCount: synchronize consumed count from input index at return; insns 116/115, structural/exact diffs (3, 22), fuzzy 98.434784, code 4168, data 72. Restored pending gates.
- MAX cM03 Zi8GetElementCount: assign returned count from consumed index in the return expression; insns 116/115, structural/exact diffs (3, 22), fuzzy 98.434784, code 4168, data 72. Restored pending gates.
- MAX cM04 Zi8GetElementCount: initialize input traversal before result count in the chained zero assignment; insns 115/115, structural/exact diffs (0, 14), fuzzy 99.26087, code 4168, data 144. Restored pending gates.
- MAX cM05 Zi8GetElementCount: initialize result count last in source order of the chain; insns 115/115, structural/exact diffs (0, 14), fuzzy 99.21739, code 4168, data 144. Restored pending gates.
- MAX cM06 Zi8GetElementCount: start chained input indices at zero through result count assignment; insns 115/115, structural/exact diffs (0, 14), fuzzy 99.21739, code 4168, data 144. Restored pending gates.
- MAX cM07 Zi8GetElementCount: hold input element index as wider unsigned integer with explicit byte reads; insns 115/115, structural/exact diffs (1, 13), fuzzy 98.86957, code 4168, data 144. Restored pending gates.
- MAX cM08 Zi8GetElementCount: preserve incoming element limit as a const local byte; insns 116/115, structural/exact diffs (1, 108), fuzzy 98.478264, code 4168, data 24. Restored pending gates.
- MAX cM09 Zi8GetElementCount: derive count through consumed index only when the loop exits through its limit; insns 121/115, structural/exact diffs (9, 32), fuzzy 93.347824, code 4168, data 24. Restored pending gates.
- MAX cM10 Zi8GetElementCount: restore saved separator through an ordinary scalar instead of single-field state; insns 113/115, structural/exact diffs (8, 106), fuzzy 97.48695, code 4168, data 24. Restored pending gates.
- MAX cM11 Zi8GetElementCount: split the input-limit and character-remaining loop conditions without changing order; insns 115/115, structural/exact diffs (10, 56), fuzzy 92.17391, code 4168, data 144. Restored pending gates.
- MAX cM12 Zi8GetElementCount: return promoted consumed count through an enum-typed local; insns 115/115, structural/exact diffs (2, 13), fuzzy 98.391304, code 4168, data 144. Restored pending gates.
MAX GetElementCount declaration search: declaration block: | ziU8 spacedIndex; | ziU8 elementIndex; | ziU8 count; | ziWChar spacedElements[256]; | start (0, 13) | best (0, 13) after 13 builds; source restored; best order was: | ziU8 spacedIndex; | ziU8 elementIndex; | ziU8 count; | ziWChar spacedElements[256];
cM01 returns the equivalent elementIndex but leaves an unused count variable; rejected as an artificial partial improvement, not retained. Explicit synchronization adds an instruction and regresses exception data. All remaining candidates restored.
MAX NWC24iIsMsgObjReadable diagnosis: fetched origin/main, source unchanged there; open 92.98245%. 57/57 instructions, identical 0x10 frame, same branches, calls, field offsets and expression operands after prologue. Target saves LR/r31 and copies the input before loading type; source schedules the type load/mask through those three prologue operations. No immediate stack reload or neighbour overlap (0xe4 ends at next public function). Remaining unit data already 192/192 including corrected MountInfo extent; no data changes needed. Prior readonly views and full-body helper did not change this scheduling.
- MAX nM01 NWC24iIsMsgObjReadable: use an opaque constant input and explicit typed readonly mailbox view; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM02 NWC24iIsMsgObjReadable: use private message-object view for common type/app/LED header fields; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM03 NWC24iIsMsgObjReadable: use signed shift of readable type bit instead of mask predicate; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM04 NWC24iIsMsgObjReadable: scope read type and subsequent validation in explicit positive branch; insns 57/57, structural/exact diffs (15, 50), fuzzy 85.789474, code 10376, data 192. Restored pending gates.
- MAX nM05 NWC24iIsMsgObjReadable: make first type validity mask an enum-valued flag constant; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM06 NWC24iIsMsgObjReadable: use whole unsigned type word local for initial three type predicates only; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM07 NWC24iIsMsgObjReadable: return the Boolean app-mask comparison through an explicit local result; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM08 NWC24iIsMsgObjReadable: delay independent app/LED readonly view setup until after first type test; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
MAX PFCACHE_DoWriteNumSectorAndFreeIfNeeded diagnosis: fetched origin/main, still open 98.21889%. Both 233 instructions, same 0x30 frame, same saved GPRs and all branches. Only third overlap block differs at instructions 136-144: target reloads page start, recomputes num_sector+sector despite cached r31 request end, computes last_sector before success/remaining bookkeeping; source reuses r31 and reconstructs last sector from page start + overlap. No immediate stack store/reload for these scalars, so volatile is unproven. Extent 0x3a4 ends exactly at DoFlushCache. No data sections/pool in this unit. Try real signedness, input const qualification, transient-helper boundaries and range-variable structure before register search.
- MAX pM01 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: compute last sector using unsigned-int request operands rather than page cancellation; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM02 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: compute last sector with reversed request addition and decrement grouped into count; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM03 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: group last-sector decrement into starting sector; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM04 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: make input head pointer read-only because this routine never replaces it; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM05 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: preserve source buffer as const at every memory-copy call; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM06 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: compute overlap and last sector using unsigned-int transient arithmetic; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.53648, code 6464, data None. Restored pending gates.
- MAX pM07 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: derive last sector before overlap using the page-relative count expression; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM08 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: declare half-open request end as a block-local named range value after memcpy; insns 232/233, structural/exact diffs (14, 106), fuzzy 98.62661, code 6464, data None. Restored pending gates.
- MAX pM09 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: reuse existing end-buffer arithmetic without a whole-sector last variable; insns 232/233, structural/exact diffs (14, 107), fuzzy 98.45493, code 6464, data None. Restored pending gates.
- MAX pM10 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: compute last sector from overlap before remainder-count mutation; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM11 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: keep overlap count in a signed integer but convert at sector bookkeeping; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM12 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: keep last-sector value in a signed integer but preserve sector subtraction; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM13 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: read page sector through const page view for both overlap calculations; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM14 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: order rest-sector update before success update in the right overlap; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM15 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: calculate the last-sector buffer offset directly as overlap minus one; insns 230/233, structural/exact diffs (17, 107), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM16 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: keep overlap calculation inside a named range descriptor; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM17 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper isolates request-end calculation from overlap arithmetic; insns 234/233, structural/exact diffs (17, 108), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM18 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper uses a named half-open end local; insns 234/233, structural/exact diffs (17, 108), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM19 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper keeps a signed 32-bit endpoint result; insns 234/233, structural/exact diffs (17, 108), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM20 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper groups count decrement before start; insns 234/233, structural/exact diffs (17, 108), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM21 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper combines with direct overlap-count expression; insns 234/233, structural/exact diffs (17, 108), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM22 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper receives page start and overlap instead of request input; insns 233/233, structural/exact diffs (5, 8), fuzzy 97.91846, code 6464, data None. Restored pending gates.
- MAX pM23 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper isolates request-end calculation from overlap arithmetic; allow normal helper inlining at this function boundary; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM24 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper uses a named half-open end local; allow normal helper inlining at this function boundary; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM25 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper keeps a signed 32-bit endpoint result; allow normal helper inlining at this function boundary; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM26 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper groups count decrement before start; allow normal helper inlining at this function boundary; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM27 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper combines with direct overlap-count expression; allow normal helper inlining at this function boundary; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM28 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper receives page start and overlap instead of request input; allow normal helper inlining at this function boundary; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM29 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression num_sector - (p_page->sector - sector); insns 234/233, structural/exact diffs (15, 107), fuzzy 97.74678, code 6464, data None. Restored pending gates.
- MAX pM30 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression (sector - p_page->sector) + num_sector; insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX pM31 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression num_sector + (sector - p_page->sector); insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX pM32 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression p_page->size - (p_page->sector + (p_page->size - num_sector) - sector); insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM33 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression p_page->size + (num_sector + sector - (p_page->sector + p_page->size)); insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX pM34 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression (num_sector + sector - (p_page->sector + p_page->size)) + p_page->size; insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX pM35 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression num_sector - (p_page->sector + p_page->size - sector) + p_page->size; insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX pM36 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression (num_sector - p_page->sector) + sector; insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX nM09 NWC24iIsMsgObjReadable: match a mutable mailbox-entry input view rather than the guessed const formal; insns 57/57, structural/exact diffs (0, 0), fuzzy 100.0, code 10604, data 192. Restored pending gates.
- MAX nM10 NWC24iIsMsgObjReadable: use a readonly pointer value to the mutable mailbox entry; insns 57/57, structural/exact diffs (0, 0), fuzzy 100.0, code 10604, data 192. Restored pending gates.
- MAX nM11 NWC24iIsMsgObjReadable: retain full entry constness while qualifying pointer value itself; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM12 NWC24iIsMsgObjReadable: introduce a common typed header view with the proven shared leading fields; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM13 NWC24iIsMsgObjReadable: use an inline common-header validation helper for the first readable type bit only; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM14 NWC24iIsMsgObjReadable: keep the app-id equality operation in its own inline read-only view helper; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
MAX exact nM09: NWC24iIsMsgObjReadable input was guessed pointer-to-const; the target was compiled with mutable MBCEntry*. Removing const only from this function declaration and definition moves the first type load/mask after LR/r31 saves exactly as target. 57/57 instructions, ctxdiff 0, 100% objdiff; whole unit 24/25 -> 25/25, code 10376/10604 -> 10604/10604, data unchanged 192/192. nM10 pointer-value const is also exact; use simpler nM09. All call sites already pass mutable MBCEntry*, no shared header change. Quick gate PASS, DOL exact, pools identical and zero regressions.
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] objdiff: code 10604/10604 data 192/192 functions 25/25 fuzzy 100.0000 linked code 0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] instruction-exact functions: 25/25
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .data size 168 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sbss size 8 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sdata size 16 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .text size 10604 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] baseline: code 10376/10604 data 192 functions 24 fuzzy 99.8491
regressions vs baseline: 0
global matched_code_percent: 90.40604 -> 90.41365
global fuzzy_match_percent: 99.56056 -> 99.56516
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36596 -> 99.36596
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
- MAX pM37 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: match a mutable source-buffer formal from the older cache API; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM38 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: read volume geometry through a const formal and retain explicit mutable driver call; insns 233/233, structural/exact diffs (17, 62), fuzzy 92.44635, code 6464, data None. Restored pending gates.
- MAX pM39 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: model memory-copy source as a mutable opaque pointer in this unit only; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM40 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: scope overlap and last-sector locals directly in the partial-page branch; BUILD FAIL "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/fa/pf_cache.d build/43U/src/libs/RVL_SDK/src/fa/pf_cache.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\fa\pf_cache.c # --------------------------------------- # 610: pf_u32 num_overlap = p_page->size - ((p_page->sector + p_page->size) - (num_sector + sector)); # Error: ^^^^^^ # (10141) expression syntax error # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX pM40 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: scope overlap and last-sector locals directly in the partial-page branch; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM41 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: scope an initialized last requested sector after the copy; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM42 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: derive a half-open request endpoint with wide intermediate arithmetic; insns 235/233, structural/exact diffs (17, 229), fuzzy 94.356224, code 6464, data None. Restored pending gates.
- MAX pM43 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: derive overlap and last sector from a wide request endpoint local; insns 237/233, structural/exact diffs (15, 235), fuzzy 93.042915, code 6464, data None. Restored pending gates.
- MAX sM17 ZiMatchZHSpelling: declare candidate input const at the function definition and convert only for legacy helpers; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM18 ZiMatchZHSpelling: declare spelling input const at the function definition and convert only for legacy helper; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM19 ZiMatchZHSpelling: declare both candidate and spelling input arrays readonly; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM20 ZiMatchZHSpelling: give count helper a readonly word prototype while keeping matching input mutable; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM21 ZiMatchZHSpelling: give readonly candidate and count helper consistent const-qualified word types; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM22 ZiMatchZHSpelling: declare initial candidate length immutable after its one assignment; insns 121/121, structural/exact diffs (2, 30), fuzzy 97.19009, code 4168, data 144. Restored pending gates.
MAX cache structural follow-up: 43 distinct natural source trials, plus compiler-rejected unscoped declaration attempt. Mutable-buffer and readonly-head views preserve 9 differences; readonly volume regresses allocation/scheduling (62 differences). The closest fuzzy alternative pM08 has 232/233 instructions and greater branch-aware structural distance (14 vs 4), so reject it rather than trade the target instruction structure for a percentage gain. Wider arithmetic adds real instructions and is rejected. All cache source trials restored. No stack proof permits volatile.
MAX spelling follow-up after mailbox input-qualifier match: formal const candidate/spelling, consistent readonly count-helper prototype, and initialized immutable candidate length were all compiled. Const views reproduce the same 29 register differences. Local count scope changes instruction structure. Source restored; no proven volatile local evidence.
MAX final data proof: zi8cgetc .data is exactly 392 bytes in both objects, four compiler-generated switch tables, all 98 relocations resolve inside zi8InternalGetZH. No ordinary data symbol needs a real-name rename; these remain code work. Exception sections and the 16-byte constants/8-byte zero object are exact. NWC24MBoxCtrl has byte-identical ordinary strings and real MountInfo extent, matched data192/192; extracted trailing alignment remains unowned in source sections. pf_cache has no allocated non-code sections. No config or shared-header changes made.
MAX cache declaration search after structural/type/helper trials: declaration block: | PF_CACHE_PAGE* p_page = PF_NULL; | pf_s32 err; | pf_u32 num_rest_sector = num_sector; | pf_u8* p_sbuf; | pf_u8* p_ebuf; | pf_u32 num_overlap; | pf_u32 last_sector; | start (4, 9) | best (4, 9) after 52 builds; source restored; best order was: | PF_CACHE_PAGE* p_page = PF_NULL; | pf_s32 err; | pf_u32 num_rest_sector = num_sector; | pf_u8* p_sbuf; | pf_u8* p_ebuf; | pf_u32 num_overlap; | pf_u32 last_sector;
MAX coverage ZiMatchZHSpelling: 22 distinct successfully compiled source trials.
MAX coverage zi8InternalGetZH: 21 distinct successfully compiled source trials.
MAX coverage Zi8GetElementCount: 12 distinct successfully compiled source trials.
MAX coverage NWC24iIsMsgObjReadable: 14 distinct successfully compiled source trials.
MAX coverage PFCACHE_DoWriteNumSectorAndFreeIfNeeded: 43 distinct successfully compiled source trials.
Coverage complete: no untried owned function. NWC24iIsMsgObjReadable is exact and committed; all other mailbox trials restored. pf_cache source byte-identical to its MAX start. Spelling/GetElementCount source unchanged. The sole retained engine change is one natural chained table/cursor assignment; the engine remains open, and structural return-copy/conversion differences are not labelled a pure register tie.
MAX final full (non-quick) gate, all three owned units:
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] objdiff: code 4168/47816 data 144/536 functions 5/8 fuzzy 96.6547 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] instruction-exact functions: 5/8
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .data size 392 match None
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sbss2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sdata2 size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .text size 47816 match 96.65468
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: ZiMatchZHSpelling 98.80165
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: zi8InternalGetZH 96.27482
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: Zi8GetElementCount 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] baseline: code 4168/47816 data 144 functions 5 fuzzy 96.4008
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] objdiff: code 10604/10604 data 192/192 functions 25/25 fuzzy 100.0000 linked code 0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] instruction-exact functions: 25/25
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .data size 168 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sbss size 8 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sdata size 16 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .text size 10604 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] baseline: code 10376/10604 data 192 functions 24 fuzzy 99.8491
[libs/RVL_SDK/src/fa/pf_cache] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_cache] objdiff: code 6464/7396 data None/None functions 35/36 fuzzy 99.7755 linked code 0
[libs/RVL_SDK/src/fa/pf_cache] instruction-exact functions: 35/36
[libs/RVL_SDK/src/fa/pf_cache] section .text size 7396 match 99.77555
[libs/RVL_SDK/src/fa/pf_cache] below 100: PFCACHE_DoWriteNumSectorAndFreeIfNeeded 98.21889
[libs/RVL_SDK/src/fa/pf_cache] baseline: code 6464/7396 data None functions 35 fuzzy 99.7755
regressions vs baseline: 0
global matched_code_percent: 90.40604 -> 90.41365
global fuzzy_match_percent: 99.56056 -> 99.56516
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36596 -> 99.36596
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
MAX before -> after, instruction-exact/code/data bytes: zi8cgetc 5/4168/144 -> 5/4168/144 (engine fuzzy 95.99054 -> 96.27482); NWC24MBoxCtrl 24/10376/192 -> 25/10604/192; pf_cache 35/6464/0 -> 35/6464/0 (no data sections). Full GATE PASS, exact DOL SHA1, pools identical, zero regressions and forbidden/readability failures. Owned instruction-exact total 64/69 -> 65/69. Local source commits: 25fabf7b and 93e82b61.
Remaining open functions, with all source attempts exhausted this MAX round: ZiMatchZHSpelling98.80165% (29 register differences); zi8InternalGetZH96.27482% (return copies, missing halfword conversions, allocation); Zi8GetElementCount99.347824% (13 register differences); PFCACHE_DoWriteNumSectorAndFreeIfNeeded98.21889% (9 third-overlap arithmetic/scheduling differences). The correct engine temporary boundaries and paired phonetic-code interface widths remain uncertain. No new symbol rename/extent adjustment or linking investigation was needed.

View File

@@ -0,0 +1,99 @@
# linkgap-audio: eggAudioExpMgr — Equivalent-but-unlinkable analysis
Branch: agent/w1005/linkgap-audio. Unit stays **Equivalent**.
## Status
Per-symbol match is complete: all 8 .text fns + the 0x78 vtable match orig
(fuzzy 100.0 code+data, every fn individually 100). The .o emit set now
matches orig's exactly (see gates below).
**Remaining linker-visible diff: secondary-vt thunk emit order.**
- orig `.text` tail: `[@52@__dt__SimpleAudioMgrWithFx @+1fc][@52@calc__SimpleAudioMgr @+204]`
- mine: `[@52@calc @+1fc][@52@__dt__ @+204]` (swapped)
Both thunks are byte-identical bodies, so objdiff fn-level fuzzy is 100 for
each — but the .o's symbol order carries into the linked DOL, so flipping
Matching fails the DOL hash. This is the *only* blocker.
## Emit-set gates (kept)
`EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS` is defined at the top of
eggAudioExpMgr.cpp and gates these headers (TU-local: other TUs are
unaffected since the macro is only defined in this .cpp):
- `libs/EGG/include/egg/core/eggAudioArcPlayerMgr.h` — 9 ArcPlayer virtuals
(openArchive/openDvd/openNand/setupMemory/close/loadGroup/startSound/
prepareSound/holdSound families) -> non-inline decls for this TU.
- `libs/EGG/include/egg/core/eggAudioHeapMgr.h` — SoundHeapMgr
`loadState`/`getCurrentLevel` -> decls.
- `libs/NW4R/include/nw4r/ut/Lock.h` — `detail::AutoLock<OSMutex>` ct/dt ->
decls.
Without the gates MWCC weak-emits 10 extra inline fns (ArcPlayer
hold/prepare/startSound x9 + NonCopyable/AutoLock/SoundHeap helpers) that
orig's .o does not contain. With gates the emit set is byte-for-byte orig:
same 8 .text syms at the same offsets/sizes + `__vt__` at .data+0x0/0x78.
Residual cosmetic diff (does not affect the link): orig's
`__ct__AudioFxMgrArg` and `SaveState` are STB_GLOBAL; mine STB_WEAK.
Both dedup/resolve identically at link.
## Thunk-order mechanism (decoded)
Surveyed every orig .o with >=2 `@N@` adjustor thunks; my compiler
reproduces orig's order in ALL of them (iplSound, iplGCWindow,
iplMemoryCard, MyTiBg, tiCellPhone, iplBoard, ...) EXCEPT this unit.
Best-fit model for orig's ordering: thunks emit in the order the
*overriding virtuals are declared in the most-derived class*, with
thunks for inherited overrides emitted after the class's own declared
virtuals:
- SimpleAudioMgrWithFx declares `[~dtor, initialize]` -> own dtor thunk
first, then the inherited `SimpleAudioMgr::calc` thunk -> [dt][calc] = orig
- ipl::snd::System declares `calc` before `~System` -> [calc][dt] = orig
- iplMemoryCard `[onTrig,onLeft,onPoint,~dt]` -> that order = orig
(NOT .text def order, which is [onPoint,onLeft,onTrig])
- tiCellPhone `[~dt,updateInput,calc,draw,init]` = orig
My build instead emits thunks in *reverse secondary-vt slot order*
(the .rela.data stream is written backward — observable on every unit;
extraction .os sort relocs so orig's real write order is unknowable).
The two orders coincide for every surveyed unit except this one — it is
the only unit where a derived-declared dtor and an ancestor-declared
override (`SimpleAudioMgr::calc`, declared in the base) disagree.
## What flips it (and why it was vetoed)
Adding ANY second polymorphic class whose vt is built in this TU and
*shares* the secondary base flips the pair to orig's [dt][calc]:
verified with `class Sample : public SimpleAudioMgrWithFx` (emit
`[dt_WithFx][calc][dt_Sample]` — the parent's set comes out in forward
slot order once WithFx's vt is built as a parent). An unrelated
polymorphic class (no shared base) does NOT flip it; a declared-but-
never-defined derived class does NOT flip it (vt never built).
Mechanistically: orig's TU very likely caused WithFx's vt to be built
*as a parent* (a second derived class whose vt anchored elsewhere —
e.g. EGG's real `ipl::snd::System`-style class compiled in another TU
is the only known retail derivee), which emits the parent's thunks in
forward slot order. Any such class is invented here -> owner veto
(not in retail symbols). Orig's .o emits exactly one vtable, so no
second polymorphic class was ODR-emitted in the real TU either — the
trigger lived in code we cannot see (or is a compiler-version artifact).
## Tried and rejected (all still [calc][dt])
- dtor declared after `initialize` in the class decl
- dtor DEFINITION moved before/after ctor in the .cpp
- unrelated polymorphic class (no shared secondary base)
- derived class declared but never defined (no vt build)
## What would close it
A legitimate source construct that causes a second vt-build sharing
the ArcPlayer secondary vtable in this TU, or a linker-level symbol
ordering mechanism (none exists: symbols.txt is label-only, linker lays
out .text in .o symbol order). Until then: Equivalent.

View File

@@ -0,0 +1,31 @@
## WADBackupEx decode (this leaf session)
- file_done region: orig CFG has inner `goto file_done` edges landing PAST a `flags[2]==1`
check (goto-specialized entries). Faithful source = label inside the flags-if:
`if (hdr->flags[2]==1) { file_done: if (fileOpened) NANDClose(&savedFile); }`.
Orig folds the outer if to a dead lbz+cmplwi fossil (no bne) via edge-prop that
fileOpened==0 on the flags!=1 path; our MWCC emits the bne (+4B).
- result=0 at file-loop head: orig keeps ZERO in dedicated callee reg (r31);
ours spills an extra zero to stack slot (extra stw+lwz). keep-vs-remat wall.
- Several base+offset addi folds (0x340+8 vs 0x348 etc.) = documented fold family.
- GetBlocks vestigial NULL ptr locals + conditional frees = orig-faithful decode (solved).
- DVDExForBS `if (header.contentSize != 0)` dead-check fossil = conditional-assign
overwritten by later unconditional assign (solved).
## WADBackupEx decode round 2 (fossil + ptr web)
- Dead-compare fossil SOLVED: `if (A) { X = v; } ... X = v;` — conditional assign whose
store is killed by a later unconditional assign → MWCC keeps lbz+cmplwi, drops bne.
Applied: `if (flags[2]==1) { fileFd = -1; } if (fileOpened) NANDClose; fileFd = -1;`
reproduces orig's exact `lbz;cmplwi;lwz;cmpwi;beq` sequence (-8B wall gone).
- file_done label placement: label sits BEFORE the flags-if (inner gotos land past it,
outer bne/beq edges land on it) — `file_done:` above the fossil if.
- result=0 redundant-store dedup inside `if (path==0)` arm: orig omits it (already 0).
- &headerBlock member-address chains: orig emits `addi r3,r1,0x340; addi r3,r3,+off`
(remat base + member offset) for deviceId/cidx/deviceMac args. Best source form =
`WADBackupHeader* headerBlockHeader = &headerBlock.header` used for the three
member args → `addi r3,r18,+off` (structurally right; r18-kept vs orig remat =
keep-vs-remat wall). `(&x)->y` and `x.y` fold to absolute; per-site ptr assigns
fold remat+offset — all worse.
- Remaining diffs (all documented keep-vs-remat/web-coloring): `li 0;stw` vs `li;mr`
for result head store, `addi r1,0x340` remats vs r18/mr, stw 0x814/lwz 0x80c spill
webs, `li -1` fileFd slot, addi+0x80 loop-IV position, `addi r1,0x3c0` remat order.