Skip to content

debug: add generic boot write-range tracing - #91

Merged
mstan merged 2 commits into
masterfrom
codex/generic-startup-wtrace-20260801
Aug 1, 2026
Merged

debug: add generic boot write-range tracing#91
mstan merged 2 commits into
masterfrom
codex/generic-startup-wtrace-20260801

Conversation

@mstan

@mstan mstan commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

Extracts the remaining useful Crash Bash diagnostic from #13 / NyperYuhgard's
b07cb79251ecdca85aca94ba5dbfd731b67e10a7 without taking the title-specific
hard-code or the unrelated stale branch:

  • adds PSX_WTRACE_BOOT=lo,hi[;lo,hi...] for caller-selected, half-open RAM
    ranges armed before guest execution;
  • feeds those ranges into the existing boot-pinned write trace, retaining
    address/value/width, PC, RA, registers, frame, and DMA attribution;
  • accepts physical or KSEG addresses and supports multiple ranges;
  • adds focused parser coverage, TCP documentation, and source provenance.

The companion generic misaligned-dispatch diagnostics from the source commit
were already extracted in #28.

Co-authored with and credited to @NyperYuhgard.

Crash Bash assessment

The original report is mechanically plausible, but its specific corrupt-value
diagnosis is not independently reproduced.

With a verified local retail Greatest Hits build and
PSX_WTRACE_BOOT=0x000B3A80,0x000B3B00, the watched range is genuinely active.
At physical 0x000B3AC4, however, the observed nonzero write was the loaded
MIPS instruction 0x8C65B690, from guest PC 0x80048FA8 at frame 395; not the
reported 0x6766BD35 pointer. That supports preserving the diagnostic as a
generic tool, but not encoding the address or interpretation in the runtime.

Validation

  • Recompiler/unit suite: 38/38 passed.
  • Crash Bash: drove Load Game to its no-save warning, then New Game through
    character select, the hub, and live Crashball gameplay. Survived two
    deterministic fuzz phases (540 input pulses, frame 24594), with audio
    active, zero unsupported mid-block executions, and zero unknown dispatch
    tails.
  • Core-four matched baseline/candidate regression:
    • Tomba (db2302c): title, memory-card slot chooser, village gameplay, and
      deterministic fuzz passed.
    • Tomba 2 (fa6a75d): title, load-slot chooser, seaside gameplay, and
      deterministic fuzz passed.
    • Mega Man X6 (83e2ee0): full memory-card read path and intro-stage
      gameplay passed; deterministic fuzz plus extended input skipping reached
      live combat.
    • Ape Escape (564a86e): Load Game, full memory-card read path, opening
      sequence/gameplay, and deterministic fuzz passed.
  • Every final core-four report exited through TCP quit with 0 unsupported
    mid-block executions
    and 0 unknown dispatch tails. All matched runs held
    normal 16.683 ms frame pacing and active audio. Mega Man X6 and Ape Escape
    each completed 72/72 card reads with no aborts.

The previously noted default SDL3/MinGW failure is resolved in this PR.
SDL_main.h is SDL3's single-header entry-point implementation and was being
included through the shared compatibility header, emitting one WinMain from
every SDL-using translation unit. It now has one owner in main.cpp, protected
by a source-invariant test. A clean fetched-SDL 3.4.10 MinGW build linked and
smoke-ran Crash Bash through SDL3/OpenGL to frame 1374 with normal 16.683 ms
pacing and a clean report.

Validated and ready to merge.

mstan and others added 2 commits August 1, 2026 02:15
Extract the useful diagnostic from PR #13 into an opt-in, title-agnostic boot
write-range trace with TCP-queryable context.

Co-authored-by: NyperYuhgard <93950153+NyperYuhgard@users.noreply.github.com>
SDL_main.h is a single-header implementation in SDL3. Include it only from the translation unit that owns main so MinGW emits one WinMain instead of one per SDL-using source.
@mstan
mstan marked this pull request as ready for review August 1, 2026 17:45
@mstan
mstan merged commit 295262e into master Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant