rom.ports: first divergence with field ports at unlisted sites (multi-frame Decompress loop JP, E9 meter US) #45

Open
opened 2026-11-03 02:42:02 +00:00 by Gatchan · 0 comments
Owner

Found while validating PR #35 (field batch 1, all field ports on) with the classified rom.ports report of #34 (release, field-batch1 after merging main 7877fde). Report only; the test passes.

JP: FINDING (unlisted site)

ports on vs interpreter: cores stop at different places from frame 47 (PC C06866 vs C067A3)
ports on vs interpreter: first divergence at frame 318 (WRAM offset $000FE (05 vs 04)); memories compared at 150 frames
divergence classified (timing census): PC C2FFB5 (interpreter) / C2FFB5 (ports on) -> no census site

$C2:FFB5 (JP) is Decompress_ext+$48 (src/btlgfx/decomp.asm, the bit-counter loop dec $fe / lsr $ff). The decompressor runs on the main thread across several frames, so both cores can end a frame at the same PC and S while one is further in the loop: $FE is its bit counter. This is a multi-frame loader case the census (workdocs/timing-census.md §5.2) does not list. It also shows a limit of the comparison: "same PC and S" does not mean "same progress" inside a long main-thread loop, so the memory difference is not necessarily a divergence of game state.

US: classified by PC, but the real site is E9

first divergence at frame 729 (WRAM offset $00630 (C8 vs F1))
divergence classified (timing census): PC C00389 / C00389 -> E5 vblank wait, NMI off: field EnableInterrupts

$0630-$0632 is the write-only CPU meter of FieldLoop (census E9, never read). The site table in tests/rom/test_rom_ports.c has no E9 WRAM entry, so the classification falls back on the PC (E5), which is incidental.

Proposed

  • Add E9 ($0630-$0632, write-only beam meter) to the census sites of test_rom_ports.c (or declare it don't-care in the comparison).
  • Add the multi-frame main-thread loaders (Decompress_ext US $C2:FF6D/JP via ff6sym, and others to list) to the census and the site table, or compare memories only when both cores are waiting for a frame (same wait PC), not in the middle of a loader.
  • With only battle/Rand on (main), the first divergence is E8 on both versions (sound driver $131E), no finding.
Found while validating PR #35 (field batch 1, all field ports on) with the classified `rom.ports` report of #34 (release, field-batch1 after merging main 7877fde). Report only; the test passes. **JP: FINDING (unlisted site)** ``` ports on vs interpreter: cores stop at different places from frame 47 (PC C06866 vs C067A3) ports on vs interpreter: first divergence at frame 318 (WRAM offset $000FE (05 vs 04)); memories compared at 150 frames divergence classified (timing census): PC C2FFB5 (interpreter) / C2FFB5 (ports on) -> no census site ``` `$C2:FFB5` (JP) is `Decompress_ext+$48` (src/btlgfx/decomp.asm, the bit-counter loop `dec $fe / lsr $ff`). The decompressor runs on the main thread across several frames, so both cores can end a frame at the same PC and S while one is further in the loop: `$FE` is its bit counter. This is a *multi-frame loader* case the census (workdocs/timing-census.md §5.2) does not list. It also shows a limit of the comparison: "same PC and S" does not mean "same progress" inside a long main-thread loop, so the memory difference is not necessarily a divergence of game state. **US: classified by PC, but the real site is E9** ``` first divergence at frame 729 (WRAM offset $00630 (C8 vs F1)) divergence classified (timing census): PC C00389 / C00389 -> E5 vblank wait, NMI off: field EnableInterrupts ``` `$0630-$0632` is the write-only CPU meter of `FieldLoop` (census E9, never read). The site table in `tests/rom/test_rom_ports.c` has no E9 WRAM entry, so the classification falls back on the PC (E5), which is incidental. **Proposed** - Add E9 (`$0630-$0632`, write-only beam meter) to the census sites of `test_rom_ports.c` (or declare it don't-care in the comparison). - Add the multi-frame main-thread loaders (Decompress_ext US `$C2:FF6D`/JP via ff6sym, and others to list) to the census and the site table, or compare memories only when both cores are waiting for a frame (same wait PC), not in the middle of a loader. - With only `battle/Rand` on (main), the first divergence is E8 on both versions (sound driver `$131E`), no finding.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Gatchan/FF6Portage#45
No description provided.