From 17c8e07652adb817f30fe36fad6678cb12114d23 Mon Sep 17 00:00:00 2001 From: RetroGameDeveloper <40120498+RetroGameDeveloper@users.noreply.github.com> Date: Sat, 24 Oct 2026 00:25:26 +0100 Subject: [PATCH] Document observed IDO whitespace sensitivity and verification limits --- src/decompnet/consoles/n64/guides/ido.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/decompnet/consoles/n64/guides/ido.md b/src/decompnet/consoles/n64/guides/ido.md index 51e4a8c61..49cc21d77 100644 --- a/src/decompnet/consoles/n64/guides/ido.md +++ b/src/decompnet/consoles/n64/guides/ido.md @@ -5,8 +5,8 @@ may need a different version (5.3 vs 7.1) or flags: tell the user, they can swit Traits - Unconditional jumps inside functions are `b label` (`beq $zero, $zero`). -- IDO is sensitive to how code is written on a line. Splitting or joining statements - (`a = b; c = a;` vs `c = a = b;`) changes the output. +- Expression structure can change output: `a = b; c = a;` and `c = a = b;` are + different expressions. Test this separately from changes to line breaks alone. - It reuses registers in a predictable order; extra temporaries often *don't* help, while reordering statements or changing where a variable is first assigned does. - Common idioms: `if (x) { } else { }` with empty blocks, `do { ... } while (0);` around a sequence, @@ -23,3 +23,21 @@ Argument home slots Static functions - `static` functions may be called with a different convention only in the same file; for matching a single function it rarely matters, but keep the name the ROM uses. + +Source line layout (observed; mechanism unconfirmed) +- Preserve a candidate's line breaks before trying automatic formatting or one-line storage. + A private IDO 5.3 same-source comparison matched with preserved whitespace (score 0), + while replacing every whitespace run with one space scored 120 and changed a call/load + ordering. This establishes layout sensitivity in that example, not a newline-only cause. + The broader pass added 22 matches, but header/global-declaration fixes also changed between + passes, so those 22 cannot all be attributed to formatting. Full-image acceptance is separate. +- Source locations may influence compiler decisions, but instruction scheduling has not been + established as the cause here. Extraction, preprocessing and macro effects must be ruled out. +- For a controlled check, keep the compiler executable, flags, headers, macros, symbol addresses + and linker setup fixed. Save both inputs; change only newlines between ordinary C tokens. + Do not move preprocessor directives, continue `//` comments, or change `__LINE__` uses. + Compare preprocessed token sequences and linked instruction bytes, not whole object files + whose debug records can differ. Repeat both builds to check determinism. +- Keep formatting variants as separate attempts and rejudge after formatting matched C. + A per-function match must still pass the complete image/cartridge rebuild. Never change the + target bytes or judge to accommodate a formatting variant.