re(ui): a RATC child's name is stated, not inferred -- and it was hiding every menu background

`ratc::parse` named each child by scanning backwards for the last printable run
of bytes before its magic. The format states the name explicitly instead, in an
`opt ` block: `"opt " | BE32 len | name | NUL | 3 bytes | magic` -- the same
block `ui_layout::opt_link` already read for a button's focus link.

The scan agrees with it 17 918 times out of 17 942 and is wrong 24 times, every
one the same failure: the 3 trailing payload bytes are themselves printable and
beat the real name. For `pteff05.t32` those bytes are `38 41 58` = `8AX`, so the
full-resolution background of all five menu screens registered under a name no
element declares, resolved to no sprite, and `compose` dropped it through an
early `continue` that -- unlike the two arms above it -- records nothing. The
screen lost its background and `screen render` still reported "all resolved".

`8AX` was never a name. Docs that treated it as one are corrected here.

Disc-wide, and the control is the 17 918 the scan already got right: the `opt `
reading reproduces every one of them. Effect on the five screens is the
signature of the same art at twice the resolution -- mean brightness unmoved,
high-frequency detail x1.15..x1.30 -- which is what the separately-measured
`ui-8ax-fullres-background` result said the game draws.

Also closes a long-standing dangling reference: `pmbase.t32`, recorded as "on
the disc nowhere", is the `GP_STAGE_CLEAR` child the scan called `8AX`. RATC
sibling references now resolve 10 148 of 10 148.

Verified: 114/114 sylpheed-formats unit tests (including two new ones pinning
the `8AX` case byte for byte and the no-block fallback), and every disc-gated
integration suite in sylpheed-formats/sylpheed-cli.
This commit is contained in:
Sylpheed RE agent
2026-08-29 07:26:56 +00:00
parent 49f109deb1
commit 56cc7acfc3
14 changed files with 583 additions and 9 deletions

View File

@@ -0,0 +1,52 @@
# RATC child names: the printable-run scan vs the `opt ` block, all 33 dat/*.pak
# 2026-08-29, crates/sylpheed-formats/examples/ratc_child_names.rs
#
# RUN 1 was taken BEFORE the fix, when ratc::parse still named children by
# scanning for the last printable run. It is the evidence for the defect.
RATC children scanned : 18002
with an `opt ` block: 17942
scanned name AGREES : 17918
scanned name DIFFERS : 24
distinct disagreements (scanned -> opt), with counts:
'OX -> po_keys_win1.t32 x2
8AX -> pbbg.t32 x12
8AX -> pmbase.t32 x4
8AX -> pteff04.t32 x2
8AX -> pteff05.t32 x4
first 20 occurrences:
GP_OPTIONS.pak entry 20 'OX -> po_keys_win1.t32
GP_OPTIONS.pak entry 22 'OX -> po_keys_win1.t32
GP_READY_ROOM.pak entry 132 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 141 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 211 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 219 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 233 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 234 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 264 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 265 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 967 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 999 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 1097 8AX -> pbbg.t32
GP_READY_ROOM.pak entry 1099 8AX -> pbbg.t32
GP_STAGE_CLEAR.pak entry 2 8AX -> pmbase.t32
GP_STAGE_CLEAR.pak entry 4 8AX -> pmbase.t32
GP_STAGE_CLEAR.pak entry 7 8AX -> pmbase.t32
GP_STAGE_CLEAR.pak entry 8 8AX -> pmbase.t32
GP_TITLE.pak entry 4 8AX -> pteff04.t32
GP_TITLE.pak entry 5 8AX -> pteff05.t32
# RUN 2, same command AFTER the fix. ratc::parse now prefers the `opt ` name, so
# the two readings must agree everywhere -- which is the check that the fix is
# complete rather than partial.
RATC children scanned : 18002
with an `opt ` block: 17942
scanned name AGREES : 17942
scanned name DIFFERS : 0
distinct disagreements (scanned -> opt), with counts:
first 20 occurrences:

View File

@@ -0,0 +1,26 @@
# Effect on the five port screens of naming RATC children from the `opt `
# block. 2026-08-29. `sylpheed-cli screen render --build N GP_TITLE.pak`,
# before vs after the ratc.rs change. The newly-resolved element is the
# full-resolution background (pteff04.t32 on the title, pteff05.t32 on the
# menus), which the old name `8AX` hid.
build screen mean brightness high-frequency detail
4 title 72.77 -> 72.81 8.722 -> 10.062 x1.15 pixels changed >2: 30.0%
5 main menu (JP) 42.73 -> 42.74 3.978 -> 5.051 x1.27 pixels changed >2: 20.0%
6 EXTRAS (JP) 44.08 -> 44.09 3.953 -> 5.025 x1.27 pixels changed >2: 19.4%
8 main menu 41.57 -> 41.58 3.830 -> 4.970 x1.30 pixels changed >2: 21.0%
9 EXTRAS 42.99 -> 43.00 3.867 -> 5.000 x1.29 pixels changed >2: 20.2%
# Brightness unmoved, detail up ~a quarter = the same artwork at twice the
# resolution replacing a 2x upscale. New CONTENT would move the mean.
# Covering check: the background is opaque and full-screen and paints 4th
# of 16 on the menu, so it could hide what follows. Standard deviation
# inside each element's resting rect (build 8), before vs after:
ptbtn01 sd 59.98 -> 60.03
ptbtn03 sd 63.40 -> 63.45
ptbtn05 sd 66.54 -> 66.58
ptframe1 sd 51.16 -> 51.20
ptmsg sd 56.11 -> 56.12
loop-area sd 50.99 -> 51.04
# Nothing is covered.