Compare commits

...

8 Commits

Author SHA1 Message Date
coah
75b71dff44 decomp(inputform): recover pane lookup and animation slot flow 2026-10-02 19:12:56 -05:00
coah
14a8b23adb decomp: correct Chinese phonetic contracts and Zhuyin dispatch (#1000) 2026-10-02 19:07:43 -05:00
coah
b8931fae6f decomp: recover card rename retry reset boundary (#999) 2026-10-02 19:07:35 -05:00
coah
bcac23375a decomp(keyboard): correct prediction refresh and character flow (#998) 2026-10-02 19:07:28 -05:00
coah
ed49ada973 decomp: recover ATERM digest and payload lifetimes (#997) 2026-10-02 19:07:02 -05:00
coah
fa0cb9b7b4 decomp(nhttp): recover token loop and Base64 byte flow (#996) 2026-10-02 18:51:40 -05:00
coah
8ffaa9d25a decomp(bs2): preserve update publications and repeated entry reads (#995) 2026-10-02 18:49:17 -05:00
coah
cc812ad30e ci: live README progress badges from a progress-data branch (#994)
The README progress table only changed when a landing commit rewrote it, so
merges outside land.sh left it stale, and the decomp.dev badges showed
upstream's numbers. The progress workflow now publishes shields.io endpoint
JSON to an orphan progress-data branch (one force-pushed commit), so the
badges refresh on every push to main without extra commits on main.
The build badge now points at the workflow that actually builds (Build is
disabled: it needs upstream's private container).
2026-10-02 18:47:05 -05:00
19 changed files with 740 additions and 109 deletions

View File

@@ -2,8 +2,8 @@ name: README progress
# runs on the self-hosted runner on cole's server so it doesn't use hosted minutes.
# only push/schedule/manual triggers, never pull_request, so fork PRs can't reach this machine.
# README progress is written inside each landing commit by the orchestrator, so this job never commits;
# it only rebuilds and publishes the current numbers to the job summary.
# it never commits to main: it rebuilds, publishes the numbers to the job summary, and force-pushes
# the README badge JSON as a single commit on the orphan progress-data branch.
on:
push:
branches: [main]
@@ -17,7 +17,7 @@ concurrency:
cancel-in-progress: true
permissions:
contents: read
contents: write
jobs:
progress:
@@ -55,3 +55,17 @@ jobs:
python3 tools/update_readme_progress.py build/43U/report.json README.md "$GITHUB_SHA"
sed -n '/progress:start/,/progress:end/p' README.md >> "$GITHUB_STEP_SUMMARY"
git checkout -- README.md
- name: Publish badges
if: github.ref == 'refs/heads/main'
run: |
out="$RUNNER_TEMP/progress-data"
rm -rf "$out"
python3 tools/progress_badges.py build/43U/report.json "$out"
cd "$out"
git init -q -b progress-data
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -q -m "progress for $GITHUB_SHA"
git push -q -f "https://x-access-token:${{ github.token }}@github.com/$GITHUB_REPOSITORY.git" HEAD:refs/heads/progress-data

View File

@@ -7,23 +7,23 @@
<!--- Github Actions Badge -->
[Build Status]: https://github.com/coah80/wii-ipl/actions/workflows/build.yml/badge.svg
[actions]: https://github.com/coah80/wii-ipl/actions/workflows/build.yml
[Build Status]: https://github.com/coah80/wii-ipl/actions/workflows/readme-progress.yml/badge.svg?branch=main
[actions]: https://github.com/coah80/wii-ipl/actions/workflows/readme-progress.yml
<!--- Discord Badge -->
[Discord Badge]: https://img.shields.io/discord/727908905392275526?color=%237289DA&logo=discord&logoColor=%23FFFFFF
[discord]: https://discord.gg/hKx3FJJgrV
<!-- Progress links -->
<!-- Progress badges: JSON on the progress-data branch, refreshed by the README progress workflow on every push to main -->
[V43U]: https://decomp.dev/koopthekoopa/wii-ipl/43U
<!--- Version 4.3U progress Badge -->
[DecompBadgeV43U]: https://decomp.dev/koopthekoopa/wii-ipl/43U.svg?&measure=code&label=Decompiled&mode=shield&labelColor=%237c7c7c&color=%2333b8ff&style=plastic
[LinkBadgeV43U]: https://decomp.dev/koopthekoopa/wii-ipl/43U.svg?&measure=complete_code&label=Linked&mode=shield&labelColor=%237c7c7c&color=%2333b8ff&style=plastic
[FuncBadgeV43U]: https://decomp.dev/koopthekoopa/wii-ipl/43U.svg?&measure=functions&label=Functions&mode=shield&labelColor=%237c7c7c&color=%2333b8ff&style=plastic
[progress]: https://github.com/coah80/wii-ipl/actions/workflows/readme-progress.yml
[DecompiledBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Fdecompiled.json
[MatchedBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Fmatched.json
[LinkedBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Flinked.json
[DataBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Fdata.json
[FunctionsBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Ffunctions.json
[UnitsBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Funits.json
<!--- Header -->
@@ -43,28 +43,17 @@ Live decomp status
[![Build status]][actions]
Open the latest successful [Build workflow run][actions] and check its summary for the current objdiff metrics. It includes perfect-match/decompiled, fuzzy-match, fully linked, data, function, unit, and category breakdowns. The run also publishes the 43U report artifact and generated decomp-status report.
Every push to `main` rebuilds 4.3U, checks the DOL hash, and refreshes the progress badges below. Open the latest [README progress run][actions] for the full objdiff summary.
Supported versions:
- `43U` - Version **4.3U** (USA)
Progress
========
<!-- progress:start -->
| Decompiled | Matched | Linked | Data |
|:---:|:---:|:---:|:---:|
| 99.59% | 91.16% | 74.57% | 99.56% |
units 964/1027 complete, functions 12378/12563 matched.
[![DecompiledBadge]][progress] [![MatchedBadge]][progress] [![LinkedBadge]][progress] [![DataBadge]][progress]
[![FunctionsBadge]][progress] [![UnitsBadge]][progress]
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 -->
| Version | Progress |
|-----------------------|------------------------------------------------------------------------------|
| [Wii Menu 4.3U][V43U] | [![FuncBadgeV43U]][V43U] [![DecompBadgeV43U]][V43U] [![LinkBadgeV43U]][V43U] |
> You can see the full progress and its history by clicking on one of the versions in the table.
Dependencies
============

View File

@@ -24,7 +24,7 @@ typedef struct BS2UpdateHeader {
typedef struct BS2UpdateEntry {
// Update Meta Data
u32 type; // 0x00
vu32 type; // 0x00
u32 attr; // 0x04
u32 size; // 0x08
u32 depend; // 0x0C

View File

@@ -138,11 +138,11 @@ extern ziU16 Zi8GetTableCount(ziU8 language, ziU8 table, ziPtr work);
extern ziU8 Zi8IsDupWChar(ziWChar character, ziPtr work);
extern ziU8 Zi8IsDupWordW(ziWChar* word, ziU8 length, ziPtr work);
extern ziWChar Zi8Ord2Uni(ziU16 ordinal, ziPtr work);
extern ziU8 Zi8MatchPhonetic(ziU8* phonetics, ZiChineseRecord* records,
ziPtr indexTable, ziU16 indexCount, ziPtr dictionary,
ZiChineseRecord* record, ziU16* mask, ziU16* match,
ziU16* length, ZiChineseRecord** matchedRecord,
int* matchedIndex, ziU8 wordMode, ziU8 partial,
extern ziU8 Zi8MatchPhonetic(ziPtr phonetics, ziU8* records,
ziPtr indexTable, ziU16 indexCount, ziU32 dictionary,
ziU8* record, ziU16* mask, ziU16* match,
ziU16* length, ziU8** matchedRecord,
ziU8** matchedString, ziU8 wordMode, ziU8 partial,
ziU8 oneCharacter, ziU16 excludedMask,
ziU16 excludedMatch, ziU8 charset, ziU8 options,
ziU16 ordinal, ziU16* tone, ziU8 spellingOnly,
@@ -614,10 +614,10 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
case 56: case 59:
if (((ziFuzzyZYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B2C.word)->fANDh) ordinalIndex = 0xF9FF;
break;
case 52: case 55:
case 60: case 63:
if (((ziFuzzyZYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B2C.word)->bANDp) ordinalIndex = 0xF9FF;
break;
case 60: case 63:
case 52: case 55:
if (((ziFuzzyZYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B2C.word)->gANDk) ordinalIndex = 0xF9FF;
break;
case 38:
@@ -1612,9 +1612,9 @@ phonetic_ordinal_search:
record = records + phraseOrdinal * 12;
candidateCount = 0;
phoneticGroups = 0;
if (!Zi8MatchPhonetic(phoneticTable, (ZiChineseRecord*)records, alternateTable, alternateCount,
phraseTable, (ZiChineseRecord*)record, match.phon, match.phon2,
&candidateCount, (ZiChineseRecord**)&record, (int*)&phoneticGroups,
if (!Zi8MatchPhonetic(phoneticTable, records, alternateTable, alternateCount,
(ziU32)phraseTable, record, match.phon, match.phon2,
&candidateCount, &record, &phoneticGroups,
0, 1, match.nCand, phoneticMask, phoneticMatch, charset, requireFull,
phraseOrdinal, &candidateOrdinal, 0, work)) continue;
if (charsetTable) {
@@ -2323,9 +2323,9 @@ phonetic_ordinals:
candidateCount = recordCount;
phoneticGroups = 0;
while (emittedCount < request->maxCandidates && candidateCount) {
if (!Zi8MatchPhonetic(phoneticTable, (ZiChineseRecord*)records, alternateTable, alternateCount,
phraseTable, (ZiChineseRecord*)record, match.phon, match.phon2,
&candidateCount, (ZiChineseRecord**)&record, (int*)&phoneticGroups,
if (!Zi8MatchPhonetic(phoneticTable, records, alternateTable, alternateCount,
(ziU32)phraseTable, record, match.phon, match.phon2,
&candidateCount, &record, &phoneticGroups,
emitWords, singleCharacterPass, match.nCand, phoneticMask, phoneticMatch, charset,
requireFull, recordCount, &candidateOrdinal, filteringMode, work)) break;
ordinalIndex = recordCount - candidateCount - 1;
@@ -2608,10 +2608,10 @@ static int Zi8NewMatchPhonetic(ziGetParam* request, ZiChineseRecord* records,
ziU8* phonetics;
int totalResults;
int emittedCharacters;
ZiChineseRecord* matchedRecord;
ziU8* matchedRecord;
ziU8* phoneticGroups;
ziU8* candidateGroups;
int matchedIndex;
ziU8* matchedString;
int capacity;
ziU8* groupCandidates;
ziU16 phoneticCount;
@@ -2782,12 +2782,12 @@ next_group_candidate:
}
}
if (stopAfterTone) {
matchedRecord = records + character;
matchedRecord = (ziU8*)(records + character);
matchedLength = 0;
matchedIndex = 0;
if (!Zi8MatchPhonetic(phonetics, records, indexTable, indexCount,
dictionary, matchedRecord, &mask, &match,
&matchedLength, &matchedRecord, &matchedIndex,
matchedString = 0;
if (!Zi8MatchPhonetic(phonetics, (ziU8*)records, indexTable, indexCount,
(ziU32)dictionary, matchedRecord, &mask, &match,
&matchedLength, &matchedRecord, &matchedString,
wordMode, 1, 1, excludedMask, excludedMatch,
charset, request->getOptions & 0x40, character,
&matchedTone, 0, work)) {

View File

@@ -254,7 +254,7 @@ ziBool Zi8PriMatchNextComp(ziU8* node, ziU8 mask0, ziU8 value0, ziU8 mask1, ziU8
return 0;
}
ziBool Zi8SecMatchComp(ziPtr nodeAddress, ziMatchParam* matchAddress, ziPtr dictionaryAddress) {
ziBool Zi8SecMatchComp(ziPtr nodeAddress, ziMatchParam* matchAddress, ziPtr dictionaryAddress ZI_NEED_WORK) {
int chainIndex;
ziU16 matchCode;
ziU16 targetCode;

View File

@@ -7,8 +7,7 @@ s32 NHTTPi_strcmp(const char* left, const char* right) { return strcmp(left,righ
void* NHTTPi_memclr(void* destination, u32 size) { return memset(destination,0,size); }
static int LowerCase(int character) {
if((character>='A') & (character<='Z')) character+=32;
return character;
return ((character >= 'A') & (character <= 'Z')) ? character + 32 : character;
}
s32 NHTTPi_strnicmp(const char* left, const char* right, s32 length) {
@@ -127,12 +126,13 @@ s32 NHTTPi_intToStr(char* destination, u32 value) {
}
s32 NHTTPi_compareToken(const char* left, const char* right) {
for (;;) {
int rightCharacter=LowerCase(*right);
int leftCharacter=LowerCase(*left);
if(leftCharacter!=rightCharacter) break;
if(*left==0 || *left==' ') return 0;
++left; ++right;
u8 rawLeft;
while (LowerCase((s8)(rawLeft = *(const u8*)left)) == LowerCase(*right)) {
if ((s8)rawLeft == 0 || (s8)rawLeft == ' ') {
return 0;
}
++left;
++right;
}
return -1;
}
@@ -161,13 +161,16 @@ s32 NHTTPi_Base64Encode(char* destination, const char* source) {
static char alphabet[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const char* table=alphabet;
char* output=destination;
u32 length=strlen(source);
s32 length=strlen(source);
s32 consumed=0;
for(; consumed<(s32)length; consumed+=3) {
output[0]=table[source[0]>>2];
output[1]=table[((source[0]&3)<<4)+(source[1]>>4)];
output[2]=table[((source[1]&15)<<2)+(source[2]>>6)];
output[3]=table[source[2]&63];
for(; consumed<length; consumed+=3) {
s8 first = source[0];
s8 second = source[1];
s8 third = source[2];
output[0]=table[first>>2];
output[1]=table[(second>>4)+((first&3)<<4)];
output[2]=table[(third>>6)+((second&15)<<2)];
output[3]=table[third&63];
source+=3; output+=4;
}
if(consumed==length+1) output[-1]='=';

View File

@@ -23,10 +23,10 @@ s32 WADImportDVDForBS(const char* path, void* buffer, u32 length);
s32 WADImportDVDExForBS(const char* path, void* buffer, u32 length);
static BS2UpdateEntry* pEntries = NULL;
static u32 EntriesCount = 0;
static volatile u32 EntriesCount = 0;
static u32* pFlags = NULL;
static void* MemAllocator = NULL;
int State = 0;
volatile int State = 0;
BS2UpdateEntry* CurrentEntry = 0;
static u32 RebootRequired = 0;
static BOOL ContainsSeatTitles = 0;

View File

@@ -1169,7 +1169,7 @@ void LayoutByNW4R::create(MEMAllocator* allocator, EditBuffer* editBuffer) {
setVisible("N_2line", true);
mpPaneManager->setAllComponentTriggerTarget(false);
mpPaneManager->setAllBoundingBoxComponentTriggerTarget(true);
nw4r::lyt::Pane* pane = getPane(static_cast<const LanguagePaneData*>(mpLanguageData)->textBox);
nw4r::lyt::Pane* pane = mpLayout->GetRootPane()->FindPaneByName(static_cast<const LanguagePaneData*>(mpLanguageData)->textBox, true);
if (!pane) pane = mpLayout->GetRootPane()->FindPaneByName(getLanguageTextPane() ? static_cast<const LanguagePaneData*>(mpLanguageData)->textBox : "T_2l_TextBox", true);
mpPaneManager->getPaneComponentByPane(pane)->setTriggerTarget(true);
for (u32 buttonIndex = 0; buttonIndex < 2; ++buttonIndex) {
@@ -1187,7 +1187,7 @@ void LayoutByNW4R::create(MEMAllocator* allocator, EditBuffer* editBuffer) {
const char* bindingName = button.bindingName;
count = button.count;
for (u16 animationIndex = 0; animationIndex < count; ++animationIndex) {
const InputFormAnimationFile* file = button.files[animationIndex];
const InputFormAnimationFile* const& file = button.files[animationIndex];
void* resource = mpMultiArcResourceAccessor->GetResource(0, file->fileName, NULL);
AnimTransformPane* transform = static_cast<AnimTransformPane*>(getLayout()->CreateAnimTransform(resource, mpMultiArcResourceAccessor));
if (!bindingName) animationPane->addAnimation(allocator, file->id, transform, false, true);
@@ -3177,7 +3177,7 @@ u32 Base::calcCursorPos(f32 x, f32 y) {
info.character = *string;
calcRect(info);
lineBottom = lineTop + scale.y * (info.rect.bottom - info.rect.top);
f32 right = cursorX + scale.x * (info.rect.right - info.rect.left);
f32 right = cursorX + scale.x * info.rect.GetWidth();
if (doWordWrap(mpString->getWCString(), pos, cursorX)) {
if (localY >= lineTop && localY <= lineBottom) {
if (pos != 0) return pos - 1;
@@ -3186,14 +3186,14 @@ u32 Base::calcCursorPos(f32 x, f32 y) {
lineTop += scale.y * getLineHeight();
cursorX = getScale().x;
lineBottom = lineTop + scale.y * (info.rect.bottom - info.rect.top);
right = cursorX + scale.x * (info.rect.right - info.rect.left);
right = cursorX + scale.x * info.rect.GetWidth();
}
if (right >= scale.x * (mRect.right - mRect.left)) {
if (right >= scale.x * mRect.GetWidth()) {
if (localY >= lineTop && localY <= lineBottom) return pos;
lineTop += scale.y * getLineHeight();
cursorX = getScale().x;
lineBottom = lineTop + scale.y * (info.rect.bottom - info.rect.top);
right = cursorX + scale.x * (info.rect.right - info.rect.left);
right = cursorX + scale.x * info.rect.GetWidth();
}
if (x <= info.rect.left && localY >= lineTop && localY <= lineBottom) return pos;
if (*string == L'\n') {
@@ -3207,7 +3207,7 @@ u32 Base::calcCursorPos(f32 x, f32 y) {
if (cursorX + 0.5f * (right - cursorX) > x) return pos;
return pos + 1;
}
cursorX += scale.x * (info.rect.right - info.rect.left);
cursorX += scale.x * info.rect.GetWidth();
}
++string;
++pos;

View File

@@ -298,7 +298,6 @@ void WithZi::update() {
return;
}
wchar_t* candidateOutput = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x200]);
mSelectedCandidate = 0;
s32 elementCount = static_cast<u16>(setElementBuffer());
mSearch.language = getPredictLanguage();
@@ -307,7 +306,7 @@ void WithZi::update() {
mSearch.context = 1;
mSearch.getOptions = 0x81;
mSearch.elements = reinterpret_cast<wchar_t*>(ElementBuffer);
mSearch.candidates = candidateOutput;
mSearch.candidates = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x200]);
mSearch.maxCandidates = 0x28;
mSearch.elementCount = static_cast<u8>(elementCount);
mSearch.firstCandidate = 0;
@@ -355,25 +354,24 @@ void WithZi::update() {
ChangeDictionaryLanguage(getPredictLanguage());
u32 count = EZTXGetCandidates(&mSearch, mpDictionaryWork) & 0xff;
if (getPredictLanguage() == 1 && count == 0x61) {
wchar_t* candidateOutput = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x200]);
mSearch.firstCandidate = 0x61;
mSearch.candidates = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x2c2]);
mSearch.candidates = candidateOutput + 0xC2;
mSearch.maxCandidates = 199;
count = EZTXGetCandidates(&mSearch, mpDictionaryWork) & 0xff;
count += EZTXGetCandidates(&mSearch, mpDictionaryWork) & 0xff;
mSearch.firstCandidate = 0;
count += 0x61;
mSearch.candidates = candidateOutput;
}
if (static_cast<s32>(count) > 0x28) {
count = 0x28;
}
if (getPredictLanguage() == 1 && mbContextChanged != 0 &&
(mbContextChanged = 0, mSearch.wordCharCount == 0)) {
(mbContextChanged = 0, mSearch.count == 0)) {
u32 length = mCurrentWordLength;
u32 wordLength = wcslen((wchar_t*)LatestWord) & 0xff;
u32 copied;
u16* source = LatestWord + wordLength - length;
for (copied = 0; copied < length; ++copied) {
LatestWord[copied] = source[copied];
LatestWord[copied] = LatestWord[(wordLength - length) + copied];
}
LatestWord[copied] = 0;
mSearch.wordCharCount = wcslen((wchar_t*)LatestWord);
@@ -409,8 +407,10 @@ void WithZi::update() {
destination[1] = 0;
} else if (getPredictLanguage() == 0x12) {
u16* output = destination;
while (*source >= 0x100) {
*output++ = *source++;
u16 character;
while ((character = *source) >= 0x100) {
*output++ = character;
++source;
}
} else if (EZTXCopy(reinterpret_cast<wchar_t*>(destination), &mSearch, index & 0xff, mpDictionaryWork) == 0) {
goto nextCandidate;
@@ -430,6 +430,8 @@ void WithZi::update() {
if (position == 0) *candidate = util::toWUpper(*candidate);
else *candidate = util::toWLower(*candidate);
break;
case LM_3:
break;
default:
break;
}

View File

@@ -1198,8 +1198,8 @@ copyIoDone:
renamedStatus = moveStatus;
memset(renamedStatus.company, 0, 2);
memset(renamedStatus.gameName, 0, 4);
memset(renamedStatus.fileName, 0, 0x20);
do {
memset(renamedStatus.fileName, 0, 0x20);
sprintf((char*)renamedStatus.fileName, "Broken File%03d", attempt);
result = __CARDSetStatusEx(slot, fileNo, &renamedStatus);
if (result < 0 && result != -7) {

View File

@@ -1442,8 +1442,6 @@ s32 ATERMRunConfigProtocol(void) {
AtermSocketAddress peerAddress;
AtermThreadBuffer* response = (AtermThreadBuffer*)&gAtermConfigurationResult.responseLength;
void* sessionKey = gAtermResponseBuffer.session.keyMaterial;
AtermMd5Context digestContext;
u8 digestLength[8];
s32 socket = 0;
s32 result = -5;
s32 failed = 0;
@@ -1617,13 +1615,11 @@ s32 ATERMRunConfigProtocol(void) {
u32 checksum = 0;
u8* cursor = gAtermConfigurationResult.packetBuffer;
u8* packetEnd = packet->payload + payloadLength;
u8* payload = packet->payload;
u8* payload;
for (; cursor < packetEnd; cursor++) {
checksum += *cursor;
}
if ((u16)checksum != SONtoHs(*(u16*)packetEnd)) {
payload = NULL;
}
payload = (u16)checksum == SONtoHs(*(u16*)packetEnd) ? packet->payload : NULL;
if (payload == NULL) {
payloadLength = 0;
} else if (sequence != 3) {
@@ -1652,6 +1648,8 @@ s32 ATERMRunConfigProtocol(void) {
}
{
AtermProgress progress;
AtermMd5Context digestContext;
u8 digestLength[8];
u32 authenticationTime = (u32)(OSGetTime() /
(__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6));
u32 index;
@@ -1677,22 +1675,13 @@ s32 ATERMRunConfigProtocol(void) {
ATERMMd5Update(&digestContext, gAtermDigestFill,
digestBytes < 56 ? 56 - digestBytes : 120 - digestBytes);
ATERMMd5Update(&digestContext, digestLength, sizeof(digestLength));
response->authentication.digest[0] = digestContext.state[0];
response->authentication.digest[1] = digestContext.state[0] >> 8;
response->authentication.digest[2] = digestContext.state[0] >> 16;
response->authentication.digest[3] = digestContext.state[0] >> 24;
response->authentication.digest[4] = digestContext.state[1];
response->authentication.digest[5] = digestContext.state[1] >> 8;
response->authentication.digest[6] = digestContext.state[1] >> 16;
response->authentication.digest[7] = digestContext.state[1] >> 24;
response->authentication.digest[8] = digestContext.state[2];
response->authentication.digest[9] = digestContext.state[2] >> 8;
response->authentication.digest[10] = digestContext.state[2] >> 16;
response->authentication.digest[11] = digestContext.state[2] >> 24;
response->authentication.digest[12] = digestContext.state[3];
response->authentication.digest[13] = digestContext.state[3] >> 8;
response->authentication.digest[14] = digestContext.state[3] >> 16;
response->authentication.digest[15] = digestContext.state[3] >> 24;
for (index = 0; index < 4; index++) {
u32 word = digestContext.state[index];
response->authentication.digest[index * 4] = word;
response->authentication.digest[index * 4 + 1] = word >> 8;
response->authentication.digest[index * 4 + 2] = word >> 16;
response->authentication.digest[index * 4 + 3] = word >> 24;
}
{
u8* contextByte = (u8*)&digestContext;
for (index = 0; index < sizeof(digestContext); index++) {
@@ -1750,13 +1739,11 @@ s32 ATERMRunConfigProtocol(void) {
u32 checksum = 0;
u8* cursor = gAtermConfigurationResult.packetBuffer;
u8* packetEnd = packet->payload + payloadLength;
u8* payload = packet->payload;
u8* payload;
for (; cursor < packetEnd; cursor++) {
checksum += *cursor;
}
if ((u16)checksum != SONtoHs(*(u16*)packetEnd)) {
payload = NULL;
}
payload = (u16)checksum == SONtoHs(*(u16*)packetEnd) ? packet->payload : NULL;
if (payload == NULL) {
payloadLength = 0;
} else if (sequence != 5) {

View File

@@ -0,0 +1,75 @@
# Chinese phonetic callee contract, 2026-10-02
Base: 654c65dd; branch agent/bittle/chinese-source-reconstruction.
Changed source: libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c only.
This is type-correctness work with zero code-generation or percentage gain.
## Callee evidence
The actual Zi8MatchPhonetic definition in zi8match.c takes a byte-addressed
12-byte dictionary, a native-width ziU32 dictionary address, a byte record
pointer, and two byte-pointer outputs. In particular its stringOffset output
is ziU8**: it tests *stringOffset, compares a sound cursor against it, and
writes the sound cursor to it. It is not an integer index output.
The old zi8cgetc declaration instead described records and the record output
with a different struct-pointer type, the dictionary address as ziPtr, and
the string output as int*. The two engine calls cast &phoneticGroups to
int*. The third call, in Zi8NewMatchPhonetic, supplied an address-taken int
matchedIndex even though the callee wrote a pointer through it.
The corrected local declaration now has exactly the callee's parameter
representations and compatible C types:
- ziPtr for the opaque phonetic table
- ziU8* for the dictionary and current record
- ziU32 for the packed-table address
- ziU8** for the current-record and string-cursor outputs
- the unchanged matching halfword, byte and workspace parameter types
All three call sites were inspected and updated. The engine's real byte
pointer variables can now be passed by address directly, without incompatible
pointer-to-pointer casts. The small exact helper retains its typed dictionary
array but passes its byte address and uses actual byte-pointer output locals;
matchedString names the recovered cursor role. No shared header or callee
implementation is changed, and the pointer-to-native-word cast is explicit
only at the callee's existing native-address argument boundary.
## Isolated investigation
- Native 12-byte dictionary table indexing: codegen/metrics unchanged
- Named dictionary-record stride: codegen/metrics unchanged
- String-pointer output correction alone: codegen/metrics unchanged
- Complete callee contract, all three call sites: codegen/metrics unchanged
Only the callee-contract correction is retained. These are source-type
checks, not register/declaration-order permutations. The previously parked
halfword-result and component-cursor experiments were not repeated in this
candidate or combined incidentally.
## Validation
Baseline: /tmp/ezi-chinese-recon-baseline.json.
Final full report: /tmp/ezi-chinese-contract-full-report.json.
Full build: /tmp/ezi-chinese-contract-full-build.log.
Detailed checks: /tmp/ezi-chinese-contract-verification.txt.
All 1027 full-report unit measures are unchanged. Unit fuzzy remains
96.65468%; zi8InternalGetZH remains 96.27482%. Exact functions remain 5/8,
exact code 4168/47816, and exact data 144/536. No metric gain is claimed.
Compared with a preserved baseline object, every owned code/data section has
identical length, payload bytes and canonical relocation tuples:
.text 47816, .sdata2 16, .sbss2 8, .data 392, extab 48, extabindex 72.
The NOBITS section is checked by extent; all other payloads compare bytewise.
Pool first: identical and empty. All five baseline exact functions retain
ctxdiff diffs 0 with identical instruction counts:
Zi8SetFindCand 50, ZiGetNextPhonetic 31, ZiPartialMatch 51,
Zi8NewMatchPhonetic 755, Zi8GetChineseCandidates 155.
The unmatched engine remains 10676/10676 instructions; its code payload and
relocations are baseline-identical as well.
Full 43U build passes with the approved wrapper and WIBO_SJIS_MISSING_IMPORTS=1.
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d.
git diff --check passes. No linking, remote, metadata, shared-header, assembly,
volatile, artificial storage or register-forcing changes.

View File

@@ -0,0 +1,67 @@
# Chinese Zhuyin initial dispatch correction, 2026-10-02
Parent: 1b1a944a on base 654c65dd. The pointer-contract candidate is unchanged.
Changed source: two case-label lines in zi8cgetc.c / zi8InternalGetZH.
This is a demonstrated behavioral correction; aggregate metrics are neutral.
## Discovery
A complete fresh flow audit checked the compiler-generated switch tables as
well as direct branches. All 1594 mapped direct branches and all 168 ordered
helper calls agreed before this change. However, four of the 98 generated
switch relocation entries dispatched to the wrong semantic bodies. A direct
branch-only audit cannot see that defect, and the linear effect audit compares
both bodies without knowing which switch cases reach them.
The relevant switch uses the phonetic initial (match.phon2[index] >> 9),
subtracts case 24 for its 40-entry table and rejects indexes greater than39.
The table starts at .data+0x58. Its four incorrect entries were:
- .data+0xC8, case52: source selected bANDp; target selects gANDk
- .data+0xD4, case55: source selected bANDp; target selects gANDk
- .data+0xE8, case60: source selected gANDk; target selects bANDp
- .data+0xF4, case63: source selected gANDk; target selects bANDp
The bodies are identified by their actual tests of the workspace word at
0x1B2C: bANDp tests the bit at MSB-relative position10, while gANDk tests
position11. Both successful bodies store the same phonetic mask0xF9FF, but
they consult independent user fuzzy-pair settings. Crossing the labels
therefore changes behavior, even though both body instruction shapes match.
Target cases52/55 enter function+0x1288 (position11), while60/63 enter+0x1264
(position10). Current compiled bodies are four bytes later, and the corrected
entries now select their corresponding semantic bodies.
The fix swaps only the two case-label pairs, preserving body/source order,
header layout, tests, masks, all other cases and function size. It does not
change shared bitfield names to compensate for the bad dispatch.
## Verification
Fresh report: /tmp/ezi-chinese-switch-full-report.json.
Full build: /tmp/ezi-chinese-switch-full-build.log.
Detailed gates: /tmp/ezi-chinese-switch-verification.txt.
Switch/direct-flow audit: /tmp/ezi-chinese-switch-flow-audit.txt.
After correction, all 98 switch entries have corresponding target semantic
destinations, with zero destination mismatches. The four table extents remain
44,44,160,144 bytes. The 1594 mapped direct branches and168 ordered helper
calls also still agree. This is an advisory relocation/control-flow check,
not formal whole-program equivalence or a claim of exact assembly.
Every code/data section size and payload is baseline-identical. All normalized
relocations are unchanged except exactly the four corrected .data entries.
The .text section, extab and extabindex are unchanged byte-for-byte. The
engine stays10676/10676 instructions with the same0x4E0 frame.
All1027 unit measures are unchanged with no regressions. Unit fuzzy remains
96.65468%; engine fuzzy96.27482%. Exact functions5/8, code4168/47816 and
matched data144/536 are preserved. The switch section remains unmatched
because case body addresses still differ from the target; no percentage or
new exact function is claimed.
All five previously exact functions still have ctxdiff diffs0 and identical
instruction counts. Pool first: identical and empty. Full43U build passes
with the approved wrapper and WIBO_SJIS_MISSING_IMPORTS=1. DOL SHA1:
26116613f624061ba99c8d1a299aaa6efa85670d.
git diff --check passes. No shared header, metadata, link flag, assembly,
volatile, register/storage workaround, or remote action was changed.

View File

@@ -0,0 +1,57 @@
# Secondary component matcher workspace formal, 2026-10-02
Parent: bfcc8a44. Scope extension to zi8match.c was coordinated before editing.
Changed source: the Zi8SecMatchComp definition's parameter list only.
This is an interface correction with no percentage or code-generation gain.
## All-caller and callee evidence
A source-wide search finds one caller, in zi8InternalGetZH, and its explicit
four-argument declaration. A scan of every extracted43U object's relocation
tables likewise finds exactly one text reference, in zi8cgetc.o. The only
other direct symbol reference is the function's own extabindex entry.
No function-pointer data reference or second callsite was found.
The target caller at zi8InternalGetZH+0x8380 supplies the component cursor,
match object, dictionary base and workspace in argument registers3..6.
The workspace is the same saved incoming pointer used by the surrounding
engine helpers. This agrees with the reconstructed caller and its declaration.
The target callee is68 instructions /0x110 bytes and does not consume the
incoming fourth argument. Every path that reads register6 first defines a
new temporary there; no incoming workspace load or use is present. The
missing fourth formal is therefore an unused workspace parameter, consistent
with neighboring component matchers' ZI_NEED_WORK convention. Removing the
caller argument would contradict the target call sequence.
Added ZI_NEED_WORK to the existing definition, preserving its first three
formals and entire body. No local or storage was added, no value was made
volatile, and no register/spill was forced. The existing shared macro simply
expands to the same ziPtr workspace formal already declared by the caller.
No shared header or caller change was needed.
## Validation
Before-object: /tmp/ezi-chinese-reconstruction/zi8match-before-work-formal.o.
Fresh full report: /tmp/ezi-component-contract-full-report.json.
Build log: /tmp/ezi-component-contract-full-build.log.
Detailed checks: /tmp/ezi-component-contract-verification.txt.
All owned emitted sections have identical lengths, payloads and normalized
relocations: .text8256, .rodata528, extab80, extabindex120. The compiler
comment section is also unchanged. Symbol entries, relocation records and
section extents are unchanged; only compiler-generated anonymous extab names
in .strtab advance numerically after the additional formal. The entire object
file is therefore not byte-identical, but its emitted code/data and relocation
meaning are identical. No symbol-metadata edits were made to hide this.
All1027 full-report unit measures are unchanged. zi8match remains8/10 exact,
5172/8256 exact code,728/728 exact data and99.53004% unit fuzzy. All eight
baseline exact functions have ctxdiff diffs0 and identical instruction counts;
Zi8SecMatchComp remains68/68 instructions,0x110 bytes and exact100%.
Pool first: identical and empty. Full43U build passes with the approved
wrapper and WIBO_SJIS_MISSING_IMPORTS=1. DOL SHA1:
26116613f624061ba99c8d1a299aaa6efa85670d.
git diff --check passes. No remote, linking, shared-header, assembly, metadata,
artificial storage or undefined-value change.

View File

@@ -0,0 +1,102 @@
# Input-form source reconstruction, 2026-10-02/03 UTC
Base `cc812ad3`, branch `agent/bittle/input-form-reconstruction`, 43U only.
Only `src/keyboard/tiInputForm.cpp` and this log are changed. Existing attempt
logs, headers, metadata, compiler settings, linking flags and assembly bodies
are untouched.
## Retained changes and target evidence
### LayoutByNW4R::create
The first language text-pane lookup in the target loads the layout's root pane
and invokes FindPaneByName with the recursive flag. The old source instead
invoked the Layout virtual getPane slot. The retained source directly expresses
the root-pane lookup, recovering two missing instructions and the correct call
receiver path. The later const getLanguageTextPane fallback remains intact.
The animation loop in the target keeps the address of the selected files[] slot.
It loads the file for GetResource, then reloads that slot after the resource and
animation-transform calls to obtain the animation ID. The old source captured
the file pointer once. A const reference to the existing typed pointer slot now
expresses the target's lifetime and recovers the other two missing loads. No
new storage, qualifier forcing, table entry, or helper was introduced.
Together these changes restore the target's 356-instruction body. The fallback
name-selection block still schedules some receiver loads differently, and most
remaining differences concern register allocation. This is not an exact match.
### Base::calcCursorPos
The source now uses the already defined Rect::GetWidth accessor for glyph and
form widths. That existing accessor computes exactly right minus left. The
change preserves the arithmetic, hit-test inequalities, wrap/newline paths,
scroll handling, recursive fallback, and all helper calls. It recovers more of
the target's rectangle-expression boundaries at unchanged body size. Height
accessors and midpoint operand reversal did not improve the result and were not
retained. No new geometry abstraction or arithmetic reassociation was added.
## Attempts and rejected alternatives
- Read the previous sol-high-inputform and data-d4 logs. Revisited their concrete
root-query and file-slot defects under the user's current partial-decompilation
priority; did not repeat the historical declaration searches.
- Tested the two create corrections independently and together. Explicit fallback
selector locals produced the same code. Duplicating the root lookup in both
fallback branches grew the function to 363 instructions and was rejected.
- Tested small inline fallback-lookup wrappers; they added source complexity
without improving the retained result. A trial binding the derived layout
pointer to a base pointer reference did not compile and was restored.
- Existing width and height accessors and midpoint operand order were tested
independently. Only the width accessor change is retained.
- No artificial allocation sweep, new assembly, use-site volatile, dummy storage,
undefined input, padding, header edit, or linking experiment was used.
## Gates
Before -> after:
- calcCursorPos: 91.622696 -> 93.05215% fuzzy, 326/326 instructions unchanged;
final raw ctxdiff 50 differences (baseline 52, including existing relocation
aliases and floating-point scheduling/allocation differences).
- LayoutByNW4R::create: 95.02809 -> 96.40169% fuzzy, 352 -> 356 instructions against
target 356; final ctxdiff 155 differences.
- Unit fuzzy: 99.578094 -> 99.6535%.
- Existing objdiff-exact symbols: 218/221 unchanged; exact code 46980/50656 bytes;
matched data 3772/3772 (100%); linked status unchanged.
- Independently rebuilt the baseline and candidate objects. All 218 previously
objdiff-100 symbols have identical baseline/candidate instruction streams.
This preserves the pre-existing distinction between objdiff and raw ctxdiff
exactness rather than claiming every alias-normalized symbol has diffs 0.
- Baseline/candidate raw .data, .rodata, .bss, .sdata, .sbss, .sdata2 and .ctors
section bytes and extents are identical. All 20 pool strings match the target.
- Literal audit: 20 arguments checked, 221 functions analyzed, no candidates,
skips or errors. Target-sized create is now included in that audit.
- Full 1027-unit report: no exact-function, exact-code, data or fuzzy regressions.
- Full 43U build and build/43U/ok passed, again after rebuilding the baseline and
restoring the candidate. DOL SHA1:
`26116613f624061ba99c8d1a299aaa6efa85670d`.
## Focused behavior coverage and limits
A private host harness extracts the production baseline/candidate calcCursorPos
bodies without rewriting them, supplies the same Rect::GetWidth expression, and
uses deterministic font/scale/wrap stubs. Compiled with single-precision float,
-fno-fast-math and -ffp-contract=off, it checks returned positions, helper-call
traces and wrap counters across empty text, newlines, forced word wraps, width
wraps, boundary hits, scale, non-positive scroll and recursive fallback.
159,320 terminating cases agreed. Another 680 synthetic font/wrap states reached
the same 1,000-scale-call model budget with identical traces in both versions;
no termination claim is made for those states. The initial unrestricted harness
also reached its budget in the baseline, so this is equivalence coverage for the
accessor change, not proof of general termination or a newly diagnosed Wii bug.
The layout/resource creation path is validated by target call/load evidence and
the real 43U compile; no Wii UI/runtime execution is claimed.
Private local evidence: `/tmp/input-form-reconstruction/` contains baseline/final
reports and object copies, pool/literal audits, both final ctxdiffs, build logs,
validate_cursor.py and cursor-tests.log, plus rejected experiments. No retail
assembly or binary is committed or uploaded.
GATE: validated partial source/control/data-flow reconstruction; no regressions.
Exact matching and linking remain open. Candidate frozen for parent validation.

View File

@@ -0,0 +1,99 @@
# NHTTP stdlib source reconstruction, 2026-10-02
Base `b26e248b`, branch `agent/bittle/nhttp-source-reconstruction`, 43U only.
Owned source: `libs/RevoEX/src/nhttp/NHTTP_stdlib_RVL.c`. No headers, metadata,
configuration, linking flags, binary data, or other source files changed.
The earlier `four-leaves-r9.attempts.md` and other worker logs are untouched.
## Target-grounded changes
### NHTTPi_compareToken
The target enters through its case-folded equality test, then checks the raw left
byte for NUL/space before advancing the two pointers. It retains the unsigned
byte separately and sign-extends it for both the case fold and termination check.
The baseline unconditional loop placed that control-flow boundary differently
and compiled to 44 instructions rather than the target's 45.
The retained while condition captures the raw u8 load and explicitly sign-extends
it into LowerCase. The body reuses that captured byte for termination. LowerCase
returns its conditional value directly, preserving the target's separate folded
value lifetime. This recovers the complete 45-instruction control-flow shape.
The common helper's other callers remain unchanged at the instruction level.
A separate token-only helper gave the same result; it was removed to avoid
unnecessary duplication.
Remaining differences: two initial constant loads are reversed, and eight
instruction operands use different scratch/callee-saved registers. This is not
an exact match.
### NHTTPi_Base64Encode
The target retains signed length/padding comparisons. The length local is now
s32, matching those comparisons without the previous mixed-sign comparisons.
Each quartet snapshots its three signed input bytes before writing the output,
then combines each later byte's high fragment with the preceding byte's masked
low fragment. This expresses the target's byte-load and index dependency
structure more closely, preserving the 119-instruction body size.
The target and existing implementation use signed byte shifts, a NUL-terminated
input, and full three-byte reads even for a short final group. This candidate does
not broaden the API to arbitrary binary data or repair those original constraints.
The repository's caller supplies a separate temporary source and authorization
output buffer (`d_nhttp.c`, NHTTP_CreateRequest proxy authorization path).
## Experiments
- Recovered the previously logged loop-test/raw-byte/ternary-fold approach rather
than repeat register/declaration searches. Local conditional-loop alternatives
were measured against the target before retaining the compact while condition.
- One exploratory assignment/read condition was found to be unsequenced. It was
withdrawn, never behavior-tested, and is not part of the retained source.
- Signed/unsigned/raw byte representations and explicit sextet fragments were
checked against target load/sign-extension evidence. Signed byte snapshots
with the retained index grouping gave the best compact source.
- Stream-cursor forms generated identical code and were not retained.
- A separate quartet helper improved Base64 only 67.63025 -> 67.79832%; it was
discarded as unnecessary source expansion. There is no new helper in the diff.
- No declaration/register sweep, inline assembly, use-site volatile, dummy value,
padding, compiler-option change, or linking experiment was performed.
## Verification
Before -> after:
- NHTTPi_compareToken: 54.622223 -> 98.844444% fuzzy; 44 -> 45 instructions against
target 45. Final ctxdiff: 10 positional differences.
- NHTTPi_Base64Encode: 60.285713 -> 67.63025% fuzzy; 119/119 instructions unchanged.
Final ctxdiff: 67 positional differences (baseline 58); aligned objdiff improves
despite that positional metric. Exact dependency scheduling remains open.
- Unit fuzzy: 87.93594 -> 93.03203%.
- Exact functions 11/14, exact code 1388/2248, data 112/112 (100%) and linked status
are unchanged. All 11 previously exact functions have ctxdiff diffs 0.
- The unchanged strnicmp remains 99.76471%, 51/51 instructions, two constant-order
differences. LowerCase's other exact users remain exact.
- Pool: the one alphabet string is identical. .data's 65 bytes and .rodata's
36 bytes equal the prefixes of their 72-byte/40-byte target sections. Existing
trailing target alignment extents are unchanged; no padding was introduced.
- Literal-reference audit: 14 functions analyzed, no candidates, skips or errors;
zero statically addressed call arguments, so this is not a separate proof of
complete data matching.
- Full 1027-unit report: zero exact-function/code/data/fuzzy regressions.
- Full 43U build and build/43U/ok passed. DOL SHA1 remains
`26116613f624061ba99c8d1a299aaa6efa85670d`.
Host behavior validation compiles both unchanged production sources (baseline
and candidate) with -fsigned-char and fixed-width SDK type shims:
- 75,536 compareToken cases: all 65,536 first-byte pairs plus 10,000 seeded
multi-byte/case-fold/mismatch cases, against an independent token reference.
- 3,033 Base64 cases: known answers, every length 0..1024, and 2,000 seeded ASCII
strings up to 4096 bytes, against Python base64. Return length, NUL terminator
and a 16-byte output canary are checked. Inputs have readable zero tail bytes
for the original full-triplet reads. High-bit/binary inputs are not claimed.
Private local evidence: `/tmp/nhttp-source-reconstruction/` contains baseline and
final reports, all function ctxdiffs, pool/literal audits, full-build.log,
validate_nhttp.py, vectors.log, and the rejected local experiments. No retail
assembly or binary is included in this commit.
GATE: validated partial control/data-flow/type reconstruction; no regressions.
Exact matching and linking remain open. Frozen for independent parent validation.

View File

@@ -0,0 +1,96 @@
# BS2 update-thread publication recovery, 2026-10-02
Baseline b26e248b. Source-only candidate in src/BS2/BS2Update.c.
The assignment's .cpp spelling was checked; this unit is C.
## Retained target-proven declarations
- EntriesCount: original UpdateThread object offsets 0xC2C/0xC30 store the
selected count then immediately reload it, with no intervening call or store.
The old source tests the still-live local count and omits that reload.
Definition-level volatile restores the published global read.
- State: target writes the failure state at 0x4F4 and 0xB4C before joining
selection completion. The zero-selection exit writes State=5 again at 0xC44.
The old source loses the first two store sequences because MWCC sees a later
overwrite without an intervening function call. Definition-level volatile
restores both observable failure-state publications. State is also exposed
through BS2UpdateState for polling by the boot state machine.
These are real existing state objects. No use-site qualifier casts, added
storage, fabricated barriers, assembly, metadata, or linking changes.
## Measurements
| Source form | UpdateThread fuzzy | Instructions |
| --- | ---: | ---: |
| Baseline | 93.59803% | 904/913 |
| EntriesCount publication reread | 93.90471% | 905/913 |
| Also preserve State publications | 94.5575% | 909/913 |
Unit fuzzy improves 94.23001% -> 95.094765%. Exact code remains 400/4052,
exact functions 9/10, data 10488/10488. This is partial source reconstruction,
not an exact function or linking candidate.
Rejected independent source-structure experiments, based on the count-reread
candidate: explicit selected-entry byte progression (93.73275%, 905/913),
seatholder byte progression (93.47755%, 905/913), and separate disc-base
expressions in error logging (93.56955%, 905/913). All were restored. The
remaining four missing target instructions are a repeated entry.type read and
three address-materialization differences. Register allocation and scheduling
also differ. The type declaration requires separate shared-header review.
## Fresh verification
- Configured only 43U with ../toolchain/wibo-build/wibo
- WIBO_SJIS_MISSING_IMPORTS=1 ../.venv/bin/ninja all_source build/43U/report.json build/43U/ok
- Pool: 55/55 identical
- Exact-name report and fresh ctxdiff preserve all nine exact functions
- Literal audit: 5 arguments across 9 exact functions, no skips/candidates/errors
- Every other unit's complete report unchanged; no per-function regression
- All four data sections still report 100%
- git diff --check passes
- DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d
GATE: source-only nonregression/build/pool/DOL checks pass. Awaiting independent
parent review; no complete decompilation, matching, or linking claim.
## Separate shared entry-type declaration
Parent authorized a separate experiment on the actual shared type declaration,
without a translation-unit-specific qualifier. Changed BS2UpdateEntry.type to
vu32 in include/BS2/BS2Update.h for every consumer.
Original UpdateThread offsets 0xCE8 and 0xD00 read the same entry.type field.
Between them are only the type-zero branch and its skipped increment/continue
path: the nonzero path has no call or write that could require a normal reload.
The shared declaration restores that second observable read. No new guard or
use-site qualifier cast was introduced.
- UpdateThread: 94.5575% -> 94.66265%, 909 -> 910/913 instructions
- Overall from initial baseline: 93.59803% -> 94.66265%, 904 -> 910/913
- Unit fuzzy: 94.23001% -> 95.18954%
- Exact functions remain 9/10 and code remains 400/4052
- Data remains 10488/10488, with every allocated non-text byte unchanged
All generated source objects were deleted and rebuilt with the configured 43U
all_source/report/ok targets. The prior cache had 1028 objects, including an
obsolete keyboard/tiManager.o absent from build.ninja, objdiff.json, and
configure.py. The current build graph cleanly rebuilt all 1027 configured
objects. Hash comparison of those objects against the source-only checkpoint
found only BS2Update.o changed. All 1026 other unit reports are identical.
This includes every shared-header consumer; none needed source adjustment.
Fresh final pool: 55/55 identical. Literal audit: 5 arguments across 9 exact
functions, no skips/candidates/errors. Fresh ctxdiff preserves all 9 exact
functions. DOL SHA1 remains 26116613f624061ba99c8d1a299aaa6efa85670d.
git diff --check passes.
The final three missing target instructions are address materializations:
seatholder table construction uses separate load/add in the target, and both
error-log calls materialize their own disc-table base. These are not omitted
source operations; register and scheduling differences remain as well. No
register sweep or artificial materialization was retained.
GATE: clean all-source build, cross-unit/object nonregression, complete data,
pool, exact-function preservation, and DOL checks pass. Leaf frozen for
independent parent review. Both commits are partial reconstruction gains.

View File

@@ -0,0 +1,77 @@
# Card icon and move/copy reconstruction
Base: `13881c99`; branch `agent/bittle/card-icon-reconstruction`.
Owned source: `src/scene/cardSequence/iplCardSequence.cpp` only.
No headers, linking configuration, assembly, forced registers, volatile casts,
undefined values, or dummy storage were introduced.
## Retained: reset the temporary name on every move rename attempt
The target's rename-collision loop returns to the filename clearing call before
formatting the next temporary name. The reconstruction returned directly to the
formatting call, clearing the filename only on the first attempt.
Moved the existing filename `memset` into the `do` loop. This changes exactly one
compiled branch instruction word; every other allocated byte in the object is
unchanged from the baseline. It restores the target's per-attempt reset boundary.
It is not a claim that ordinary fixed-width temporary names previously produced
incorrect filenames; the SDK status routine also normalizes trailing name bytes.
- `runCardMoveOrCopy`: 97.804276 -> 97.8125 fuzzy
- Instructions: 608/608; ctxdiff differences: 186 -> 185
- Unit fuzzy: 97.198944 -> 97.20097
- Exact functions remain 27/30; matched code remains 4168/9852 bytes
- All 30 function scores preserved or improved
- All 27 exact functions checked individually: objdiff 100, ctxdiff zero
- Data remains 1496/1496 bytes exact
## Validation
- Full 43U build: PASS
- Pool before and after: identical, 43 strings
- Literal-reference advisory: 45 arguments in 29 functions; no candidates or
errors. The unequal-sized icon loader was skipped; it was not changed
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`
- Base-relative `git diff --check 13881c99`: PASS
A focused compiled-PPC loop audit passed 192 cases covering both slots, file
numbers 0/63/126, collision counts 0/1/2/7/63/126/127/128, and final results
0/-3/-7/-10. Candidate instruction execution produced the target's memory state
and call trace in every case. The baseline omitted the repeated clear in 174
cases. `memset`, `sprintf`, and status results were modeled, so this is bounded
loop evidence, not execution of the complete copy/move operation or Wii runtime.
## Icon-loader audit and deferred boundary
The loader was inspected against the target and tested with a bounded integer
PPC interpreter using modeled CARD, memory-copy and cache-store calls.
- 841 valid-format, bounds and error cases agreed on return values, modeled
call traces and non-stack memory, including guard regions
- Both slots and file-table endpoints, banner modes, icon formats 0/1/2,
animation speeds, sector errors, image/comment read failures, close failures,
and offset boundaries were exercised
- Valid-case instruction coverage was 506/508 source and 511/512 target; this is
instruction-address coverage, not exhaustive inputs or paths
- All interpreted calls checked SP, LR and nonvolatile GPR restoration
Six reserved-format examples exposed a separate difference: after a preceding
valid icon, format 3 retains the preceding icon's byte size in the target, while
the current source resets it to zero. This affects later offsets and modeled
image-read lengths. Format 3 is not among the SDK's supported icon formats.
When the first icon has format 3, the target has no uniquely established initial
size; that unspecified boundary must not be reconstructed with an invented
initial value or an uninitialized C local.
An explicitly initialized carry trial agreed with the six later-format-3 cases
and all 841 earlier cases, but reduced loader fuzzy from 90.34375 to 90.14844.
It was restored. Its patch and bounded evidence are preserved privately for
possible later review. The retained source does not claim to correct this
reserved-input boundary or to establish general runtime correctness.
## Existing external branch
Read-only inspection of the already fetched `origin/agent/w1008/card2` at
`14b921b3` found a restructuring of the image-read success/error join. It has the
same effective error propagation as the current source. It was not copied,
merged, or used as a replacement implementation; no remote action was taken.

63
tools/progress_badges.py Normal file
View File

@@ -0,0 +1,63 @@
#!/usr/bin/env python3
"""Write shields.io endpoint JSON files from an objdiff report.
usage: progress_badges.py <report.json> <out-dir>
The README badges read these files from the progress-data branch, so the
numbers update without committing to main.
"""
import json
import os
import sys
COLOR = "33b8ff"
DONE_COLOR = "brightgreen"
def badge(label, message, done):
return {
"schemaVersion": 1,
"label": label,
"message": message,
"color": DONE_COLOR if done else COLOR,
"labelColor": "7c7c7c",
"style": "plastic",
}
def percent(measures, key):
value = float(measures.get(key) or 0.0)
return f"{value:.2f}%", value >= 100.0
def count(measures, done_key, total_key):
done = int(measures.get(done_key) or 0)
total = int(measures.get(total_key) or 0)
return f"{done:,} / {total:,}", total > 0 and done == total
def main():
if len(sys.argv) != 3:
raise SystemExit(__doc__)
report_path, out_dir = sys.argv[1], sys.argv[2]
measures = json.load(open(report_path))["measures"]
badges = {
"decompiled": ("Decompiled", percent(measures, "fuzzy_match_percent")),
"matched": ("Matched", percent(measures, "matched_code_percent")),
"linked": ("Linked", percent(measures, "complete_code_percent")),
"data": ("Data", percent(measures, "matched_data_percent")),
"functions": ("Functions", count(measures, "matched_functions", "total_functions")),
"units": ("Units", count(measures, "complete_units", "total_units")),
}
os.makedirs(out_dir, exist_ok=True)
for name, (label, (message, done)) in badges.items():
with open(os.path.join(out_dir, f"{name}.json"), "w", encoding="utf-8") as f:
json.dump(badge(label, message, done), f)
f.write("\n")
print(f"{label}: {message}")
if __name__ == "__main__":
main()