Files
psxrecomp/tools
Kevin 7015317566 tools: remember the resident occupant per dispatch address
On hardware the game CD-reads a file to a fixed address and jal's straight
into it: identity is implicit in control flow and costs nothing. We rediscover
it by walking a band's occupants and CRC-gating each in turn. On a deep band
that walk dominates -- the memory-card screen measured 41.25 checks per hit,
roughly 41 failed gates before the resident one.

Remember which occupant last satisfied each address and try it first. The memo
is a hint, never an authority: every call still passes through
psx_overlay_static_code_matches(), so a band that swapped occupants fails the
memo and falls into the full walk, which then re-seeds it. Correctness is
therefore unchanged -- the memo only reorders candidates.

Measured headless over an identical 140 s boot window, all ten bands compiled:

  build              throughput   chk/hit   variant misses
  all-bands            99.0        1.479       368,479
  all-bands + memo    131.4        1.069        81,505

+33% throughput, 4.5x fewer wasted gate calls. It is neutral where chains are
already shallow (a savestate-loaded combat workload measured 1.019 chk/hit
before the memo and showed no gain), so it pays exactly where it was aimed.

Together with the O(1) lookup this overturns the earlier "do not compile all
bands" result: all ten bands now beat a three-band build on both workloads
measured -- 131.4 vs 107.9 at boot, and parity on the savestate workload --
because more compiled code means more native execution once dispatch is cheap.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 09:22:09 -04:00
..
2026-08-25 11:17:44 -04:00
2026-08-14 02:41:50 -04:00
2026-07-29 03:18:10 -04:00
2026-07-29 03:18:10 -04:00
2026-07-29 03:18:10 -04:00
2026-07-29 03:18:10 -04:00
2026-08-14 02:41:50 -04:00