Repository navigation
Recompiler correctness: fail loud, fix delay slots, $ra, jump tables and overlaps - #1
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Static-recompiler correctness work on the Crash Bandicoot bring-up, plus the
observability the branch started as. Suite went 583 → 662.
The change that reframed the rest
recomp_dispatchnow aborts on an unmapped target instead of logging fivetimes and continuing. Every miss used to become a silent no-op: execution
carried on with corrupted state and the symptom surfaced far from its cause.
Failing at the cause turned debugging from divergent to convergent, and three
long-standing defects surfaced within a day of making the switch.
PS1_DISPATCH_PERMISSIVE=1restores the old behaviour for deliberatelyincomplete builds.
Recompiler correctness
inline before the transfer and skipped at its natural position, taking its
label with it; the post-pass then synthesised a dispatch to an address inside
the same function. Measured case:
0x8003A264infunc_8003A144.jalwrites$ra. None of 1523 direct call sites did.$rais data asmuch as control flow — callees save it, pass it, jump through it — so a stale
value travelled into memory and came back as a garbage pointer.
sltiubound, not a hardcoded 64 entries.The cap truncated a 146-entry table whose needed target sat at index 130, and
over-read past short tables into adjacent data: 20 of 39 tables changed, most
of them shrinking.
ELF symbols, from the gap to the next entry, and from
--add-funcafter thefact, and the later sources never revisited the earlier ones — so seven
functions emitted the same bytes twice under two names.
Runtime
and registers a handler that increments
ticks_elapsed, the delta-time itsphysics and waits are written against. That handler never fires here, so the
word was frozen: measured 69 logic frames in 40s against 1261 with the correct
rate — the game ran ~18× slow. Address and rate come from the game TOML's
[timing]block, so no game address enters the runtime.sign-extended wrongly, corrupting every other decoded sample; the End flag
failed to jump to the repeat address in the common End+Mute case.
PsyQ HLE audit
Ten HLEs verified against cited sources with covering tests:
SetDrawMode,GetTPage,_dws/LoadImage,PutDispEnv,DrawOTag,GetClut,SetDefDrawEnv,PutDrawEnv,_addque,_addque2._addque2was audited bydisassembling the game binary and returned the wrong value.
PutDispEnvandSetDefDrawEnvnow honour the PAL branch instead of assuming NTSC.FillRectalso stopped treating a zero size as a full 512 lines, which had beenwiping the texture pages every frame.
Notes
feature/observability-metricsoutgrew its name; the observability work isonly the first third of it.
functions now stops instead of limping.