Compare commits

...

6 Commits

Author SHA1 Message Date
coah
ac78229543 ci: live README progress badges from a progress-data branch
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 23:46:42 +00:00
coah
3d3448e3a8 decomp(kbd): reconstruct asynchronous LED dispatch and completion (#993) 2026-10-02 18:42:29 -05:00
coah
654c65dd27 decomp: align EXIF rational denominator address structure (#992) 2026-10-02 18:37:40 -05:00
coah
bb93684b95 decomp: reconstruct alpha boundary and output expressions (#991) 2026-10-02 18:37:35 -05:00
coah
39648c8aa6 decomp(aes): reconstruct final-round word dependencies (#990) 2026-10-02 18:37:29 -05:00
coah
230c3af28f decomp: recover typed partition word decoding (#989) 2026-10-02 18:37:04 -05:00
12 changed files with 473 additions and 74 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

@@ -366,7 +366,7 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
return;
}
pInfo->xResNum = readU32(p, byteOrder);
p = (const u8*)(pInfo->thumbnailData + offset + 4);
p = pInfo->thumbnailData + (offset + 4);
if (pInfo->thumbnailData > p) {
return;
}
@@ -386,7 +386,7 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
return;
}
pInfo->yResNum = readU32(p, byteOrder);
p = (const u8*)(pInfo->thumbnailData + offset + 4);
p = pInfo->thumbnailData + (offset + 4);
if (pInfo->thumbnailData > p) {
return;
}

View File

@@ -1138,7 +1138,7 @@ prepareCandidate:
Zi8ChangeWordCase(wordCursor - prefixCount,language,workData);
}
if ((((ZiAlphaOptions*)optionData)->suffixOnly != '\0') &&
((int)((ZiAlphaOptions*)optionData)->maxWordLength < (int)(wordLength + prefixCount))) {
((wordLength + prefixCount) > ((ZiAlphaOptions*)optionData)->maxWordLength)) {
wordLength = ((ZiAlphaOptions*)optionData)->maxWordLength - prefixCount;
wordCursor[wordLength] = 0;
}
@@ -1210,11 +1210,11 @@ emitCandidate:
for (index = 0; index <= wordLength; index++) {
if (wordCursor[index] != ((ZiAlphaOptions*)optionData)->dictionary[index]) break;
}
if ((((((ZiAlphaWork*)workData)->operation != '\0') || ((int)wordLength <= index))
if ((((((ZiAlphaWork*)workData)->operation != '\0') || (index >= wordLength))
&& ((((ZiAlphaWork*)workData)->operation == '\0' ||
((exactLengthOnly == 0 ||
((int)(ziU16)Zi8WCharCount(((ZiAlphaOptions*)optionData)->dictionary,workData) <= index)))))) &&
((exactLengthOnly != 0 || ((int)wordLength <= index)))) {
(index >= (int)(ziU16)Zi8WCharCount(((ZiAlphaOptions*)optionData)->dictionary,workData))))))) &&
((exactLengthOnly != 0 || (index >= wordLength)))) {
candidateCount = 1;
goto finishCandidates;
}
@@ -1373,7 +1373,7 @@ finishDictionaryPass:;
(((parameters->elementCount == 1 &&
(((Zi8GetTableCount(parameters->language,0x1f,workData)) & 0x40) == 0)) &&
(*parameters->elements >= 0xeff1)))))) &&
((*parameters->elements < 0xf011 &&
((*parameters->elements <= 0xf010 &&
((Zi8getKeyLayout(parameters->language,*parameters->elements,&punctuationBuffer[0],1,workData)) != '\0')))) {
punctuationCandidate = ZI8_TRUE;
}
@@ -1569,17 +1569,17 @@ checkPrefixFields:
finishCandidates:
((ZiAlphaWork*)workData)->usePrefixAsElements = 0;
if (((ZiAlphaOptions*)optionData)->countOnly == '\0') {
parameters->letters = candidateCount;
if (((ZiAlphaOptions*)optionData)->countOnly != '\0') {
parameters->letters = 0;
}
else {
parameters->letters = 0;
parameters->letters = candidateCount;
}
wordCursor[-prefixCount] = 0;
if (((((ZiAlphaOptions*)optionData)->countOnly == '\0') && (((ZiAlphaOptions*)optionData)->lookupMode == '\0')) && (parameters->elementCount != 0)) {
elementIndex = parameters->elementCount - 1;
if (((primaryVowelRestriction) || (secondaryVowelRestriction)) &&
((((ZiAlphaWork*)workData)->prefixEnabled < 2 ||
((((ZiAlphaWork*)workData)->prefixEnabled <= 1 ||
(parameters->elements[elementIndex] == 0xEFF1)))) {
index = 0;
while (elementIndex >= 0) {

View File

@@ -1,11 +1,15 @@
#include <private/fa/pdm.h>
#include <revolution/types.h>
#define MBR_WORD(buf, offset) (((pf_u32)(buf)[(offset) + 3] << 24) + ((pf_u32)(buf)[(offset) + 2] << 16) + ((pf_u32)(buf)[(offset) + 1] << 8) + (buf)[offset])
static inline pf_u16 read_boot_u16(pf_u8* buf, pf_u32 offset) {
if ((pf_u32)&buf[offset] & 1) { return (buf[offset + 1] << 8) | buf[offset]; }
return PF_SWAP_16(*(pf_u16*)&buf[(offset + 1) & ~1]);
}
static inline pf_u32 read_partition_u32(const pf_u8* buf, pf_u32 offset) {
return (((pf_u32)buf[offset + 2] << 16) + buf[offset]) +
(((pf_u32)buf[offset + 3] << 24) + ((pf_u32)buf[offset + 1] << 8));
}
pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mbr) {
pf_s16 index;
pf_u32 start[4];
@@ -18,8 +22,8 @@ pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mb
p_count = count;
for (index = 0; index < 4; index++) {
*p_start = 0;
*p_start = (((pf_u32)buf[456] << 16) + buf[454]) + (((pf_u32)buf[457] << 24) + ((pf_u32)buf[455] << 8));
*p_count = (((pf_u32)buf[460] << 16) + buf[458]) + (((pf_u32)buf[461] << 24) + ((pf_u32)buf[459] << 8));
*p_start = read_partition_u32(buf, 454);
*p_count = read_partition_u32(buf, 458);
if (*p_start != 0 && *p_count != 0) {
if (index == 0) { *p_is_mbr = 1; }
} else {
@@ -91,14 +95,14 @@ pf_s32 pdm_part_get_start_sector(PDM_PARTITION* p_part) {
if (err != 0) { return err; }
pdm_part_is_master_boot_sector(buf, p_part->p_disk->disk_info.total_sectors, &is_mbr);
if (is_mbr) {
start[0] = MBR_WORD(buf, 454);
start[1] = MBR_WORD(buf, 470);
start[2] = MBR_WORD(buf, 486);
start[3] = MBR_WORD(buf, 502);
count[0] = MBR_WORD(buf, 458);
count[1] = MBR_WORD(buf, 474);
count[2] = MBR_WORD(buf, 490);
count[3] = MBR_WORD(buf, 506);
start[0] = read_partition_u32(buf, 454);
start[1] = read_partition_u32(buf, 470);
start[2] = read_partition_u32(buf, 486);
start[3] = read_partition_u32(buf, 502);
count[0] = read_partition_u32(buf, 458);
count[1] = read_partition_u32(buf, 474);
count[2] = read_partition_u32(buf, 490);
count[3] = read_partition_u32(buf, 506);
part_index = 0;
for (index = 0; index < 4; index++) {
sector = start[index];
@@ -112,15 +116,15 @@ pf_s32 pdm_part_get_start_sector(PDM_PARTITION* p_part) {
sector = base;
for (extended_index = 0; extended_index < 2; extended_index++) {
if (extended_index == 0) {
sector = sector + MBR_WORD(buf, 454);
length = MBR_WORD(buf, 458);
sector = sector + read_partition_u32(buf, 454);
length = read_partition_u32(buf, 458);
err = pdm_disk_physical_read(p_part->p_disk, buf, sector, 1, 512, &success);
if (err != 0) { return err; }
if (requested == part_index) { p_part->start_sector = sector; p_part->total_sector = length; return 0; }
part_index++;
} else {
sector = base + MBR_WORD(buf, 470);
length = MBR_WORD(buf, 474);
sector = base + read_partition_u32(buf, 470);
length = read_partition_u32(buf, 474);
if (sector == 0 || length == 0) { break; }
err = pdm_disk_physical_read(p_part->p_disk, buf, sector, 1, 512, &success);
if (err != 0) { return err; }

View File

@@ -557,15 +557,11 @@ static void kbdSendKey(KBDKeyEventData* event) {
}
}
static inline u32 kbdChannelFlags(u32 channel) {
return kbdData[channel].flags;
}
static void kbd_led_handler(BOOL success, void* callbackArg) {
const KBDLEDCallbackData* callback;
u32 index;
s32 index;
u32 err;
index = (u32)callbackArg;
index = (s32)callbackArg;
callback = &kbdLCBuf[index];
kbdCmdBuf[index].device = 0;
if (callback->callbackAddress == (USBKBDCmdLEDCallback)(u32)kbdCmdBuf[index].device) {
@@ -579,12 +575,11 @@ static void kbd_led_handler(BOOL success, void* callbackArg) {
err = 0;
break;
}
kbdLCBuf[index].callbackAddress(err, kbdLCBuf[index].callbackArg);
kbdLCBuf[(u32)callbackArg].callbackAddress(err, kbdLCBuf[(u32)callbackArg].callbackArg);
}
USBKBDErr KBDSetLedsAsync(u32 channel, u32 leds, USBKBDCmdLEDCallback callback, void* callbackArg) {
s32 index;
u32 ofs;
u32 index;
u8 ledBits;
BOOL interrupts;
USBKBDErr result;
@@ -594,14 +589,18 @@ USBKBDErr KBDSetLedsAsync(u32 channel, u32 leds, USBKBDCmdLEDCallback callback,
if (channel >= 4) {
return 4;
}
if ((s32)kbdChannelFlags(channel) == 1 || (s32)kbdChannelFlags(channel) == 4) {
return 5;
{
KBDChannel* data = &kbdData[(s32)channel];
if ((s32)data->flags == 1 || (s32)data->flags == 4) {
return 5;
}
}
ledBits = leds;
interrupts = OSDisableInterrupts();
for (index = 0, ofs = 0; index < 12; index++, ofs += sizeof(KBDLEDCommand)) {
if (*(u32*)&((u8*)kbdCmdBuf)[ofs] == 0) {
*(u32*)&((u8*)kbdCmdBuf)[ofs] = (u32)kbdData[channel].device;
for (index = 0; index < 12; index++) {
if (kbdCmdBuf[(s32)index].device == 0) {
KBDChannel* data = &kbdData[channel];
kbdCmdBuf[(s32)index].device = (u32)data->device;
break;
}
}
@@ -609,11 +608,14 @@ USBKBDErr KBDSetLedsAsync(u32 channel, u32 leds, USBKBDCmdLEDCallback callback,
if (index == 12) {
return 7;
}
kbdLCBuf[index].callbackAddress = callback;
kbdLCBuf[index].callbackArg = callbackArg;
result = USBKBDSetLEDAsync((u32)kbdData[channel].device, ledBits,
(USBKBDCmdLEDAsync*)&kbdCmdBuf[index],
kbd_led_handler, (void*)index);
{
KBDChannel* data = &kbdData[channel];
kbdLCBuf[index].callbackAddress = callback;
kbdLCBuf[index].callbackArg = callbackArg;
result = USBKBDSetLEDAsync((u32)data->device, ledBits,
(USBKBDCmdLEDAsync*)&kbdCmdBuf[index],
kbd_led_handler, (void*)index);
}
switch (result) {
default:
return 7;

View File

@@ -171,9 +171,9 @@ static const u32 AESiDecryptTable[] = {
#define ROTATE(x,n) (((x) << (n)) | ((x) >> (32 - (n))))
#define ENCRYPT(a,b,c,d) (((ROTATE(AESiEncryptTable[((b)>>16)&255],16) ^ ROTATE(AESiEncryptTable[(a)>>24],24)) ^ AESiEncryptTable[(d)&255]) ^ ROTATE(AESiEncryptTable[((c)>>8)&255],8))
#define DECRYPT(a,b,c,d) (((ROTATE(AESiDecryptTable[((b)>>16)&255],16) ^ AESiDecryptTable[(d)&255]) ^ ROTATE(AESiDecryptTable[(a)>>24],24)) ^ ROTATE(AESiDecryptTable[((c)>>8)&255],8))
#define SUBSTITUTE(table,a,b,c,d) (((u32)table[(a)>>24]<<24) | ((u32)table[((b)>>16)&255]<<16) | ((u32)table[((c)>>8)&255]<<8) | table[(d)&255])
#define SUBSTITUTE(table,a,b,c,d) ((((u32)table[(a)>>24]<<24) | table[(d)&255]) | (((u32)table[((b)>>16)&255]<<16) | ((u32)table[((c)>>8)&255]<<8)))
#define SUBSTITUTE_XOR(table,a,b,c,d) (((u32)table[(a)>>24]<<24) ^ ((u32)table[((b)>>16)&255]<<16) ^ ((u32)table[((c)>>8)&255]<<8) ^ table[(d)&255])
#define SUBSTITUTE_XOR(table,a,b,c,d) (((((u32)table[(a)>>24]<<24) ^ table[(d)&255]) ^ ((u32)table[((c)>>8)&255]<<8)) ^ ((u32)table[((b)>>16)&255]<<16))
void AESiEncryptBlock(AESContext* context, u32* output, const u32* input) {
u32 rounds = context->rounds;

View File

@@ -0,0 +1,83 @@
# AES final-round word reconstruction, 2026-10-02
Base: `813660b9` plus local cherry-pick `97035641` of the parent's already queued
`fce31442`. The imported candidate and its log are unchanged. This follow-on
changes only two final-round expression lines in `libs/RevoEX/src/net/aes.c`
and this new log. 43U only; no configuration, metadata, headers or linking edits.
## Retained reconstruction
The last cipher round substitutes four bytes, places them in distinct unsigned
word lanes, and combines them before AddRoundKey. Encryption combines the high
and low lanes, combines the two middle lanes, then ORs those pieces. Decryption
combines high/low first, then the lower-middle and upper-middle lanes by XOR.
These expressions preserve byte indices, shifts, S-box identity, key traversal,
output order and all input/state reads. The four lane contributions are disjoint;
all operands are unsigned and have no side effects. No value, algorithmic path,
or table is newly invented. This is arithmetic-dependency reconstruction rather
than a new implementation or an exact-match claim.
The target evidence is the original split object's final substitution and
packing regions in `AESiEncryptBlock` and `AESiDecryptBlock`. Those regions
contain the same sixteen byte loads and word-lane insertion/XOR operations.
The retained grouping improves the whole-function instruction similarity at
the target's existing body sizes. It does not reproduce every target dependency
or register assignment: exact matching remains open, and positional ctxdiff
counts are slightly worse despite the improved aligned objdiff scores.
## Explored alternatives
- MD5 third-round Boolean grouping and four typed step helpers were tested.
The best small Boolean change only reached 94.37255% from 94.30719%; a larger
helper reached 94.43791%. Both were discarded as too little benefit for the
added change. MD5 source is byte-for-byte unchanged.
- Typed inverse-key word, round and complete-schedule helper scopes were tested.
A round helper reached 69.72908% decrypt similarity, but interacted poorly
with the better final-round grouping. No helper is retained.
- Fusing AddRoundKey into each intermediate column regressed both directions.
- Typed final-substitution helpers, packed-byte intermediates, and explicit
T-table column helpers were evaluated. Their source complexity was unnecessary
or they scored below the two retained macro changes.
- Twelve unsigned lane-combination expressions were checked for each final-round
macro. Two independently improving forms are retained. No register/declaration
sweep, assembly, volatile qualifier, undefined value, padding or compiler-option
change was used.
## Verification
Before -> after:
- AESiEncryptBlock: 62.58228 -> 65.81013% fuzzy; 158/158 instructions unchanged;
final ctxdiff 137 positional differences (baseline 133).
- AESiDecryptBlock: 67.64143 -> 69.69323% fuzzy; 251/251 instructions unchanged;
final ctxdiff 227 positional differences (baseline 224).
- AES unit: 79.601746 -> 81.09157% fuzzy; exact functions 7/9 and exact code
1116/2752 bytes unchanged. Data 2800/2800 (100%) and linking unchanged.
- All seven exact AES APIs/CBC functions retain objdiff 100% and ctxdiff diffs 0:
NETAESCreateEx 108/108, NETAESCreate 2/2, NETAESDelete 1/1, NETAESEncrypt 46/46,
NETAESDecrypt 46/46, NETiAESEncryptoBlock 39/39, NETiAESDecryptoBlock 37/37.
- AES pool: all four strings identical. .rodata 2592 bytes and .sdata2 8 bytes
identical. .data has the same 197-byte prefix of the 200-byte target, retaining
the existing three-byte target alignment extent; no padding was introduced.
- MD5 remains unit 96.179825%, ProcessBlock 94.30719% (306/306 instructions),
exact functions 3/4, exact code 600/1824, data 456/456. Its three exact APIs
retain ctxdiff diffs 0. All 448 .data bytes are identical; .sdata retains its
existing one-byte source/seven-byte target-alignment extent difference.
- Full 1027-unit report: no exact-function, exact-code, data or fuzzy regression
versus the locally imported parent candidate.
- Full 43U build and build/43U/ok passed. DOL SHA1 remains
`26116613f624061ba99c8d1a299aaa6efa85670d`.
Host tests compile production source unchanged with private copies of the existing
PPC type/intrinsic shims. Both final AES and the imported parent baseline passed
all 2,406 AES-128/192/256 known-answer and seeded randomized CBC checks, including
separate/in-place buffers and single/incremental calls. Unchanged MD5 passed all
3,088 known-answer/random/chunking checks. The MD5 test supplies RFC1321 padding
externally; GetDigest's target-endian length stores remain outside host coverage.
Private local evidence: `/tmp/crypto-reconstruction-next/` contains baseline/final
reports, pool/section/ctxdiff results, full-build.log, host validation scripts and
results, and the rejected experiments. No retail assembly or binary is committed
or uploaded. Prior worker logs under `/tmp/crypto-remainder/` are untouched.
GATE: validated partial arithmetic reconstruction with no report regressions.
Exact matching and linking remain open. Candidate frozen for parent validation.

View File

@@ -0,0 +1,99 @@
# Alpha comparison and output boundary follow-on, 2026-10-02
Base: 813660b9 plus unchanged one-key candidate 2ec4a57e, locally fe647fe4.
Changed source: libs/RVLMiddleware/eZiText/src/clib/zi8alpha.c only.
No ABI, shared header, linking flag or other source change is included.
## Retained target source structure
- At function +0x25A8, the suffix truncation condition compares the combined
word/prefix length first and branches on less-or-equal. Recovered that
operand order. The separate bound check at +0x25E0 has the opposite operand
order and is deliberately preserved.
- The dictionary lookup comparisons at +0x2948, +0x2978 and +0x2990 compare
the dictionary scan index first against word length or the halfword-narrowed
dictionary count. Recovered those three relational expressions without
changing the count helper's declaration or its halfword conversion.
- The punctuation fallback at +0x30F8 compares against 0xF010 and uses a
strict greater-than failure branch. Replaced the equivalent < 0xF011 test
with <= 0xF010.
- The output-count branch at +0x3B08 falls through to clear letters when
countOnly is true, and branches to the actual-count store otherwise.
Restored that original arm order.
- Prefix selection at +0x3B84 compares against 1 and uses less-or-equal.
Recovered <= 1 instead of the equivalent < 2.
These are demonstrated control-flow and expression reconstructions, not
register/declaration permutations. No new volatile, assembly, forced register,
padding, artificial storage, or undefined value is introduced.
## Isolated trials and rejected work
Trials used the live 43U Ninja compiler command, separate source/objects and
reports under /tmp/ezi-next, without changing the worktree before selection.
Columns: unit fuzzy / matched data bytes / exact functions.
- Output-count arm order: 96.47729 / 516 / 11
- Both inclusive boundary expressions: 96.3798 / 516 / 11
- Both maximum-length comparison orders: 96.38128 / 516 / 11
- Dictionary comparison order: 96.38405 / 516 / 11
- Initial four-group combination: 96.48966 / 516 / 11
- Final reviewed combination, preserving the second length comparison's
original operand order: 96.52474 / 516 / 11
Further target-evidenced trials were rejected rather than committed:
- Safe temporary plus postfix prefix append: 94.71085 / 336 / 11
- Safe temporary plus postfix highlighted append: 94.60377 / 336 / 11
- Dictionary-kind switches: 96.364845 / 408 / 11
- Early candidate skip: 96.451996 / 408 / 11
- Combined candidate-count limits: 96.402695 / 408 / 11
- Full dictionary source structure plus initial boundary combination:
96.78767 / 408 / 11; function extent 0x3DB8 versus 0x3DA8
- Explicit prefix-mode byte: 96.40805 / 408 / 11
- Explicit element-count byte: 96.3582 / 408 / 11
- Skip/count/byte combinations retained extent mismatches and were rejected.
One-key spelling compound count assignment was codegen-neutral. Prefix
increment removed the redundant byte narrowing but worsened allocation:
unit 98.23523 -> 97.36198. Neither trial is retained.
Chinese explicit halfword casts at the two paired phonetic comparisons and
an alternative proper halfword return declaration with redundant casts removed
both reproduce the previously parked result: unit 96.848755, matched data
144 -> 72. Adding the demonstrated component-cursor reload gives 96.489876
with the same loss. All remain scratch experiments, with no Chinese edit or
neutral PUD ABI commit included.
## Validation
Fresh full report: /tmp/ezi-next-alpha-full-report.json.
Full-build log: /tmp/ezi-next-alpha-full-build.log.
Baseline report: /tmp/ezi-next-baseline.json.
Zi8AlphaGetCandidates: 95.02813% -> 95.23011%.
Unit fuzzy: 96.37759% -> 96.52474%, about 31.88 weighted bytes gained.
Exact functions remain 11/12; exact code remains 5880/21664;
matched data remains 516/564. No complete unit or new exact function claimed.
All 1027 units were compared for fuzzy, matched-code, matched-data and exact
function measures: the alpha fuzzy improvement is the sole changed measure,
with no regressions.
Pool checked first: identical and empty. Main function stays 3946/3946
instructions and 0x3DA8 bytes, with the same 0x2B0 frame. Strict ctxdiff is
nonzero (3738 differences); existing scalar-stack displacement and register
allocation remain. Each of the 11 existing exact functions retains identical
instruction counts and ctxdiff diffs 0.
Baseline/candidate .rodata, .data, extab and extabindex have identical payloads
and canonical relocations. Relative to the target, extab and extabindex remain
byte-identical; the unchanged generated switch relocations remain unmatched.
The source rodata's pre-existing 330-byte size versus target 336 is unchanged;
objdiff still reports 100% for that section and the same exact-data accounting.
Advisory branch mapping checks 709 same-mnemonic branch pairs with zero
mapped destination mismatches, and 73/73 helper calls. It is not an exactness
or formal equivalence claim.
Full 43U build passes with the approved wrapper and WIBO_SJIS_MISSING_IMPORTS=1.
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d.
git diff --check passes. No remote actions were performed.

View File

@@ -0,0 +1,82 @@
# JPEG follow-on reconstruction
Base: `813660b9`, branch `agent/bittle/jpeg-reconstruction-next`.
The already-reviewed EXIF candidate `b9305280` was preserved unchanged as local
cherry-pick `164dbbc5`. This log concerns a separate follow-on to that candidate.
## Retained change
IFD0 rational denominator addresses now use the same explicit offset grouping as
IFD1: add four to the TIFF offset, then add the thumbnail-data base. The redundant
same-type pointer cast is removed. This is a two-line source change; it introduces
no new tag interpretation, new memory access, or function.
- `TMCJPEGDEC_IFD0_tag_parse`: 99.386696 -> 99.49065 fuzzy
- EXIF unit: 98.94104 -> 98.98035 fuzzy
- EXIF exact functions: 3/6 -> 3/6; matched code remains 1348/5088 bytes
- IFD0 remains 480/481 instructions; this is not an exact match or linking result
- All other 33 owned functions retain their baseline scores
No changes are retained in the color converters or IDCT. No declaration-order
search, forced registers, volatile, assembly, padding, headers, configuration,
linking changes, remote writes, or edits to the entropy decoder were made.
## Rejected reconstruction trials
Every equal or regressing trial was restored before validation.
- Separate rational numerator/denominator pointer lifetimes in IFD0 and IFD1:
unchanged from the retained expression; restored
- RGB444's common edge-sibling channel evaluation and clipping order with a
separate luminance value: 98.71429 -> 98.62637; restored
- Explicit odd-coefficient differences in the luminance second-pass butterfly:
83.05058 -> 81.42802; restored
- Extract the luminance first-pass row transform to a static inline helper:
83.05058 -> 81.12062; restored. The trial script initially omitted helper
local declarations, causing a compiler error; that experiment was corrected,
measured, and then fully restored
- Extract RGBA pixel packing to a static inline helper:
- 411: 82.6033 -> 81.72314; restored
- 422 and edge: unchanged at 87.72298 and 90.08849; restored
- 420 and edge: unchanged at 89.40523 and 87.458336; restored
- 211 and edge: unchanged at 91.15385 and 92.0; restored
- 444: unchanged at 90.670105; restored
- 444 edge: 88.90909 -> 87.70909; restored
These were source-structure trials, not permutations of register declarations.
The source-neutral scheduling differences that remain were not chased through
artificial source changes.
## Verification
The baseline report was generated after building the unchanged cherry-picked
candidate. The final report was freshly generated after restoring every rejected
trial and rebuilding all four owned objects.
- Full 4.3U build: PASS
- All 34 owned function scores compared against the baseline: zero regressions
- All 11 previously exact functions retain exact-name objdiff 100 and ctxdiff 0
- Pool checks before trials and after the final build: all four identical,
zero strings
- Neither source nor original object has allocated non-code sections in any of
the four owned units
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`
- The existing read-only bounded PPC audit tools were inspected before use;
their scripts are unchanged
- Converter/IDCT audit: all 9,456 paired calls pass
- EXIF audit: all 267,282 paired calls pass, including the 42 version-byte
overlap cases preserved by the preceding candidate
- `git diff --check 813660b9`: PASS, including the base-relative committed diff
- The working tree is paused for parent review after the focused local commit
These interpreter tests are bounded samples, not formal equivalence or Wii
runtime tests. Their existing coverage and modeling limitations still apply.
## Existing external overlap
The prior EXIF log documents the already fetched
`origin/agent/w1009/tmc` branch's overlap with EXIF and color reconstruction.
That overlap remains relevant to parent integration. This follow-on was derived
from the current source, the prior owned reconstruction, and local object
comparisons. No external branch was merged, copied, fetched, or contacted.
The parent should preserve the previously queued EXIF candidate separately.

View File

@@ -0,0 +1,63 @@
main/libs/RVLMiddleware/TMC_JPEG/src/buffer/idct_block_var 89.06892 -> 89.06892
POOL IDENTICAL up to 0 (mine=0 base=0)
No allocated non-code sections in either object
main/libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse 98.94104 -> 98.98035
POOL IDENTICAL up to 0 (mine=0 base=0)
TMCCJPEGDecGetOffsetEXIF: src 0x26c base 0x26c insns 155/155; diffs 0: []
TMCCJPEGDecGetInfoEXIF: src 0x210 base 0x210 insns 132/132; diffs 0: []
TMCJPEGDEC_IFD0_tag_parse 99.386696 -> 99.49065
TMCJPEGDEC_ThumbnailCheck: src 0xc8 base 0xc8 insns 50/50; diffs 0: []
No allocated non-code sections in either object
main/libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565 96.44502 -> 96.44502
POOL IDENTICAL up to 0 (mine=0 base=0)
TMCJPEGDEC_converterYUV422toRGB565edge: src 0x1ac base 0x1ac insns 107/107; diffs 0: []
TMCJPEGDEC_converterYUV211toRGB565: src 0x188 base 0x188 insns 98/98; diffs 0: []
TMCJPEGDEC_converterYUV211toRGB565edge: src 0x1b4 base 0x1b4 insns 109/109; diffs 0: []
TMCJPEGDEC_converterYUV444toRGB565edge: src 0x1a0 base 0x1a0 insns 104/104; diffs 0: []
TMCJPEGDEC_converterYUV400toRGB565: src 0x118 base 0x118 insns 70/70; diffs 0: []
TMCJPEGDEC_converterYUV400toRGB565edge: src 0x14c base 0x14c insns 83/83; diffs 0: []
No allocated non-code sections in either object
main/libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8 90.32323 -> 90.32323
POOL IDENTICAL up to 0 (mine=0 base=0)
TMCJPEGDEC_converterYUV400toRGBA8: src 0x130 base 0x130 insns 76/76; diffs 0: []
TMCJPEGDEC_converterYUV400toRGBA8edge: src 0x164 base 0x164 insns 89/89; diffs 0: []
No allocated non-code sections in either object
34 owned function scores checked; 11 exact functions preserved; zero regressions
26116613f624061ba99c8d1a299aaa6efa85670d build/43U/main.dol
TMCJPEGDEC_IFD0_tag_parse 131072 selector cases PASS
TMCJPEGDEC_IFD1_tag_parse 131072 selector cases PASS
TMCJPEGDEC_IFD0_tag_parse 132746 cases PASS; own-body instruction coverage 480 / 480 source; 481 / 481 original
TMCJPEGDEC_IFD1_tag_parse 132704 cases PASS; own-body instruction coverage 239 / 239 source; 241 / 242 original
TMCJPEGDEC_exif_parse 1832 cases PASS; own-body instruction coverage 212 / 212 source; 212 / 212 original
TOTAL 267282 paired EXIF calls PASS
TMCJPEGDEC_converterYUV411toRGBA8: 100 cases PASS; instruction coverage source 242/242, original 242/242
TMCJPEGDEC_converterYUV411toRGBA8edge: 400 cases PASS; instruction coverage source 112/112, original 112/112
TMCJPEGDEC_converterYUV422toRGBA8: 100 cases PASS; instruction coverage source 148/148, original 148/148
TMCJPEGDEC_converterYUV422toRGBA8edge: 400 cases PASS; instruction coverage source 113/113, original 113/113
TMCJPEGDEC_converterYUV420toRGBA8: 100 cases PASS; instruction coverage source 153/153, original 153/153
TMCJPEGDEC_converterYUV420toRGBA8edge: 400 cases PASS; instruction coverage source 120/120, original 120/120
TMCJPEGDEC_converterYUV211toRGBA8: 100 cases PASS; instruction coverage source 104/104, original 104/104
TMCJPEGDEC_converterYUV211toRGBA8edge: 400 cases PASS; instruction coverage source 115/115, original 115/115
TMCJPEGDEC_converterYUV444toRGBA8: 100 cases PASS; instruction coverage source 97/97, original 97/97
TMCJPEGDEC_converterYUV444toRGBA8edge: 400 cases PASS; instruction coverage source 110/110, original 110/110
TMCJPEGDEC_converterYUV400toRGBA8: 100 cases PASS; instruction coverage source 57/76, original 57/76
TMCJPEGDEC_converterYUV400toRGBA8edge: 400 cases PASS; instruction coverage source 70/89, original 70/89
TMCJPEGDEC_set_converterRGBA8: 1024 cases PASS; instruction coverage source 168/169, original 169/170
TMCJPEGDEC_converterYUV411toRGB565: 100 cases PASS; instruction coverage source 217/217, original 217/217
TMCJPEGDEC_converterYUV411toRGB565edge: 400 cases PASS; instruction coverage source 106/106, original 106/106
TMCJPEGDEC_converterYUV422toRGB565: 100 cases PASS; instruction coverage source 136/136, original 136/136
TMCJPEGDEC_converterYUV422toRGB565edge: 400 cases PASS; instruction coverage source 107/107, original 107/107
TMCJPEGDEC_converterYUV420toRGB565: 100 cases PASS; instruction coverage source 141/141, original 141/141
TMCJPEGDEC_converterYUV420toRGB565edge: 400 cases PASS; instruction coverage source 114/114, original 114/114
TMCJPEGDEC_converterYUV211toRGB565: 100 cases PASS; instruction coverage source 98/98, original 98/98
TMCJPEGDEC_converterYUV211toRGB565edge: 400 cases PASS; instruction coverage source 109/109, original 109/109
TMCJPEGDEC_converterYUV444toRGB565: 100 cases PASS; instruction coverage source 91/91, original 91/91
TMCJPEGDEC_converterYUV444toRGB565edge: 400 cases PASS; instruction coverage source 104/104, original 104/104
TMCJPEGDEC_converterYUV400toRGB565: 100 cases PASS; instruction coverage source 51/70, original 51/70
TMCJPEGDEC_converterYUV400toRGB565edge: 400 cases PASS; instruction coverage source 64/83, original 64/83
TMCJPEGDEC_set_converterRGB565: 1024 cases PASS; instruction coverage source 168/169, original 169/170
TMCJPEGDEC_IdctBlock_Lumi: 704 cases PASS; instruction coverage source 257/257, original 257/257
TMCJPEGDEC_IdctBlock_Col: 704 cases PASS; instruction coverage source 454/454, original 454/454
TOTAL: 9456 differential cases PASS; GPR14-GPR31, stack pointer and LR preserved

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()