Shadow blind spots: NMI writes during a compared call, hardware multiplier/divider not compared #58

Closed
opened 2026-11-05 06:43:41 +00:00 by Gatchan · 1 comment
Owner

Found in #56.

  1. A call interrupted by NMI within the same frame count is compared, but the NMI writes into RAM (e.g. pad_raw $7E:0004) differ between the original and the clone: fuzz of _c0249a alone gave 1 mismatch per version at $0004, a byte the routine never touches. False positives now; possible false negatives if the NMI masks a port difference.
  2. Hardware multiplier/divider registers ($4202-$4206, results $4214-$4217) are not compared: the batch 2 port of UpdatePalAnimPulse leaves the multiplier in a different state than the original (unseen by shadow); DrawTimer (divider) was skipped for this reason.

Scope: compare multiplier/divider state for ports that use it (flag like PORT_WRITES_PPU) and fix UpdatePalAnimPulse if a later read can observe it; handle NMI during a compared call (run both sides with the same NMI, or exclude NMI-written bytes with justification); document in docs/validation.md.

Found in #56. 1. A call interrupted by NMI within the same frame count is compared, but the NMI writes into RAM (e.g. pad_raw $7E:0004) differ between the original and the clone: fuzz of _c0249a alone gave 1 mismatch per version at $0004, a byte the routine never touches. False positives now; possible false negatives if the NMI masks a port difference. 2. Hardware multiplier/divider registers ($4202-$4206, results $4214-$4217) are not compared: the batch 2 port of UpdatePalAnimPulse leaves the multiplier in a different state than the original (unseen by shadow); DrawTimer (divider) was skipped for this reason. Scope: compare multiplier/divider state for ports that use it (flag like PORT_WRITES_PPU) and fix UpdatePalAnimPulse if a later read can observe it; handle NMI during a compared call (run both sides with the same NMI, or exclude NMI-written bytes with justification); document in docs/validation.md.
Author
Owner

Merged in PR #60. Chapter 1 routes, 46 ports in shadow: US 1 552 349 calls 0 mismatch 0 fallback (9 567 skipped), JP 1 407 933 calls 0 mismatch 0 fallback (7 621 skipped); fuzz _c0249a alone 0 mismatch both versions. The new math-unit comparison found two more bridges to fix (UpdateShake multiplier, ClearTextGfxBuf WRAM port), fixed in the PR.

Merged in PR #60. Chapter 1 routes, 46 ports in shadow: US 1 552 349 calls 0 mismatch 0 fallback (9 567 skipped), JP 1 407 933 calls 0 mismatch 0 fallback (7 621 skipped); fuzz _c0249a alone 0 mismatch both versions. The new math-unit comparison found two more bridges to fix (UpdateShake multiplier, ClearTextGfxBuf WRAM port), fixed in the PR.
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#58
No description provided.