Compare commits

...

5 Commits

Author SHA1 Message Date
devin
9e76cabe2f decomp(CDBRecord): dead-fn literal fossils + Encrypt 284/284 insn-equal
Restores ~15 link-deadstripped retail fns whose emitted .data fossil
literals exist in the orig object; DOL-verified byte-identical at the
expected vaddrs. CDBRecordEncrypt auto-inlines dead CDBRecordGetFileSize:
284/284 instructions identical. Unit stays NonMatching: Encrypt's 57-byte
residual is an equal-cost register-packing tie-break (18 source probes
documented in tools/decomp-assist/CDBRecord.attempts.md).

Co-authored-by: coah80 <usernamecole7@gmail.com>
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 21:22:36 +00:00
coah
449529d924 match(KPAD 25/29) (fz16j) (worker fe716b2a) (#959) 2026-10-02 16:10:06 -05:00
coah
8a07484e8a link(vi) (worker 5b1f07ee) (#957) 2026-10-02 16:07:02 -05:00
coah
2d3bc63c09 match(vi 30/30) (prior1, prior-art ref) (worker 999cdc11) (#956) 2026-10-02 16:04:28 -05:00
coah
3efb9d8676 match(iqdec_b65): port sibling semantics for decode_iquant (30→13 reg) (#955)
Port decode_iquant_rc-style table access / load_buff / conv_row patterns
into TMCJPEGDEC_decode_iquant. Cuts reg-only diffs 30→13 (276/276,
structural 0). Remaining wall is AC huff/zztbl/zz callee-saved
permutation (r29/r30/r24/r25 vs r25/r24/r29/r30).
2026-10-02 16:02:45 -05:00
10 changed files with 1178 additions and 96 deletions

View File

@@ -53,9 +53,9 @@ Progress
<!-- progress:start -->
| Decompiled | Matched | Linked | Data |
|:---:|:---:|:---:|:---:|
| 99.59% | 91.06% | 74.02% | 99.42% |
| 99.59% | 91.12% | 74.40% | 99.42% |
units 962/1027 complete, functions 12374/12563 matched.
units 963/1027 complete, functions 12376/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

@@ -1388,7 +1388,7 @@ config.libs = [
]
),
RVLSDKLib("vi", [
Object(NonMatching, "vi/vi.c"),
Object(Matching, "vi/vi.c"),
Object(Matching, "vi/i2c.c"),
Object(Matching, "vi/vi3in1.c"),
]

View File

@@ -15,55 +15,8 @@ static void readHuffmanLimit(const TMCHuffmanEntry* entries, TMCHuffmanEntry* li
limit->symbol = entries->symbol;
}
static inline s32 decodeLongHuffman(s32 bitCount, const TMCHuffmanEntry* table, const u8* symbols, TMCCJPEGDecWork* work, TMCHuffmanEntry* limit, TMCHuffmanEntry* decoded) {
u32 bitData;
u32 code;
u32 length;
const TMCHuffmanEntry* entry;
if (bitCount <= 17) {
s32 result = TMCJPEGDEC_load_buff(work);
if (result < 0) {
return result;
}
}
bitCount = work->bitCount;
bitData = work->bitBuf;
bitCount -= 9;
code = (bitData >> bitCount) & 0x1FF;
work->bitCount = bitCount;
length = 9;
entry = table + 9;
goto read_entry;
while (1) {
length++;
entry++;
if (length > 16) {
return TMCC_ERROR_OVERFLOW;
}
bitCount = work->bitCount;
code <<= 1;
bitData = work->bitBuf;
bitCount--;
work->bitCount = bitCount;
code |= (bitData >> bitCount) & 1;
read_entry:
{
readHuffmanLimit(entry, limit);
*decoded = *limit;
if (code > (u32)decoded->bitLength) {
continue;
}
{
u32 relativeCode = code - entry->bitLength;
u32 symbolIndex = relativeCode + entry->symbol;
return symbols[symbolIndex & 0xFF];
}
}
}
}
static inline s32 decodeACHuffman(s32 bitCount, const TMCHuffmanEntry* entry, const u8* symbols, TMCCJPEGDecWork* work, TMCHuffmanEntry* limit, TMCHuffmanEntry* decoded) {
static inline s32 decodeLongHuffman(s32 bitCount, u32* huff_tbl, u8* symbols, TMCCJPEGDecWork* work, TMCHuffmanEntry* limit, TMCHuffmanEntry* decoded) {
u16* entry;
u32 bitData;
u32 code;
u32 length;
@@ -75,16 +28,16 @@ static inline s32 decodeACHuffman(s32 bitCount, const TMCHuffmanEntry* entry, co
}
}
bitCount = work->bitCount;
entry = (u16*)(huff_tbl + 9);
bitData = work->bitBuf;
length = 9;
bitCount -= 9;
code = (bitData >> bitCount) & 0x1FF;
work->bitCount = bitCount;
length = 9;
entry += 9;
goto read_entry;
while (1) {
length++;
entry++;
entry += 2;
if (length > 16) {
return TMCC_ERROR_OVERFLOW;
}
@@ -96,20 +49,71 @@ static inline s32 decodeACHuffman(s32 bitCount, const TMCHuffmanEntry* entry, co
code |= (bitData >> bitCount) & 1;
read_entry:
{
readHuffmanLimit(entry, limit);
limit->bitLength = entry[0];
limit->symbol = entry[1];
*decoded = *limit;
if (code > (u32)decoded->bitLength) {
continue;
}
{
u32 relativeCode = code - entry->bitLength;
u32 symbolIndex = relativeCode + entry->symbol;
u32 relativeCode = code - limit->bitLength;
u32 symbolIndex = relativeCode + limit->symbol;
return symbols[symbolIndex & 0xFF];
}
}
}
}
static inline s32 decodeACHuffman(s32 bitCount, u32* huff_tbl, u8* symbols, TMCCJPEGDecWork* work, TMCHuffmanEntry* limit, TMCHuffmanEntry* decoded) {
u16* entry;
u32 bitData;
u32 code;
u32 length;
if (bitCount <= 17) {
s32 result = TMCJPEGDEC_load_buff(work);
if (result < 0) {
return result;
}
}
bitCount = work->bitCount;
entry = (u16*)(huff_tbl + 9);
bitData = work->bitBuf;
length = 9;
bitCount -= 9;
code = (bitData >> bitCount) & 0x1FF;
work->bitCount = bitCount;
goto read_entry;
while (1) {
length++;
entry += 2;
if (length > 16) {
return TMCC_ERROR_OVERFLOW;
}
bitCount = work->bitCount;
code <<= 1;
bitData = work->bitBuf;
bitCount--;
work->bitCount = bitCount;
code |= (bitData >> bitCount) & 1;
read_entry:
{
limit->bitLength = entry[0];
limit->symbol = entry[1];
*decoded = *limit;
if (code > (u32)decoded->bitLength) {
continue;
}
{
u32 relativeCode = code - limit->bitLength;
u32 symbolIndex = relativeCode + limit->symbol;
return symbols[symbolIndex & 0xFF];
}
}
}
}
s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_ptr, TMCCJPEGDecWork* work) {
TMCHuffmanEntry dcEntry;
TMCHuffmanEntry dcDecoded;
@@ -117,7 +121,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
TMCHuffmanEntry acDecoded;
TMCHuffmanEntry acLimit;
u8* huff_sym;
const TMCHuffmanEntry* ac_fast;
u16* ac_fast;
s32 idx;
u32* huff_tbl;
s32 bit_pos;
@@ -130,11 +134,13 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
s32 t;
s32 zz;
s32 q;
const TMCHuffmanEntry* dc_fast;
u16* dc_fast;
const u8* zztbl;
s32* conv_row;
conv_row = (s32*)conv_row_ptr;
bit_pos = work->bitCount;
dc_fast = (const TMCHuffmanEntry*)work->pDCFast;
dc_fast = work->pDCFast;
if (bit_pos <= 8) {
r = TMCJPEGDEC_load_buff(work);
@@ -146,7 +152,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
bit_pos = work->bitCount;
bit_data = work->bitBuf;
{
dcEntry = readHuffmanEntry(dc_fast, (bit_data >> (bit_pos - 8)) & 0xFF);
dcEntry = readHuffmanEntry((const TMCHuffmanEntry*)dc_fast, (bit_data >> (bit_pos - 8)) & 0xFF);
r = dcEntry.bitLength;
extra = dcEntry.symbol;
}
@@ -157,30 +163,28 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
} else {
huff_sym = work->pDCHuffSym;
huff_tbl = work->pDCHuffTbl;
r = decodeLongHuffman(bit_pos, (const TMCHuffmanEntry*)huff_tbl, huff_sym, work, &dcLimit, &dcDecoded);
r = decodeLongHuffman(bit_pos, huff_tbl, huff_sym, work, &dcLimit, &dcDecoded);
if (r < 0) {
return r;
}
}
blk0 = ((s32*)conv_row_ptr)[0];
blk0 = conv_row[0];
if (r != 0) {
bit_pos = work->bitCount;
if (bit_pos <= r) {
s32 load_ret = TMCJPEGDEC_load_buff(work);
if (load_ret < 0) {
if (work->bitCount <= r) {
s32 load_ret;
if (load_ret = TMCJPEGDEC_load_buff(work), load_ret < 0) {
return load_ret;
}
}
bit_pos = work->bitCount;
bit_data = work->bitBuf;
tmp = 1 << r;
extra = tmp - 1;
bit_pos -= r;
tmp = 1UL << r;
bit_pos = work->bitCount - r;
work->bitCount = bit_pos;
bit_data = work->bitBuf;
extra = tmp - 1;
extra = extra & (bit_data >> bit_pos);
if (((s32)tmp >> 1) > extra) {
extra -= tmp - 1;
extra -= (tmp - 1);
}
dc_predict_row_ptr[0] += extra;
}
@@ -188,7 +192,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
*block = dc_predict_row_ptr[0] * blk0;
{
ac_fast = (const TMCHuffmanEntry*)work->pACFast;
ac_fast = work->pACFast;
huff_tbl = work->pACHuffTbl;
huff_sym = work->pACHuffSym;
@@ -206,7 +210,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
zztbl = TMCJPEGDEC_Zigzag_data;
bit_data = work->bitBuf;
t = bit_pos - 8;
acEntry = readHuffmanEntry(ac_fast, (bit_data >> t) & 0xFF);
acEntry = readHuffmanEntry((const TMCHuffmanEntry*)ac_fast, (bit_data >> t) & 0xFF);
do {
s32 ac_thresh = acEntry.bitLength;
@@ -217,7 +221,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
r = acEntry.symbol;
} else {
bit_pos = work->bitCount;
r = decodeACHuffman(bit_pos, (const TMCHuffmanEntry*)huff_tbl, huff_sym, work, &acLimit, &acDecoded);
r = decodeACHuffman(bit_pos, huff_tbl, huff_sym, work, &acLimit, &acDecoded);
if (r < 0) {
return r;
}
@@ -241,19 +245,18 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
return r;
}
}
bit_pos = work->bitCount;
tmp = 1 << t;
tmp = 1UL << t;
bit_pos = work->bitCount - t;
work->bitCount = bit_pos;
bit_data = work->bitBuf;
extra = tmp - 1;
bit_pos -= t;
work->bitCount = bit_pos;
t = bit_pos - 8;
extra = extra & (bit_data >> bit_pos);
q = ((s32*)conv_row_ptr)[(u8)zz];
acEntry = readHuffmanEntry(ac_fast, (bit_data >> t) & 0xFF);
t = bit_pos - 8;
q = conv_row[(u8)zz];
acEntry = readHuffmanEntry((const TMCHuffmanEntry*)ac_fast, (bit_data >> t) & 0xFF);
if (((s32)tmp >> 1) > extra) {
extra -= tmp - 1;
extra -= (tmp - 1);
}
block[(u8)zz] = extra * q;
@@ -274,7 +277,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
bit_pos = work->bitCount;
t = bit_pos - 8;
tmp = ((bit_data >> t) & 0xFF) << 2;
acEntry = readHuffmanEntry(ac_fast, tmp >> 2);
acEntry = readHuffmanEntry((const TMCHuffmanEntry*)ac_fast, tmp >> 2);
idx += 16;
}

View File

@@ -370,24 +370,24 @@ void KPADGetProjectionPos(Vec2* dest, Vec2* src, const Rect* rect, f32 scale) {
void KPADSetSensorHeight(s32 chan, f32 sensorHeight) {
KPADInside* kpad;
f32 halfHeightSquared;
f32 halfHeight;
f32 barOffsetX;
f32 barDiagonal;
f32 halfWidthSquared;
f32 halfWidth;
f32 negativeSensorHeight;
f32 barDiagonalSquared;
f32 halfHeightSquared;
f32 zero;
halfWidth = 1.0f;
kpad = &inside_kpads[chan];
kpad = chan + inside_kpads;
halfHeight = 0.75f;
negativeSensorHeight = -sensorHeight;
halfWidthSquared = halfWidth * halfWidth;
halfHeightSquared = halfHeight * halfHeight;
kpad->sensorBarCenter.x = 0.0f;
zero = 0.0f;
kpad->sensorBarCenter.x = zero;
kpad->sensorBarCenter.y = negativeSensorHeight;
barDiagonalSquared = halfWidthSquared + halfHeightSquared;
barDiagonal = (f32)sqrt(barDiagonalSquared);
barDiagonal = (f32)sqrt(halfWidthSquared + halfHeightSquared);
barOffsetX = kpad->sensorBarCenter.x;
if (barOffsetX < 0.0f) {
halfWidth += barOffsetX;

View File

@@ -580,7 +580,7 @@ void VIInit(void)
u16 displayConfig;
u32 __VIDVDStopFlag_Enable_old;
s32 format;
u32 value;
u16 value;
u32 tv;
u32 bootromTv;

View File

@@ -393,6 +393,67 @@ CDBErr CDBRecordGetDataSize(CDBRecord* record, u32* size) {
return err;
}
CDBErr CDBRecordReduceFileSize(CDBRecord* record, u32 newFileSize) {
CDBRecordFile* recordFile;
CDBErr err;
u32 fileSize;
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't reduce file size of the record ; the record is closed\n");
return CDB_ERROR_27;
}
if ((recordFile->allocFlag & 2) == 0) {
CDBReportError("can't reduce file size of the record ; the record is opened as READONLY\n");
return CDB_ERROR_27;
}
CDBAttrGetFileSize(&recordFile->attr, &fileSize);
if (newFileSize > fileSize) {
CDBReportError("can't reduce file size of the record ; file size must be over %d bytes\n", fileSize);
return CDB_ERROR_26;
}
CDBAttrSetFileSize(&recordFile->attr, newFileSize);
recordFile->attr.dirty = TRUE;
err = CDBRecordFileWriteAttrBuf(record);
if (err != CDB_ERROR_OK) {
return err;
}
return CDB_ERROR_OK;
}
CDBErr CDBRecordReduceDataSize(CDBRecord* record, u32 newDataSize) {
CDBRecordFile* recordFile;
CDBErr err = CDB_ERROR_OK;
u32 dataSize;
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't reduce data size of the record ; the record is closed\n");
return CDB_ERROR_27;
}
if ((recordFile->allocFlag & 2) == 0) {
CDBReportError("can't reduce data size of the record ; the record is opened as READONLY\n");
return CDB_ERROR_27;
}
if (!CDBRecordBelongedDBOpenedAsRW(record)) {
CDBReportError("can't reduce data size of the record; permission denied\n");
return CDB_ERROR_ACCESS_DENIED;
}
err = CDBRecordFileGetDataSize(record, &dataSize);
if (err != CDB_ERROR_OK) {
return err;
}
if (newDataSize < dataSize) {
CDBAttrSetFileSize(&recordFile->attr, newDataSize);
recordFile->attr.dirty = TRUE;
}
err = CDBRecordFileWriteAttrBuf(record);
if (err != CDB_ERROR_OK) {
return err;
}
return CDB_ERROR_OK;
}
CDBErr CDBRecordRemove(CDBRecord* record) {
CDBErr err;
CDBLock();
@@ -430,6 +491,50 @@ void CDBRecordGetTypeForce(CDBRecord* record, char* type) {
CDBUnlock();
}
CDBErr CDBRecordSetFileType(CDBRecord* record, const char* fileType) {
CDBRecordDatabaseState* instance;
CDBRecordFile* recordFile;
CDBErr err;
instance = ((CDBDatabase*)record->database)->instance;
recordFile = record->file;
if ((instance->openFlags & 2) == 0) {
CDBReportError("can't set file type of the record; the database is opened as READONLY\n");
return CDB_ERROR_26;
}
if (recordFile == NULL) {
CDBReportError("can't set file type of the record ; the record is closed\n");
return CDB_ERROR_27;
}
if ((recordFile->allocFlag & 2) == 0) {
CDBReportError("can't set file type of the record ; the record is opened as READONLY\n");
return CDB_ERROR_27;
}
if (record->key.location != CDB_FS_LOCATION_NAND) {
CDBReportError("can't set file type of the record ; the record must exsist on NAND\n");
return CDB_ERROR_26;
}
CDBLock();
strcpy(CDBKeyStrType(record->key.keyString), fileType);
CDBAttrSetKeyStr(&recordFile->attr, &record->key);
err = CDBRecordFileWriteAttrBuf(record);
CDBUnlock();
return err;
}
CDBErr CDBRecordGetFileType(CDBRecord* record, char* fileType) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get file type of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBConvKeyStrToType(record->key.keyString, fileType);
}
CDBUnlock();
return err;
}
void CDBRecordGetGameCodeForce(CDBRecord* record, char* gameCode) {
u32 value;
CDBLock();
@@ -438,12 +543,122 @@ void CDBRecordGetGameCodeForce(CDBRecord* record, char* gameCode) {
CDBUnlock();
}
CDBErr CDBRecordGetGameCode(CDBRecord* record, u32* gameCode) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get game code of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBConvKeyStrToGameCode(record->key.keyString, gameCode);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetMakerCode(CDBRecord* record, u32* makerCode) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get maker code of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBConvKeyStrToMakerCode(record->key.keyString, makerCode);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetModifiedTime(CDBRecord* record, u32* modifiedTime) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get modified time of the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
*modifiedTime = ((CDBRecordFile*)record->file)->attr.buf.lastModifiedDate;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetModifiedCount(CDBRecord* record, u32* modifiedCount) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get modified count of the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBAttrGetModifiedCount(&((CDBRecordFile*)record->file)->attr, modifiedCount);
}
CDBUnlock();
return err;
}
void CDBRecordGetKeyForce(CDBRecord* record, CDBRecordKey* key) {
CDBLock();
CDBRecordKeyCopy(key, &record->key);
CDBUnlock();
}
CDBErr CDBRecordSetName(CDBRecord* record, const char* name, const char* keyword) {
CDBRecordDatabaseState* instance;
CDBRecordFile* recordFile;
CDBErr err;
instance = ((CDBDatabase*)record->database)->instance;
recordFile = record->file;
if ((instance->openFlags & 2) == 0) {
CDBReportError("can't set a name of the record; the database is opened as READONLY\n");
return CDB_ERROR_26;
}
if (!CDBRecordBelongedDBOpenedAsRW(record)) {
CDBReportError("can't add keyword to the record; permission denied\n");
return CDB_ERROR_ACCESS_DENIED;
}
if (recordFile == NULL) {
CDBReportError("can't set a name of the record; the record is closed\n");
return CDB_ERROR_27;
}
if ((recordFile->allocFlag & 2) == 0) {
CDBReportError("can't set a name of the record; the record is opened as READONLY\n");
return CDB_ERROR_27;
}
CDBLock();
strncpy(recordFile->attr.buf.desc, name, CDB_ATTR_BUF_MAX_DESC_LEN);
recordFile->attr.buf.descLength = strlen(name);
recordFile->attr.dirty = TRUE;
err = CDBRecordFileWriteAttrBuf(record);
CDBUnlock();
return err;
}
CDBErr CDBRecordGetKeyword(CDBRecord* record, char* keyword) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get keyword from the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
strcpy(keyword, ((CDBRecordFile*)record->file)->attr.buf.desc);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetKey(CDBRecord* record, CDBRecordKey* key) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get key from the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBRecordKeyCopy(key, &record->key);
}
CDBUnlock();
return err;
}
void CDBRecordGetCalendarTimeForce(CDBRecord* record, int* year, int* month, int* day, int* hour, int* min, int* sec) {
char epochString[64];
CDBDate epoch;
@@ -454,6 +669,23 @@ void CDBRecordGetCalendarTimeForce(CDBRecord* record, int* year, int* month, int
CDBUnlock();
}
CDBErr CDBRecordGetCalendarTime(CDBRecord* record, int* year, int* month, int* day, int* hour, int* min, int* sec) {
char epochString[64];
CDBDate epoch;
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get calender time from the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBConvKeyStrToEpochStr(record->key.keyString, epochString);
CDBConvEpochStrToEpochValue(epochString, &epoch);
CDBConvEpochValueToDate(epoch, year, month, day, hour, min, sec);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetId(CDBRecord* record, CDBId* id) {
CDBErr err = CDB_ERROR_OK;
CDBRecordFile* recordFile;
@@ -532,6 +764,27 @@ CDBErr CDBRecordUpdateModifiedDate(CDBRecord* record) {
return CDB_ERROR_OK;
}
CDBErr CDBRecordDuplicate(CDBRecord* record, CDBRecord* newRecord) {
CDBRecordFile* recordFile;
CDBErr err;
if (record->key.location != CDB_FS_LOCATION_NAND && record->key.location != CDB_FS_LOCATION_SD) {
OSPanic(__FILE__, __LINE__, "CDBRecordDuplicate invalud location\n");
return CDB_ERROR_1;
}
recordFile = record->file;
if (recordFile == NULL) {
return CDB_ERROR_27;
}
CDBLock();
CDBRecordKeyCopy(&newRecord->key, &record->key);
newRecord->file = NULL;
newRecord->database = record->database;
err = CDBRecordFileCreateBlank(newRecord);
CDBUnlock();
return err;
}
CDBErr CDBRecordBackupToSD(CDBRecord* record) {
CDBErr err;
CDBLock();
@@ -695,8 +948,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
}
{
CDBErr result;
CDBRecordFile* tempFile;
tempFile = record->file;
CDBRecordFile* tempFile = record->file;
if ((s32)tempFile == 0) {
result = CDB_ERROR_27;
} else if (tempFile->allocFlag == 1) {
@@ -825,7 +1077,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
CDBErr CDBRecordDecrypt(CDBRecord* record, void* buffer, u32 size, u32* dataSize, CDBRecordKey* key) {
CDBErr status;
int fileOffset;
s32 fileOffset;
CDBRecordFile* recordFile;
u32 fileDataSize;
u32 fileSize;
@@ -960,3 +1212,32 @@ CDBErr CDBRecordDecrypt(CDBRecord* record, void* buffer, u32 size, u32* dataSize
}
return CDB_ERROR_OK;
}
CDBErr CDBRecordPrivateChangeOwner(CDBRecord* record, u64 newWiiId) {
CDBRecordFile* recordFile;
char fullPath[256];
char newPath[256];
CDBErr err;
u64 preWiiId;
u64 recordWiiId;
CDBReportError("CDBRecordPrivateChangeOwner\n");
recordFile = record->file;
if (recordFile == NULL) {
return CDB_ERROR_27;
}
preWiiId = CDBGetWiiId();
recordWiiId = record->key.wiiId;
OSReport(" i_pre-wiiid = %lX\n", preWiiId);
OSReport(" record-wiiid = %lX\n", recordWiiId);
CDBConvKeyToFullPath(&record->key, fullPath);
record->key.wiiId = newWiiId;
CDBConvKeyToFullPath(&record->key, newPath);
OSReport("path =%s\n", fullPath);
OSReport("path2=%s\n", newPath);
CDBLock();
err = CDBAttrSetWiiId(&recordFile->attr, newWiiId);
CDBUnlock();
return err;
}

View File

@@ -29,3 +29,26 @@ Additional Decrypt correction: restored 0x3E800 size limit, actual seek/read err
Remaining: CDBCryptBuffer 99.97479%, 119/119 instructions, three pool offsets; CDBRecordEncrypt 97.19014%, register allocation and one instruction; CDBRecordDecrypt 99.96789%, stack placement.
The four forced field accessors end with CDBUnlock and do not produce a CDBErr result. Their void declarations are gated by CDB_RECORD_IMPLEMENTATION, preserving all other translation units and avoiding fall-through non-void definitions.
## w1008/cdb leaf — dead-fn fossil + Encrypt coloring (worker w1008)
SOLVED — link-deadstrip fossil mechanism: orig .data's fossil literals (0x398-0x9be)
come from ~15 dead functions whose code mwldeppc stripped at link. Added all dead
fns (CDBRecordGetFileSize through CDBRecordPrivateChangeOwner) as GLOBAL fns in
fossil-emission order; global (not static) emits standalone code AND auto-inlines
at use sites. .data content byte-identical (orig has 2B reconstruction tail pad).
Verified at DOL level: fossil strings land at exact expected vaddrs.
SOLVED — Encrypt +0x40 code gap: `err = CDBRecordGetFileSize(record, &fileSize)`
calls the dead fn which auto-inlines, reproducing orig's expanded block.
`(s32)ptr == 0` → `cmpwi r0,0` required (== NULL gives cmplw). 284/284 insns
identical, 0 stream diffs.
WALL — CDBRecordEncrypt 57 byte diffs, pure callee-reg coloring on identical
web structure. Orig packs {key+err}→r24, {tempFile+fileOffset}→r31, pool→r25,
args→r26-29; mine packs {tempFile+err}→r24, {key+fileOffset}→r29, pool→r31,
args→r25-28. Equal-cost packings (tie-break). ~18 probes all neutral/regressed:
recordFile/err/tempFile/fileOffset decl order+scope+init forms, per-block vs
shared `result`, single-web fileOffset (-69), fn-scope tempFile, `register`,
err dead-init (emits, +4B/831), u32/s32 types, decl+init forms.
DOL-verified: the entire DOL diff vs orig = exactly these 57 bytes.

View File

@@ -0,0 +1,75 @@
# iqdec_b65_frv32 / TMCJPEGDEC_decode_iquant (worker1)
Worktree: `/workspace/worktrees/iqdec-b65-worker1`
Branch: `agent/grok/decomp-worker-1/iqdec_b65`
## Scores
| State | Insns | Diffs | Notes |
|---|---|---|---|
| main baseline | 276/276 | **30** reg-only | entry/DC extract + AC coloring |
| this PR (sibling semantics) | 276/276 | **13** reg-only | structural 0 |
| target wall | 276/276 | 13 | AC huff/zztbl/zz permutation |
## Sibling semantics ported (from matching `decode_iquant_rc` C reference under `#else`)
- `u16*` fast indexing in `decodeLongHuffman` / `decodeACHuffman` (`entry = (u16*)(huff_tbl+9)`, `entry += 2`, `limit->bitLength = entry[0]`)
- comma-op `load_buff`: `if (load_ret = TMCJPEGDEC_load_buff(work), load_ret < 0)`
- early `s32* conv_row = (s32*)conv_row_ptr`
- `1UL << r/t`, `extra -= (tmp - 1)` paren form
- bitCount update before bitBuf read on DC/AC extract
These fixed the 17 non-AC diffs (30→13).
## Remaining wall (13 reg-only)
Permutation of 4 callee-saved across AC setup:
| Value | Ours | Target |
|---|---|---|
| `huff_tbl` (pACHuffTbl) | r29 | **r25** |
| `huff_sym` (pACHuffSym) | r30 | **r24** |
| `zztbl` | r24 | **r29** |
| `zz` | r25 | **r30** |
Cascaded: `tmp-1` in r7 vs r6; `zz<<2` index in r6 vs r7.
Insns 0–114 (through `ac_fast` load) are byte-identical. Divergence starts at AC huff loads (115–116).
## Coloring levers tried (≥12) — none beat 13
1. Separate AC-block `ac_huff_tbl`/`ac_huff_sym` → 32 (DC shifted)
2. DC-only block-local huff → 46 (prologue shifted)
3. Fully scoped DC/AC huff (no top-level) → 32
4. Early `zztbl` at function start → 138 (schedule)
5. `zztbl` before huff (before memset) → 32 (schedule)
6. Swap AC huff_tbl/huff_sym assign order → 13 (swapped wrong load order)
7. Swap DC huff assign order → build fail / unrestored
8. Decl reorder huff near zztbl → 17 (DC shifted)
9. `u8 zz` → 36
10. `u32 zz` → 13 (no change)
11. Move `zz = zztbl[idx]` after `load_buff` → 100
12. Eliminate `zz` temp (double `zztbl[idx]`) → 100
13. Huff before `ac_fast` → 14
14. Split `r` into `dc_r` + `r` → 13
15. Null-kill `huff_*=0` before AC reassign → 13
16. DC passes `work->pDCHuff*` directly → 30
17. Sibling decl order + `ac_vl`/`ac_sym` → 96
18. Scope DC HuffmanEntry temps → 33
19. Dummy pad locals → 13
20. Sibling `*(s32*)((u8*)block + zz*4)` store form → 13
21. `zztbl` first in decl list → 36
22. Coalesce huff_tbl via reassigning `dc_fast` → 36
23. `u32 idx` → 33
24. `s16 idx` → build fail
25. `unsigned long tmp` → 30
26. AC huff via `work->` at call only (no AC locals) → 120
27. Nested temp copies into huff_* → 32
28. `u8* zztbl` non-const → 13
29. **declsearch** 80 evals on decls 118–139 → best still (0, 13)
Root cause: `huff_sym`/`huff_tbl` keep DC-path preferred colors (r29/…) when reassigned for AC; target recycles freed `r24` (dc_predict) / `r25` (dc `r`) for AC huff and pushes `zztbl`/`zz` high. Any split of DC/AC names reshuffles the already-matching DC body.
## Recommendation
Need a shape that keeps DC 0–114 identical **and** births AC huff into r25/r24 (e.g. true live-range split / coalescing onto freed dc_predict/r without extra locals that raise pressure). Sibling `#else` C uses separate `ac_vl`/`ac_sym` and never shares DC huff locals — porting that cleanly without DC regen is the open problem.

View File

@@ -2060,3 +2060,243 @@ Final full-gate authority lines:
GATE PASS
```
Gate-passing source commits: 459cc944 (projection), 021a0466 (single-object scan), b7d4457c (acceleration horizon). Final clean build retains all3 exact matches and every previous exact function. Only libs/RVL_SDK/src/kpad/KPAD.c and this attempts log changed.
## Round10 MAX continuation baseline and acceptance gates
Fresh source baseline d78210528f882407ff363d4a112114670a216ce3. Read AGENTS.md; no subagents or remote writes. Pools first: SDK identical0 strings, SD identical101, Address identical57. Source trials must preserve pool and prior exact functions; only instruction-exact plus exact-name objdiff100 candidates may be retained/committed after all-unit quick gate. Final clean all-unit gate and three successfully built distinct source attempts per remaining function required. Failed compilations excluded.
libs/RVL_SDK/src/kpad/KPAD baseline {"fuzzy_match_percent": 98.81893, "total_code": "13056", "matched_code": "7672", "matched_code_percent": 58.762253, "total_data": "8032", "matched_data": "8032", "matched_data_percent": 100.0, "total_functions": 29, "matched_functions": 24, "matched_functions_percent": 82.75862, "total_units": 1}
src/scene/sdChannelSelect/iplSDChannelSelect baseline {"fuzzy_match_percent": 99.582596, "total_code": "33828", "matched_code": "29412", "matched_code_percent": 86.945724, "total_data": "2960", "matched_data": "2960", "matched_data_percent": 100.0, "total_functions": 129, "matched_functions": 122, "matched_functions_percent": 94.57364, "total_units": 1}
src/scene/address/iplAddressEdit baseline {"fuzzy_match_percent": 99.52479, "total_code": "27112", "matched_code": "23044", "matched_code_percent": 84.995575, "total_data": "2560", "matched_data": "2560", "matched_data_percent": 100.0, "total_functions": 94, "matched_functions": 90, "matched_functions_percent": 95.74468, "total_units": 1}
## libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (0, 7) structural/positional differences; instructions 52/52
Remote source equals freshly built baseline; still open 99.23077%. Structural diagnosis: Target/ours 52 instructions and frame0x30; width/height squared and zero local lifetime differ in four floating colors and array-base uses r4 instead of target r3 in three instructions. No branch or arithmetic difference. Build genuine shorter squared/negative-height lifetimes and readonly pointer definitions before register-only search; original target PSQ decoded and ctxdiff recorded.
- compute the two real squared dimensions directly in the diagonal sum: (0, 3) structural/positional; instructions 52/52; restored.
- negate sensor height directly in its real center-field store: (1, 14) structural/positional; instructions 52/52; restored.
Trial harness diagonal-sum transform omitted its Python return; aborted before writing source, corrected, not counted as a source attempt. Remote dependency audit d7821052->26d7e1e0: only configure.py switches unrelated already-matched wprintf to Matching; owned source, headers and symbol definitions unchanged.
## libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (0, 7) structural/positional differences; instructions 52/52
Remote source equals freshly built baseline; still open 99.23077%. Structural diagnosis: Target/ours 52 instructions and frame0x30; width/height squared and zero local lifetime differ in four floating colors and array-base uses r4 instead of target r3 in three instructions. No branch or arithmetic difference. Build genuine shorter squared/negative-height lifetimes and readonly pointer definitions before register-only search; original target PSQ decoded and ctxdiff recorded.
- inline only the real diagonal sum into sqrt: (0, 0) structural/positional; instructions 52/52; candidate kept.
## Round10 exact sensor-height candidate and gate
KPADSetSensorHeight: target has the diagonal sum as an anonymous sqrt input; named-zero/squared-height order plus removal of the real diagonal-sum local makes the array-base register reuse match as well. 52/52 instructions, frame0x30, ctxdiff0, exact-name objdiff100.0%; pool identical. All-unit quick gate GATE PASS, correct DOL SHA1,0 regressions/forbidden/readability warnings. SDK24->25/29; code7672->7880/13056; data8032/8032 unchanged. SD122/129 and Address90/94 unchanged. Only the exact SDK function and attempts log changed; no headers or data-symbol edits.
## libs/RVL_SDK/src/kpad/KPAD read_kpad_acc
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (16, 66) structural/positional differences; instructions 400/400
Remote source equals freshly built baseline; still open 98.15%. Structural diagnosis: 400/400 frame0x50; smoothing magnitude/delta boundaries and split error/device guards reduce the old mismatch to a single final switch cmpwi5 versus target cmplwi5. Try unsigned relational guards and branch-to-accepted loop forms on that complete readable reconstruction, preserving all unsupported-format returns.
- bound the valid fallback format with unsigned relational guards: (10, 195) structural/positional; instructions 401/400; restored.
- dispatch each accepted format through a single-pass loop with two break arms: (10, 194) structural/positional; instructions 399/400; restored.
- use a looping fallback switch whose accepted arm exits the loop: (15, 198) structural/positional; instructions 401/400; restored.
- write the primary and fallback cases as exclusive unsigned bounds: (11, 200) structural/positional; instructions 402/400; restored.
- handle the fallback format in a one-case switch followed by a primary-format guard: (13, 196) structural/positional; instructions 399/400; restored.
## libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (14, 45) structural/positional differences; instructions 250/250
Remote source equals freshly built baseline; still open 94.82%. Structural diagnosis: 250/250 frame0x20; target distance weight is updated in place and late geometry coalesces direction products through their sums. Test real Vec2 rotation/midpoint boundaries, anonymous rotation or midpoint values, and direct normal-component input lifetimes before declaration search. Retain original operation grouping and every object-field write.
- hold the true dot/cross rotation in a Vec2 local: build failed lang=c -MMD -c libs/RVL_SDK/src/kpad/KPAD.c -o build/43U/src/libs/RVL_SDK/src/kpad && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\kpad\KPAD.c # ------------------------------------- # 963: f32 scaleX = 0.5f * (kpad->dpdState.candidates[0].x + kpad->dpdState.candidates[1].x); # Error: ^^^ # (10141) expression syntax error # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
- evaluate the actual Vec2 cross coordinate before its dot coordinate: build failed lang=c -MMD -c libs/RVL_SDK/src/kpad/KPAD.c -o build/43U/src/libs/RVL_SDK/src/kpad && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\kpad\KPAD.c # ------------------------------------- # 963: f32 scaleX = 0.5f * (kpad->dpdState.candidates[0].x + kpad->dpdState.candidates[1].x); # Error: ^^^ # (10141) expression syntax error # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
- inline midpoint x and y into both actual geometric products: (16, 39) structural/positional; instructions 250/250; restored.
- inline the dot rotation expression into its actual geometric products: (19, 45) structural/positional; instructions 250/250; restored.
- inline both dot and cross rotation expressions into their geometric products: (10, 23) structural/positional; instructions 250/250; restored.
- inline all rotation and midpoint expressions: (12, 35) structural/positional; instructions 250/250; restored.
- read normal components through a const subobject view: (12, 38) structural/positional; instructions 250/250; restored.
- combine a readonly normal view with anonymous midpoint products: (16, 39) structural/positional; instructions 250/250; restored.
## libs/RVL_SDK/src/kpad/KPAD KPADRead
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (11, 89) structural/positional differences; instructions 459/459
Remote source equals freshly built baseline; still open 97.52723%. Structural diagnosis: 459/459 frame0xc0; copy cursor uses target statuses+available then decrement, source (available-1) scale before pointer-add. Ring count is read from an actual u8 field, never changed and still supplies repeat elapsed count; test safe byte/halfword local widths, real cursor lifetime sharing, and the full copy cursor endpoint before declaration search.
- keep the actual full batch count in its byte-width local: (11, 89) structural/positional; instructions 459/459; restored.
- keep the actual full batch count widened to a halfword local: (11, 89) structural/positional; instructions 459/459; restored.
- preserve the nonnegative wrapping ring index as an unsigned local: (12, 89) structural/positional; instructions 459/459; restored.
- use an end cursor and copy into the preceding real status slot: (75, 284) structural/positional; instructions 459/459; restored.
- reuse the actual later output cursor for the initial raw-copy loop: (46, 276) structural/positional; instructions 459/459; restored.
- combine a byte batch count with the real end-cursor copy: (75, 284) structural/positional; instructions 459/459; restored.
- combine a halfword batch count and shared output cursor: (46, 276) structural/positional; instructions 459/459; restored.
## libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (14, 45) structural/positional differences; instructions 250/250
Remote source equals freshly built baseline; still open 94.82%. Structural diagnosis: Anonymous rotation inputs improve45 to23 raw differences with unchanged250 instructions. Distance target coalesces the original quotient f2 into its absolute interpolation weight: reuse the real value local after deriving dx, preserving its original zero-validity store. Test combined anonymous-rotation and actual weight reuse before registers.
- reuse the distance quotient local for its actual absolute filtering weight: (14, 43) structural/positional; instructions 250/250; restored.
- combine distance-value reuse with anonymous dot/cross rotation inputs: (10, 23) structural/positional; instructions 250/250; restored.
- fix C89 leading declarations for a real Vec2 rotation local: build failed c -MMD -c libs/RVL_SDK/src/kpad/KPAD.c -o build/43U/src/libs/RVL_SDK/src/kpad && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\kpad\KPAD.c # ------------------------------------- # 961: scaleX = 0.5f * (kpad->dpdState.candidates[0].x + kpad->dpdState.candidates[1].x); # Error: ^^^^^^ # (10140) undefined identifier 'scaleX' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
- combine the real Vec2 rotation and distance weight reuse: build failed c -MMD -c libs/RVL_SDK/src/kpad/KPAD.c -o build/43U/src/libs/RVL_SDK/src/kpad && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\kpad\KPAD.c # ------------------------------------- # 960: scaleX = 0.5f * (kpad->dpdState.candidates[0].x + kpad->dpdState.candidates[1].x); # Error: ^^^^^^ # (10140) undefined identifier 'scaleX' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
- reuse distance weight and inline midpoint inputs as well: (12, 35) structural/positional; instructions 250/250; restored.
## libs/RVL_SDK/src/kpad/KPAD KPADInit
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (9, 81) structural/positional differences; instructions 185/185
Remote source equals freshly built baseline; still open 96.51351%. Structural diagnosis: 185/185 frame0x90; target keeps zero/one and controller/matrix values in different saved registers and computes the repeat-delay constant earlier. Negative-sine narrowing coalesces to target f0 versus named rotation result f2. Test anonymous true trig result stores, matrix lifetime/representation, and loop-local calibration temporaries before register search.
- store each actual trig result directly into its matrix element: (13, 86) structural/positional; instructions 185/185; restored.
- combine direct trig stores with a controller-loop matrix pointer scope: (13, 70) structural/positional; instructions 185/185; restored.
- keep the actual width height and diagonal calibration locals inside their loop: (9, 81) structural/positional; instructions 185/185; restored.
- view the real rotation matrix through the SDK Mtx element layout: build failed contract off -lang=c -MMD -c libs/RVL_SDK/src/kpad/KPAD.c -o build/43U/src/libs/RVL_SDK/src/kpad && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\kpad\KPAD.c # ------------------------------------- # 1530: initial_rotation_(*matrix)[0][0] = one; # Error: ^ # (10377) illegal operands 'int' [ 'int' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
- combine local calibration and anonymous trig results: (13, 86) structural/positional; instructions 185/185; restored.
- combine typed matrix elements and anonymous trig results: build failed contract off -lang=c -MMD -c libs/RVL_SDK/src/kpad/KPAD.c -o build/43U/src/libs/RVL_SDK/src/kpad && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\kpad\KPAD.c # ------------------------------------- # 1529: initial_rotation_(*matrix)[0][0] = one; # Error: ^ # (10377) illegal operands 'int' [ 'int' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
## libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (14, 45) structural/positional differences; instructions 250/250
Remote source equals freshly built baseline; still open 94.82%. Structural diagnosis: Anonymous rotation inputs improve45 to23 raw differences with unchanged250 instructions. Distance target coalesces the original quotient f2 into its absolute interpolation weight: reuse the real value local after deriving dx, preserving its original zero-validity store. Test combined anonymous-rotation and actual weight reuse before registers.
- fix C89 leading declarations for a real Vec2 rotation local: (62, 136) structural/positional; instructions 252/250; restored.
- combine the real Vec2 rotation and distance weight reuse: (62, 136) structural/positional; instructions 252/250; restored.
## libs/RVL_SDK/src/kpad/KPAD KPADInit
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (9, 81) structural/positional differences; instructions 185/185
Remote source equals freshly built baseline; still open 96.51351%. Structural diagnosis: Trig and geometry structural trials preserve185 instructions but leave temporary rounding/register schedules. Target negative sine remains double until its actual field store. Test that real precision/lifetime boundary and the corrected exact SDK matrix layout before final declaration permutations. Failed C89/matrix harness transforms are excluded from successful trial counts.
- retain negative sine at math-library precision until its real float matrix store: (9, 80) structural/positional; instructions 185/185; restored.
- retain every true trig result at library precision until the float store: (9, 80) structural/positional; instructions 185/185; restored.
- combine a double negative-sine result and controller-loop matrix scope: (9, 64) structural/positional; instructions 185/185; restored.
- access actual matrix rows and columns through Mtx: (9, 81) structural/positional; instructions 185/185; restored.
- combine library-precision sine and SDK typed matrix elements: (9, 80) structural/positional; instructions 185/185; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect create__Q33ipl5scene15SDChannelSelectFv
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (4, 39) structural/positional differences; instructions 145/146
Remote source equals freshly built baseline; still open 97.73972%. Structural diagnosis: Target146 instructions/frame0x20 versus ours145; target reloads the BS2 manager in the polling body while ours reuses the condition pointer. Calls and literal pool already agree. Test actual polling pointer scope and loop exit boundaries before any register search; no unjustified volatile.
- retain the actual polling manager as a for-loop condition value: (6, 21) structural/positional; instructions 148/146; restored.
- use explicit polling and ready labels for the same loop condition: (9, 40) structural/positional; instructions 145/146; restored.
- bind the actual polling state reference in the loop condition: (9, 40) structural/positional; instructions 145/146; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (2, 4) structural/positional differences; instructions 101/101
Remote source equals freshly built baseline; still open 97.81188%. Structural diagnosis: Target and source have identical101/102 instruction counts and frame0x40; the only four differences are counter add/store and first threshold load scheduling. New source lifetime tests qualify the actual title-name input, give its output address a real cursor local, and group the escaped page/channel outputs in their true stack order. No widening, volatile or alias-type violations.
- use a const title-name input at the ordinary name-copy boundary: (2, 4) structural/positional; instructions 101/101; restored.
- give the real title-name output address its own local lifetime: (2, 4) structural/positional; instructions 101/101; restored.
- group the actual page and channel lookup outputs as a ChannelLocation: (16, 17) structural/positional; instructions 101/101; restored.
- combine readonly name input and named output cursor: (2, 4) structural/positional; instructions 101/101; restored.
- combine actual location outputs and readonly title-name input: (16, 17) structural/positional; instructions 101/101; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (2, 4) structural/positional differences; instructions 102/102
Remote source equals freshly built baseline; still open 97.833336%. Structural diagnosis: Target and source have identical101/102 instruction counts and frame0x40; the only four differences are counter add/store and first threshold load scheduling. New source lifetime tests qualify the actual title-name input, give its output address a real cursor local, and group the escaped page/channel outputs in their true stack order. No widening, volatile or alias-type violations.
- use a const title-name input at the ordinary name-copy boundary: (2, 4) structural/positional; instructions 102/102; restored.
- give the real title-name output address its own local lifetime: (2, 4) structural/positional; instructions 102/102; restored.
- group the actual page and channel lookup outputs as a ChannelLocation: (16, 17) structural/positional; instructions 102/102; restored.
- combine readonly name input and named output cursor: (2, 4) structural/positional; instructions 102/102; restored.
- combine actual location outputs and readonly title-name input: (16, 17) structural/positional; instructions 102/102; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (2, 22) structural/positional differences; instructions 126/126
Remote source equals freshly built baseline; still open 97.29365%. Structural diagnosis: 126/126 frame0x60; a real titleId hoist previously reduced22 to7 differences, with three channel-address operand differences and four postcopy counter/threshold schedules. New contiguous channel-row indexing order, real name input/output lifetimes, and title-state scope preserve the complete ordered scan.
- use index-first subscripting of the actual typed channel row: (2, 7) structural/positional; instructions 126/126; restored.
- use a readonly pointer to the complete channel row array: (2, 7) structural/positional; instructions 126/126; restored.
- combine the hoisted title value with readonly collected-name input: (2, 7) structural/positional; instructions 126/126; restored.
- combine index-first row addressing and a real name output cursor: (2, 7) structural/positional; instructions 126/126; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl
Fetch origin/main 26d7e1e052a80ea55d0591a82653370965ad5bb2. Initial assembly diagnosis: (8, 16) structural/positional differences; instructions 361/361
Remote source equals freshly built baseline; still open 97.55125%. Structural diagnosis: 361/361 frame0x80; four identical counter/threshold schedules differ16 total. Test the same real name-input/output lifetime boundaries, and anonymous cache/lookup title values preserving every special-channel ordering branch.
- make each actual special-channel collected-name input readonly: (8, 16) structural/positional; instructions 361/361; restored.
- name each real special-channel name output cursor before memcpy: (8, 16) structural/positional; instructions 361/361; restored.
- combine readonly collected-name inputs and named output cursors: (8, 16) structural/positional; instructions 361/361; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (2, 2) structural/positional differences; instructions 35/35
Remote source equals freshly built baseline; still open 99.65714%. Structural diagnosis: 35/35 frame0x10; only heap r4 and save-manager r3 argument-load order differs. Test actual returned file/output-field lifetimes and readonly pointee reference getters scoped to this TU. Keep the flag setter before heap/manager loads, every following store/call unchanged, and no volatile.
- name the actual returned asynchronous save file before its field store: (2, 2) structural/positional; instructions 35/35; restored.
- bind the real asynchronous file output field by reference at the call: (2, 2) structural/positional; instructions 35/35; restored.
- call through actual manager and heap object references at the flush boundary: (2, 2) structural/positional; instructions 35/35; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (23, 68) structural/positional differences; instructions 233/233
Remote source equals freshly built baseline; still open 93.4721%. Structural diagnosis: 233/233 frame0xe0; target keeps projection width in saved f29, source retains widthScale there; framebuffer conversion scheduling and matrix temporary colors follow from those lifetimes. Test a projection-width local scoped only to the transformed branch, anonymous matrix bound quotients, and direct quotient use before register-only last.
- keep a branch-local projection width distinct from final scissor width: (23, 68) structural/positional; instructions 233/233; restored.
- combine branch-local projection width with direct horizontal quotient use: (36, 71) structural/positional; instructions 233/233; restored.
- inline the actual top projection quotient into its matrix bound: (23, 67) structural/positional; instructions 233/233; restored.
- inline all actual matrix bound quotients while retaining each final bound: (38, 71) structural/positional; instructions 233/233; restored.
- combine anonymous matrix quotients and branch-local projection width: (38, 71) structural/positional; instructions 233/233; restored.
## src/scene/address/iplAddressEdit create__Q33ipl5scene11AddressEditFv
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (19, 323) structural/positional differences; instructions 820/820
Remote source equals freshly built baseline; still open 97.44634%. Structural diagnosis: 820/820 frame0x60; target has one balloon allocation guard and keeps both text input addresses across virtual pane lookups. Ordinary new recovers the real allocation boundary but leaves818/820 instructions. Test pointer-definition constness, a String pointer receiver reused across the real text reads, and an actual name/display input aggregate; keep literal token order.
- combine ordinary balloon allocation and a const name-pointer definition: (23, 331) structural/positional; instructions 818/820; restored.
- combine ordinary allocation and an actual String pointer used for both text inputs: (23, 331) structural/positional; instructions 818/820; restored.
- combine ordinary allocation and a real pair of readonly name/display input addresses: (23, 331) structural/positional; instructions 818/820; restored.
## src/scene/address/iplAddressEdit get_friendinfo__Q33ipl5scene11AddressEditFv
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (10, 68) structural/positional differences; instructions 82/84
Remote source equals freshly built baseline; still open 88.03571%. Structural diagnosis: 82/84 frame0x420; target computes text LEAs before virtual lookups and retains them in r29, source rematerializes them afterwards. Test const pointer definitions and the real copied friend-info/String object view lifetimes; no extra buffers or dummy objects.
- give both existing readonly text pointers const definitions: (10, 68) structural/positional; instructions 82/84; restored.
- reuse a String pointer receiver for every real string operation: (10, 39) structural/positional; instructions 83/84; restored.
- read the actual copied friend-info object through a named const reference: (14, 71) structural/positional; instructions 80/84; restored.
## src/scene/address/iplAddressEdit update_friendinfo__Q33ipl5scene11AddressEditFv
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (2, 2) structural/positional differences; instructions 38/38
Remote source equals freshly built baseline; still open 99.42105%. Structural diagnosis: 38/38 frame0x10; target builds readonly name-source r4 before global destination r3, source inverts those two LEAs. Source/destination fields and wcsncpy relocation are proven. Test a const String pointer receiver, actual typed name-array pointer, and a source-array reference with copy length derived from the true ten-character limit; no raw offsets or pinned data.
- read the copy source through a const String pointer definition: (2, 2) structural/positional; instructions 38/38; restored.
- read the source through a pointer to the actual complete name-array type: (2, 2) structural/positional; instructions 38/38; restored.
- bind the actual source array and derive the existing ten-character copy limit: (2, 2) structural/positional; instructions 38/38; restored.
## src/scene/address/iplAddressEdit set_err_msg__Q33ipl5scene11AddressEditFPwUl8NWC24Err
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (1, 30) structural/positional differences; instructions 76/75
Remote source equals freshly built baseline; still open 98.666664%. Structural diagnosis: 76/75 frame0x60; the target message-ID register is undefined for unsupported errors. Retain the initialized server fallback. New readonly cache-object access, anonymous actual error-code formatting input, and a typed supported-message enum test legitimate source boundaries without uninitialized assumptions.
- read the actual cache error through a typed readonly FriendListCache pointer: (1, 30) structural/positional; instructions 76/75; restored.
- pass the actual cache error directly into its wide-format call: (1, 30) structural/positional; instructions 76/75; restored.
- select initialized supported message values through a real enum local: (1, 30) structural/positional; instructions 76/75; restored.
## libs/RVL_SDK/src/kpad/KPAD KPADInit
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (9, 81) structural/positional differences; instructions 185/185
Remote source equals freshly built baseline; still open 96.51351%. Structural diagnosis: Register-only last after the logged structural/local-lifetime/operand trials. Search declaration permutations on the best newly tested readable context; keep every real initialized assignment, existing exact function and every field/call unchanged. Decode PSQ and FP comparisons; raw ctxdiff and objdiff remain authority.
- Declaration-search context /tmp/fz16r10.init.more.2.c: (9, 64) structural/positional differences; instructions 185/185; initialized real repeated-delay value is40000, with all field writes retained.
- KPADInit register-only last declsearch: declaration block: | KPADInside* kpad; | f32 distanceValue; | f32 sensorDistance; | f32 rotationElement; | f64 negativeSine; | f32 referenceWidth; | f32 referenceHeight; | f32 objectInterval; | f32 zero; | f32 degreesToRadians; | f32 one; | u32 i; | s32 chan; | BOOL enabled; | u16 repeatDelay; | start (6, 64) | improved (6, 53) | improved (6, 50) | best (6, 50) after 312 builds; kept in source: | f32 referenceHeight; | f32 objectInterval; | f32 sensorDistance; | f32 rotationElement; | f64 negativeSine; | f32 referenceWidth; | KPADInside* kpad; | f32 distanceValue; | f32 zero; | f32 degreesToRadians; | f32 one; | u32 i; | s32 chan; | BOOL enabled; | u16 repeatDelay; |
Nonexact declaration candidate restored; (8, 50) structural/positional differences; instructions 185/185.
## libs/RVL_SDK/src/kpad/KPAD KPADRead
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (11, 89) structural/positional differences; instructions 459/459
Remote source equals freshly built baseline; still open 97.52723%. Structural diagnosis: New target instruction84 moves available into the real decrement counter before the ring-count clear; prior endpoint tests assigned it after that clear. Extend the real counter lifetime first, then combine statuses+available endpoint and ring-index scope. Preserve the full repeat batch count; test gravity y/x operand order only after the copy structure.
- initialize the actual raw-copy counter before clearing the batch field: (9, 86) structural/positional; instructions 459/459; restored.
- combine early decrement-count initialization and a statuses-plus-available endpoint: (44, 283) structural/positional; instructions 459/459; restored.
Read cursor-scope harness omitted the extracted constant defining the old index block; aborted before source write, corrected, not counted. Real early counter assignment improved89->86/459 before the field clear.
## libs/RVL_SDK/src/kpad/KPAD KPADRead
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (11, 89) structural/positional differences; instructions 459/459
Remote source equals freshly built baseline; still open 97.52723%. Structural diagnosis: New target instruction84 moves available into the real decrement counter before the ring-count clear; prior endpoint tests assigned it after that clear. Extend the real counter lifetime first, then combine statuses+available endpoint and ring-index scope. Preserve the full repeat batch count; test gravity y/x operand order only after the copy structure.
- combine early counter initialization and pointer-before-ring-index scope: (40, 282) structural/positional; instructions 459/459; restored.
- give the real copy pointer a leading declaration with the early counter scope: (40, 282) structural/positional; instructions 459/459; restored.
- combine early counter and ring-index scope with target gravity operand order: (36, 282) structural/positional; instructions 459/459; restored.
## libs/RVL_SDK/src/kpad/KPAD read_kpad_acc
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (16, 66) structural/positional differences; instructions 400/400
Remote source equals freshly built baseline; still open 98.15%. Structural diagnosis: Further actual inline boundary: the 400-instruction target accepts either FS format through two unsigned equality checks and a shared negative exit. A boolean support predicate may retain that positive-branch graph; compare real unsigned scalar, const sample-pointer and byte-pointer helpers after the smoothing/guard reconstruction, before registers.
- unsigned scalar format with explicit accepted returns: (15, 204) structural/positional; instructions 404/400; restored.
- readonly sample pointer with accepted positive returns: (15, 204) structural/positional; instructions 404/400; restored.
- readonly format-byte pointer with accepted positive returns: (15, 204) structural/positional; instructions 404/400; restored.
- unsigned scalar short-circuit accepted predicate: (13, 197) structural/positional; instructions 403/400; restored.
- unsigned scalar switch returning real format support: (20, 207) structural/positional; instructions 408/400; restored.
## libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable
Fetch origin/main 805e84045c82629c645e9ef1787c30d2bc33b5e7. Initial assembly diagnosis: (14, 45) structural/positional differences; instructions 250/250
Remote source equals freshly built baseline; still open 94.82%. Structural diagnosis: Best anonymous rotation inputs lower45->23/250 while preserving0x20 frame. Target negates directionY before later rotation products and coalesces midpoint-X into the projected-Y expression. Test those actual sign/input/intermediate lifetimes, plus readonly normal inputs, on the anonymous rotation context before declaration search.
- give the real negative direction-Y input an independent lifetime before anonymous products: (13, 34) structural/positional; instructions 250/250; restored.
- name normal-Y then normal-X only at the late positional projection: (24, 45) structural/positional; instructions 250/250; restored.
- reuse the midpoint-X scalar for its actual projected-Y value after projected-X is computed: (12, 35) structural/positional; instructions 250/250; restored.
- use a readonly normal subobject view with anonymous rotation inputs: (10, 23) structural/positional; instructions 250/250; restored.
## Round10 final full clean gate and remaining-function audit
Full non-quick gate across all3 units GATE PASS; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; all pools identical;0 regressions/forbidden/readability warnings; every owned data section100%. No data symbol rename or extent correction needed/made. All open target function extents end before/equal the next symbol; no adjacent same-slot word/single/double stack store/reload pair justified new volatile. No byte16/byte8 mask mismatch justified widening.
libs/RVL_SDK/src/kpad/KPAD: exact 24 ->25/29; code 7672 ->7880/13056; data 8032 ->8032/8032.
src/scene/sdChannelSelect/iplSDChannelSelect: exact 122 ->122/129; code 29412 ->29412/33828; data 2960 ->2960/2960.
src/scene/address/iplAddressEdit: exact 90 ->90/94; code 23044 ->23044/27112; data 2560 ->2560/2560.
MAX round produced 1 new exact function; 89 logged successfully built distinct source variants plus312 declaration-search builds (failed builds excluded). All15 remaining functions have >=3 distinct successfully built source variants in this round. Every nonexact source/header trial was restored; only the newly exact SDK function bodies and this log differ from d7821052. Unsupported NWC24-error input contract remains unproved; initialized fallback retained.
- libs/RVL_SDK/src/kpad/KPAD read_kpad_acc 98.15%; 10 successful distinct source trials; 400/400 frame0x50; smoothing/guard reconstruction has only cmpwi5 versus cmplwi5; relational401, positive single-pass399, actual support-predicate helpers403-408; restored.
- libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable 94.82%; 15 successful distinct source trials; 250/250 frame0x20; distance weight and rotation/product schedules; anonymous rotations reduce45->23, true rotation aggregate252, normal/sign/midpoint reuse do not close gap; restored.
- libs/RVL_SDK/src/kpad/KPAD KPADRead 97.52723%; 12 successful distinct source trials; 459/459 frame0xc0; cursor endpoint/index/counter scope and gravity operand schedules; safe u8/u16 full batch counts unchanged89, early real counter reduces86, endpoint scopes frame0xd0/282; restored.
- libs/RVL_SDK/src/kpad/KPAD KPADInit 96.51351%; 9 successful distinct source trials; 185/185 frame0x90; repeat constant/global base and saved FP/matrix colors; actual double sine and matrix scope64, 312-build declaration search50 with6 decoded structural differences; restored.
- src/scene/sdChannelSelect/iplSDChannelSelect create__Q33ipl5scene15SDChannelSelectFv 97.73972%; 3 successful distinct source trials; 145/146 frame0x20; polling condition pointer is reused instead of target body reload; pointer-for-loop148, labels/reference145; restored.
- src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.81188%; 5 successful distinct source trials; 101/101 frame0x40; four counter/threshold schedules; const name/output cursor unchanged4, true location aggregate17; restored.
- src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.833336%; 5 successful distinct source trials; 102/102 frame0x40; four counter/threshold schedules; const name/output cursor unchanged4, location aggregate17; restored.
- src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.29365%; 4 successful distinct source trials; 126/126 frame0x60; entry-address operand order plus counter/threshold schedule; hoisted ID and new row-array/name views remain7; restored.
- src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.55125%; 3 successful distinct source trials; 361/361 frame0x80; four repeated count/threshold schedules differ16; readonly name and real output-cursor lifetimes unchanged; restored.
- src/scene/sdChannelSelect/iplSDChannelSelect flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv 99.65714%; 3 successful distinct source trials; 35/35 frame0x10; heap/manager argument load order differs2; real returned-file/output-field and manager/heap reference lifetimes unchanged; restored.
- src/scene/sdChannelSelect/iplSDChannelSelect setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj 93.4721%; 5 successful distinct source trials; 233/233 frame0xe0; framebuffer conversion/projection-width/output lifetimes; branch-local projection width68, anonymous top quotient67, anonymous four quotients71; restored.
- src/scene/address/iplAddressEdit create__Q33ipl5scene11AddressEditFv 97.44634%; 3 successful distinct source trials; 820/820 frame0x60; target one allocation guard and retained two text addresses; ordinary new plus const-pointer/String-pointer/actual text-input pair still818/820; restored.
- src/scene/address/iplAddressEdit get_friendinfo__Q33ipl5scene11AddressEditFv 88.03571%; 3 successful distinct source trials; 82/84 frame0x420; text pointers rematerialize after virtual lookups; const definitions82, complete String pointer83/84, copied friend reference80; restored.
- src/scene/address/iplAddressEdit update_friendinfo__Q33ipl5scene11AddressEditFv 99.42105%; 3 successful distinct source trials; 38/38 frame0x10; wcsncpy source/destination LEAs reversed; const String pointer, full source-array pointer/reference keep2; restored.
- src/scene/address/iplAddressEdit set_err_msg__Q33ipl5scene11AddressEditFPwUl8NWC24Err 98.666664%; 3 successful distinct source trials; 76/75 frame0x60; target leaves message ID undefined for unsupported errors; const cache, anonymous error format input and supported enum still76; initialized fallback retained.
New exact names: KPADSetSensorHeight.
Final full-gate authority lines:
```
[libs/RVL_SDK/src/kpad/KPAD] instruction-exact functions: 25/29
[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 122/129
[src/scene/address/iplAddressEdit] instruction-exact functions: 90/94
GATE PASS
```
Final source-isolation/remote audit: origin/main 8a07484e8aea9bdb38db258f5a6eb16347197c86 has no owned source/header/symbol changes from d7821052. SDK source differs only inside newly exact KPADSetSensorHeight; scene sources, headers, symbol metadata and configure.py unchanged locally. Nonexact trials restored. Commit64bbfbba contains the exact height match and its quick all-unit gate; this final audit records the clean full gate and89 successfully built distinct source variants plus312 declaration builds.

View File

@@ -0,0 +1,460 @@
# prior1 MAX reference round
Scope: VIInit, Window::DrawFrame, SOGetSockName and owned data. No wprintf edits.
Origin fetch succeeded; 26d7e1e052a80ea55d0591a82653370965ad5bb2; owned source and symbols match HEAD/origin. Shell execution works; historical bubblewrap blocker does not apply.
BASELINE main/libs/RevoEX/src/so/SOBasic {'fuzzy_match_percent': 99.79452, 'total_code': '4088', 'matched_code': '3836', 'matched_code_percent': 93.83562, 'total_data': '144', 'matched_data': '144', 'matched_data_percent': 100.0, 'total_functions': 22, 'matched_functions': 21, 'matched_functions_percent': 95.454544, 'total_units': 1}
Initial string pool IDENTICAL; data already 100% for every owned section. No symbol renames or extent changes needed.
BASELINE main/libs/NW4R/src/lyt/lyt_window {'fuzzy_match_percent': 99.75864, 'total_code': '11352', 'matched_code': '9848', 'matched_code_percent': 86.751236, 'total_data': '316', 'matched_data': '316', 'matched_data_percent': 100.0, 'total_functions': 21, 'matched_functions': 20, 'matched_functions_percent': 95.2381, 'total_units': 1}
Initial string pool IDENTICAL; data already 100% for every owned section. No symbol renames or extent changes needed.
BASELINE main/libs/RVL_SDK/src/vi/vi {'fuzzy_match_percent': 99.97521, 'total_code': '11296', 'matched_code': '9944', 'matched_code_percent': 88.03116, 'total_data': '1944', 'matched_data': '1944', 'matched_data_percent': 100.0, 'total_functions': 30, 'matched_functions': 29, 'matched_functions_percent': 96.666664, 'total_units': 1}
Initial string pool IDENTICAL; data already 100% for every owned section. No symbol renames or extent changes needed.
VIInit structural diagnosis: both frames 0x30; 338/338 instructions. Only 14 differences: clip active-height/top locals r29/r30/r31 rotate with shared framebuffer/PreCB/PostCB zero. No target spill/reload proof for new volatile. Reference changes declarations, explicit narrowing in AdjustPosition, and DVD-stop inline boundary; data 1944/1944.
VIInit | V1 reference removes unused format, DVD previous state block scoped | insns 338/338 structural/exact (0, 14) | objdiff 99.7929 | lost [] | data 1944/1944 | POOL IDENTICAL up to 7 (mine=7 base=7) | 63b67f44ab8a
199 M ('slwi', 'r29, r7, 1') B ('slwi', 'r30, r7, 1')
201 M ('subf', 'r26, r6, r29') B ('subf', 'r26, r6, r30')
222 M ('and', 'r30, r25, r10') B ('and', 'r31, r25, r10')
225 M ('and', 'r29, r26, r12') B ('and', 'r30, r26, r12')
227 M ('add', 'r7, r7, r30') B ('add', 'r7, r7, r31')
235 M ('li', 'r31, 0') B ('li', 'r29, 0')
238 M ('divw', 'r8, r29, r5') B ('divw', 'r8, r30, r5')
248 M ('sth', 'r31, 0x16(r4)') B ('sth', 'r29, 0x16(r4)')
250 M ('sth', 'r31, 0x18(r4)') B ('sth', 'r29, 0x18(r4)')
255 M ('stw', 'r31, 0x20(r4)') B ('stw', 'r29, 0x20(r4)')
260 M ('stb', 'r31, 0x3c(r4)') B ('stb', 'r29, 0x3c(r4)')
262 M ('stw', 'r31, 0x44(r4)') B ('stw', 'r29, 0x44(r4)')
274 M ('stw', 'r31, 0(0)') B ('stw', 'r29, 0(0)')
275 M ('stw', 'r31, 0(0)') B ('stw', 'r29, 0(0)')
VIInit | V2 reference scalar declaration group and required volatile DVD read | insns 338/338 structural/exact (0, 14) | objdiff 99.7929 | lost [] | data 1944/1944 | POOL IDENTICAL up to 7 (mine=7 base=7) | b4b22213ff0c
199 M ('slwi', 'r29, r7, 1') B ('slwi', 'r30, r7, 1')
201 M ('subf', 'r26, r6, r29') B ('subf', 'r26, r6, r30')
222 M ('and', 'r30, r25, r10') B ('and', 'r31, r25, r10')
225 M ('and', 'r29, r26, r12') B ('and', 'r30, r26, r12')
227 M ('add', 'r7, r7, r30') B ('add', 'r7, r7, r31')
235 M ('li', 'r31, 0') B ('li', 'r29, 0')
238 M ('divw', 'r8, r29, r5') B ('divw', 'r8, r30, r5')
248 M ('sth', 'r31, 0x16(r4)') B ('sth', 'r29, 0x16(r4)')
250 M ('sth', 'r31, 0x18(r4)') B ('sth', 'r29, 0x18(r4)')
255 M ('stw', 'r31, 0x20(r4)') B ('stw', 'r29, 0x20(r4)')
260 M ('stb', 'r31, 0x3c(r4)') B ('stb', 'r29, 0x3c(r4)')
262 M ('stw', 'r31, 0x44(r4)') B ('stw', 'r29, 0x44(r4)')
274 M ('stw', 'r31, 0(0)') B ('stw', 'r29, 0(0)')
275 M ('stw', 'r31, 0(0)') B ('stw', 'r29, 0(0)')
VIInit | V3 reference interrupt register value assignment order | insns 338/338 structural/exact (0, 0) | objdiff 100.0 | lost [] | data 1944/1944 | POOL IDENTICAL up to 7 (mine=7 base=7) | 4cf8217f30f5
VIInit | V4 reference clipping explicit u16 stores and grouped locals | insns 338/338 structural/exact (0, 14) | objdiff 99.7929 | lost [] | data 1944/1944 | POOL IDENTICAL up to 7 (mine=7 base=7) | 5e17b0aaa91d
199 M ('slwi', 'r29, r7, 1') B ('slwi', 'r30, r7, 1')
201 M ('subf', 'r26, r6, r29') B ('subf', 'r26, r6, r30')
222 M ('and', 'r30, r25, r10') B ('and', 'r31, r25, r10')
225 M ('and', 'r29, r26, r12') B ('and', 'r30, r26, r12')
227 M ('add', 'r7, r7, r30') B ('add', 'r7, r7, r31')
235 M ('li', 'r31, 0') B ('li', 'r29, 0')
238 M ('divw', 'r8, r29, r5') B ('divw', 'r8, r30, r5')
248 M ('sth', 'r31, 0x16(r4)') B ('sth', 'r29, 0x16(r4)')
250 M ('sth', 'r31, 0x18(r4)') B ('sth', 'r29, 0x18(r4)')
255 M ('stw', 'r31, 0x20(r4)') B ('stw', 'r29, 0x20(r4)')
260 M ('stb', 'r31, 0x3c(r4)') B ('stb', 'r29, 0x3c(r4)')
262 M ('stw', 'r31, 0x44(r4)') B ('stw', 'r29, 0x44(r4)')
274 M ('stw', 'r31, 0(0)') B ('stw', 'r29, 0(0)')
275 M ('stw', 'r31, 0(0)') B ('stw', 'r29, 0(0)')
VIInit | V5 hardware register value uses its actual u16 width | insns 338/338 structural/exact (0, 0) | objdiff 100.0 | lost [] | data 1944/1944 | POOL IDENTICAL up to 7 (mine=7 base=7) | 91d73ae4ffad
V5 clean full gate before commit
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVL_SDK/src/vi/vi] pool: IDENTICAL
[libs/RVL_SDK/src/vi/vi] objdiff: code 11296/11296 data 1944/1944 functions 30/30 fuzzy 100.0000 linked code 0
[libs/RVL_SDK/src/vi/vi] instruction-exact functions: 30/30
[libs/RVL_SDK/src/vi/vi] section .bss size 368 match 100.0
[libs/RVL_SDK/src/vi/vi] section .data size 1368 match 100.0
[libs/RVL_SDK/src/vi/vi] section .sbss size 176 match 100.0
[libs/RVL_SDK/src/vi/vi] section .sdata size 32 match 100.0
[libs/RVL_SDK/src/vi/vi] section .text size 11296 match 100.0
[libs/RVL_SDK/src/vi/vi] baseline: code 9944/11296 data 1944 functions 29 fuzzy 99.9752
regressions vs baseline: 0
global matched_code_percent: 91.05281 -> 91.09795
global fuzzy_match_percent: 99.58826 -> 99.58836
global complete_code_percent: 73.73083 -> 74.01916
global matched_data_percent: 99.42271 -> 99.42271
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
note: no baseline for merge-base 26d7e1e0; compared against nearest snapshotted ancestor d7821052 (1 commits back)
GATE PASS
```
VIInit accepted locally: value now u16, matching the VI hardware register width. Both masks preserve 16 bits. This changes only register coloring, resolves every 14 instruction difference, and retains all sections at 100%. Clean full gate PASS; ctxdiff 338/338 diffs 0; pool 7/7 identical; zero regressions and forbidden/readability patterns. No configure.py or symbols change.
DrawFrame origin pre-function fetch: 26d7e1e052a80ea55d0591a82653370965ad5bb2; owned source identical to origin. Target frame 0xe0, 376/376 instructions. All 119 differences are registers: persistent flip table r21 vs r31 shifts geometry and alpha. Static table, branches, helper operations, floating-point order, and stack offsets identical; reference lacks the target-proven texture-count guard and has mutable bool. No volatile spill/reload proof; all 316 data bytes matched. Extent 0x5e0 ends exactly at DrawFrame4.
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W1 reference mutable bUseVtxCol | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | e4d4a68bdadd
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W2 material setup result separate declaration and assignment | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 645a40fa68ea
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W3 texture dimensions separate declaration and assignment | insns 381/376 structural/exact (161, 358) | objdiff 80.97607 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 356336b28e11
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W4 coordinates passed via reference to the quad array | insns 381/376 structural/exact (96, 326) | objdiff 76.89096 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | b75bb1a0e722
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W5 alpha parameter const-qualified at definition | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | c852083af7e9
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W6 explicitly narrow texture unit argument in vertex format and dimension query | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 19a85be12cc2
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W7 texture index ix uses u8 | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 5cef145ed39c
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W7 texture index iy uses u8 | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 962c307d665a
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W7 texture index ix,iy uses u8 | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | fba15f864c06
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W7 texture index ix,iy uses u16 | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 9230751b3b92
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W7 texture index ix,iy uses u32 | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 01617eecae4e
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W7 texture index ix,iy uses unsigned long | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | aefd446c1d1d
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W8 reference plain struct declaration for TextureFlipInfo | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 127501278333
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W9 reference texture-flip type declared outside anonymous namespace | BUILD FAILED | a29d9ea4e268
2/mwcceppc.exe -nodefaults -proc gekko -align powerpc -enum int -fp hardware -Cpp_exceptions off -O4,p -inline auto -pragma "cats off" -pragma "warn_notinlined off" -maxerrors 1 -nosyspath -RTTI off -fp_contract on -str reuse -DSDK_IPL -D_REVOLUTION -DMEM_MANAGER_DIRECT -i include -i include/global -i libs/MetroTRK/include -i libs/Runtime/include -i libs/MSL/include -i libs/RVL_SDK/include -i libs/RevoEX/include -i libs/NW4R/include -i libs/RVLMiddleware/eZiText/include -i libs/RVLMiddleware/TMC_JPEG/include -i libs/RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -ipa file -fp_contract off -Cpp_exceptions off -lang=c++ -MMD -c libs/NW4R/src/lyt/lyt_window.cpp -o build/43U/src/libs/NW4R/src/lyt && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/NW4R/src/lyt/lyt_window.d build/43U/src/libs/NW4R/src/lyt/lyt_window.d
### mwcceppc.exe Compiler:
# File: libs\NW4R\src\lyt\lyt_window.cpp
# -----------------------------------------
# 48: u8 coords[VERTEXCOLOR_MAX][FLIPINDEX_MAX]; // 0x00
# Error: ^^^^^^^^^^^^^^^
# (10140) undefined identifier 'VERTEXCOLOR_MAX'
# Too many errors printed, aborting program
User break, cancelled...
ninja: build stopped: subcommand failed.
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W10 reference helper declarations before definitions | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | a4897278131e
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W9b reference global texture-flip struct with real array dimensions | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | c3ee228d2a7f
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W11 explicit inline boundary for GetTexutreFlipInfo | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 60/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | e833af53f19d
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W11 explicit inline boundary for GetLTTexCoord | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 383a08cfd390
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W11 explicit inline boundary for GetRTTexCoord | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 3d074b950c89
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W11 explicit inline boundary for GetLBTexCoord | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 7a08a15fb0f3
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W11 explicit inline boundary for GetRBTexCoord | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 0e6faa8f9403
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W12 geometry and texture-coordinate helpers explicit inline | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 60/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 1ccea4bdb91d
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W13 polygon size constructor explicitly initializes its dimensions | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | dadaf033b0f2
DrawFrame W14 final declaration-order search after structural/reference/type trials
declaration block:
const Size texSize = detail::GetTextureSize(frame.pMaterial, GX_TEXMAP0);
const ut::Color vtxColors[VERTEXCOLOR_MAX];
detail::TexCoords texCds[1];
math::VEC2 polPt;
Size polSize;
start (0, 119)
best (0, 119) after 52 builds; source restored; best order was:
const Size texSize = detail::GetTextureSize(frame.pMaterial, GX_TEXMAP0);
const ut::Color vtxColors[VERTEXCOLOR_MAX];
detail::TexCoords texCds[1];
math::VEC2 polPt;
Size polSize;
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | W14 final declaration-order result | insns 376/376 structural/exact (0, 119) | objdiff 98.17819 | lost [] | data 316/316 | POOL IDENTICAL up to 1 (mine=1 base=1) | 3cc7e4df0b05
SOGetSockName origin pre-function fetch: 805e84045c82629c645e9ef1787c30d2bc33b5e7; owned source identical to origin. Pool 1/1 identical. Both frames 0x30,63/63 instructions; only first memcpy setup differs (ours destination/source/length, target source/length/destination). Neighbor extent starts at 0x814B34CC, exactly 0x814B33D0+0xFC; no overlap. All 144 target data bytes matched. Reference uses early goto conclude, address initializer, sizeof comparison, separate prepare assignment; wire request raw-offset expressions replaced by existing NameRequest field.
SOGetSockName | S1 reference statement order and conclude goto, with typed wire fields | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 33cc57840375
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S2 reference address initialization and separate prepare assignment | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | b5a1a7e874aa
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S3 first address copy uses an explicit const input view | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 53088c5d144f
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S4 const socket address view for validation and input, mutable output parameter | insns 63/63 structural/exact (2, 5) | objdiff 96.349205 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | c08e5df4c7de
5 M ('mr', 'r27, r4') B ('mr', 'r28, r3')
6 M ('mr', 'r28, r3') B ('mr', 'r27, r4')
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S5 first copy views its header as const bytes | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 9e0bb74dd11a
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S6 typed copy helper with const source boundary | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 6a49cab5c214
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S7 allocation size declared u32 | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 68140082eff9
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S7 allocation size declared u16 | insns 63/63 structural/exact (3, 4) | objdiff 95.71429 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 404166a4490e
22 M ('rlwinm', 'r31, r0, 0, 0x10, 0x1a') B ('rlwinm', 'r31, r0, 0, 0, 0x1a')
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S7 allocation size declared size_t | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 73d720d3670d
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S8 first copy separately reads length as u8 | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | c847ce10914f
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S8 first copy separately reads length as u16 | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | becaa347c984
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S8 first copy separately reads length as u32 | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | a1d015de3910
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S8 first copy separately reads length as int | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | d235318a13b5
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S8 first copy separately reads length as size_t | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 43864ee20f80
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S9 reference command allocation is int pointer with typed address-field view | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | f42be4f4821b
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S10 reply buffer held as opaque IOCTL buffer with typed length view | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 39d08eea8df3
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S11 promote first copy length through unsigned halfword | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 8dae136f16d1
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S12 syscall result declared s16 | insns 63/63 structural/exact (8, 20) | objdiff 91.5873 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 2e50fd103218
10 M ('extsh.', 'r3, r3') B ('cmpwi', 'r3, 0')
19 M ('b', '136') B ('b', '140')
29 M ('b', '96') B ('b', '100')
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
43 M ('extsh.', 'r30, r3') B ('cmpwi', 'r3, 0')
44 M ('blt', '20') B ('mr', 'r30, r3')
45 M ('lbz', 'r5, 0(r28)') B ('blt', '20')
46 M ('mr', 'r3, r27') B ('lbz', 'r5, 0(r28)')
47 M ('mr', 'r4, r28') B ('mr', 'r3, r27')
48 M ('bl', '0') B ('mr', 'r4, r28')
49 M ('mr', 'r4, r29') B ('bl', '0')
50 M ('mr', 'r5, r31') B ('mr', 'r4, r29')
51 M ('li', 'r3, 0xc') B ('mr', 'r5, r31')
52 M ('bl', '0') B ('li', 'r3, 0xc')
53 M ('mr', 'r4, r30') B ('bl', '0')
54 M ('li', 'r3, 0') B ('mr', 'r4, r30')
55 M ('bl', '0') B ('li', 'r3, 0')
56 M ('extsh', 'r3, r3') B ('bl', '0')
SOGetSockName | S12 syscall result declared long | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | b72c9cdddb5e
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S12 syscall result declared s32 | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 1ab005e08c72
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S13 reply initialized through memcpy destination return | insns 63/63 structural/exact (10, 20) | objdiff 89.12698 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 7693f4b6b84c
5 M ('mr', 'r29, r3') B ('mr', 'r28, r3')
18 M ('li', 'r29, -0x1c') B ('li', 'r30, -0x1c')
22 M ('rlwinm', 'r30, r0, 0, 0, 0x1a') B ('rlwinm', 'r31, r0, 0, 0, 0x1a')
23 M ('mr', 'r4, r30') B ('mr', 'r4, r31')
26 M ('mr', 'r28, r3') B ('mr', 'r29, r3')
28 M ('li', 'r29, -0x31') B ('li', 'r30, -0x31')
30 M ('stw', 'r29, 0(r3)') B ('stw', 'r28, 0(r3)')
31 M ('mr', 'r4, r27') B ('addi', 'r28, r3, 0x20')
32 M ('addi', 'r3, r3, 0x20') B ('mr', 'r4, r27')
34 M ('bl', '0') B ('mr', 'r3, r28')
35 M ('mr', 'r31, r3') B ('bl', '0')
37 M ('lbz', 'r8, 0(r27)') B ('mr', 'r5, r29')
38 M ('mr', 'r5, r28') B ('lbz', 'r8, 0(r27)')
39 M ('mr', 'r7, r31') B ('mr', 'r7, r28')
44 M ('mr', 'r29, r3') B ('mr', 'r30, r3')
46 M ('lbz', 'r5, 0(r31)') B ('lbz', 'r5, 0(r28)')
48 M ('mr', 'r4, r31') B ('mr', 'r4, r28')
50 M ('mr', 'r4, r28') B ('mr', 'r4, r29')
51 M ('mr', 'r5, r30') B ('mr', 'r5, r31')
54 M ('mr', 'r4, r29') B ('mr', 'r4, r30')
SOGetSockName | S14 reply pointer obtained from the initial address-field copy | insns 63/63 structural/exact (10, 6) | objdiff 90.07937 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 59b28a410bde
31 M ('mr', 'r4, r27') B ('addi', 'r28, r3, 0x20')
32 M ('addi', 'r3, r3, 0x20') B ('mr', 'r4, r27')
34 M ('bl', '0') B ('mr', 'r3, r28')
35 M ('mr', 'r28, r3') B ('bl', '0')
37 M ('lbz', 'r8, 0(r27)') B ('mr', 'r5, r29')
38 M ('mr', 'r5, r29') B ('lbz', 'r8, 0(r27)')
SOGetSockName | S15 socket command and read-only address initialized in one typed helper | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 53a9d11f1936
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
SOGetSockName | S16 source-first read-only request initializer returns the address buffer | insns 63/63 structural/exact (2, 19) | objdiff 95.39683 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 7a7c904069d2
5 M ('mr', 'r29, r3') B ('mr', 'r28, r3')
18 M ('li', 'r29, -0x1c') B ('li', 'r30, -0x1c')
22 M ('rlwinm', 'r30, r0, 0, 0, 0x1a') B ('rlwinm', 'r31, r0, 0, 0, 0x1a')
23 M ('mr', 'r4, r30') B ('mr', 'r4, r31')
26 M ('mr', 'r28, r3') B ('mr', 'r29, r3')
28 M ('li', 'r29, -0x31') B ('li', 'r30, -0x31')
30 M ('stw', 'r29, 0(r3)') B ('stw', 'r28, 0(r3)')
31 M ('addi', 'r31, r3, 0x20') B ('addi', 'r28, r3, 0x20')
32 M ('mr', 'r3, r31') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
37 M ('mr', 'r5, r28') B ('mr', 'r5, r29')
39 M ('mr', 'r7, r31') B ('mr', 'r7, r28')
44 M ('mr', 'r29, r3') B ('mr', 'r30, r3')
46 M ('lbz', 'r5, 0(r31)') B ('lbz', 'r5, 0(r28)')
48 M ('mr', 'r4, r31') B ('mr', 'r4, r28')
50 M ('mr', 'r4, r28') B ('mr', 'r4, r29')
51 M ('mr', 'r5, r30') B ('mr', 'r5, r31')
54 M ('mr', 'r4, r29') B ('mr', 'r4, r30')
SOGetSockName S17 final declaration-order search after reference/copy-type/helper trials
declaration block:
int size;
int result;
s32 rm;
NameRequest* request;
SOSockAddr* reply;
SOSockAddr* addr;
start (2, 3)
best (2, 3) after 36 builds; source restored; best order was:
int size;
int result;
s32 rm;
NameRequest* request;
SOSockAddr* reply;
SOSockAddr* addr;
SOGetSockName | S17 final declaration-order result | insns 63/63 structural/exact (2, 3) | objdiff 96.666664 | lost [] | data 144/144 | POOL IDENTICAL up to 1 (mine=1 base=1) | 73d59f1449b9
32 M ('mr', 'r3, r28') B ('mr', 'r4, r27')
33 M ('mr', 'r4, r27') B ('lbz', 'r5, 0(r27)')
34 M ('lbz', 'r5, 0(r27)') B ('mr', 'r3, r28')
FINAL OPEN AUDIT | SOGetSockName | objdiff 96.666664% | 25 distinct successful source trials | all unsuccessful source restored
FINAL OPEN AUDIT | DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc | objdiff 98.17819% | 23 distinct successful source trials | all unsuccessful source restored
Retained source: VIInit hardware register value u16 only, local commit bfe67f5a. No other source/config/header changes. All owned data sections 100%; data symbol/extent corrections unnecessary. DrawFrame remains register-only at 376/376, 119 differences; SOGetSockName remains first-copy setup scheduling at 63/63, 3 differences.
Final full clean gate over all owned units
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVL_SDK/src/vi/vi] pool: IDENTICAL
[libs/RVL_SDK/src/vi/vi] objdiff: code 11296/11296 data 1944/1944 functions 30/30 fuzzy 100.0000 linked code 0
[libs/RVL_SDK/src/vi/vi] instruction-exact functions: 30/30
[libs/RVL_SDK/src/vi/vi] section .bss size 368 match 100.0
[libs/RVL_SDK/src/vi/vi] section .data size 1368 match 100.0
[libs/RVL_SDK/src/vi/vi] section .sbss size 176 match 100.0
[libs/RVL_SDK/src/vi/vi] section .sdata size 32 match 100.0
[libs/RVL_SDK/src/vi/vi] section .text size 11296 match 100.0
[libs/RVL_SDK/src/vi/vi] baseline: code 9944/11296 data 1944 functions 29 fuzzy 99.9752
[libs/NW4R/src/lyt/lyt_window] pool: IDENTICAL
[libs/NW4R/src/lyt/lyt_window] objdiff: code 9848/11352 data 316/316 functions 20/21 fuzzy 99.7586 linked code 0
[libs/NW4R/src/lyt/lyt_window] instruction-exact functions: 20/21
[libs/NW4R/src/lyt/lyt_window] section .ctors size 4 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .data size 256 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .sbss size 8 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .sdata2 size 48 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .text size 11352 match 99.75864
[libs/NW4R/src/lyt/lyt_window] below 100: DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc 98.17819
[libs/NW4R/src/lyt/lyt_window] baseline: code 9848/11352 data 316 functions 20 fuzzy 99.7586
[libs/RevoEX/src/so/SOBasic] pool: IDENTICAL
[libs/RevoEX/src/so/SOBasic] objdiff: code 3836/4088 data 144/144 functions 21/22 fuzzy 99.7945 linked code 0
[libs/RevoEX/src/so/SOBasic] instruction-exact functions: 21/22
[libs/RevoEX/src/so/SOBasic] section .bss size 40 match 100.0
[libs/RevoEX/src/so/SOBasic] section .data size 88 match 100.0
[libs/RevoEX/src/so/SOBasic] section .sbss size 8 match 100.0
[libs/RevoEX/src/so/SOBasic] section .sdata size 8 match 100.0
[libs/RevoEX/src/so/SOBasic] section .text size 4088 match 99.79452
[libs/RevoEX/src/so/SOBasic] below 100: SOGetSockName 96.666664
[libs/RevoEX/src/so/SOBasic] baseline: code 3836/4088 data 144 functions 21 fuzzy 99.7945
regressions vs baseline: 0
global matched_code_percent: 91.05281 -> 91.09795
global fuzzy_match_percent: 99.58826 -> 99.58836
global complete_code_percent: 74.01916 -> 74.01916
global matched_data_percent: 99.42271 -> 99.42271
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
Post-gate checks: ninja -C . build/43U/ok progress build/43U/report.json PASS. DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. VIInit ctxdiff 338/338 diffs 0; SOGetSockName 63/63 diffs 3. Final pools identical: vi 7/7, window 1/1, SOBasic 1/1. Git diff --check PASS.
Final owned metrics (exact functions, matched code bytes, matched data bytes): vi 29/30,9944/11296,1944/1944 -> 30/30,11296/11296,1944/1944; lyt_window 20/21,9848/11352,316/316 unchanged; SOBasic 21/22,3836/4088,144/144 unchanged.
Final origin/main advanced to 805e84045c82629c645e9ef1787c30d2bc33b5e7 during other workers: the local scope diff against merge-base 26d7e1e0 contains only vi.c and this attempts log; no out-of-scope edits. Worker did not rebase, link, push or contact upstream.