ZPH playthrough crash

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Davie

Much to my horror, ZPH playtest of the game had a repeatable hard-crash :(
I mean, what could be worse?   I've just tested the binary under emulation here - both stella and Gopher. No crash. No memory access problems/reports.  Working perfectly. This may be a SaveKey issue?  Or a cartridge/hardware/timing issue?  No idea yet.
Complete bummer, though.

JetSetIlly

Is there a video of the what happens?
https://github.com/JetSetIlly/Gopher2600
@JetSetIlly@mastodon.gamedev.place
@jetsetilly.bsky.social

Andrew Davie

Quote from: JetSetIlly on 14 Oct 2026, 07:02 PMIs there a video of the what happens?


Yes. But I've found the bug. Obscure.

Long-press button will exit from the game screen.
That actually works, even though it crashed on the video.

I have since found that Tanya must have been pressing  long-press+direction
That, too, crashes under emulation.

Mechanism:  button+direction on menu is "use solver".  So the sequence is something like... playing game, long-press+direction triggers exit to menu, which immediately detects button+direction as "use solver" which then immediately detects the exit has been triggered, returns to menu, which sees button+direction... infinite loop.  Something of that order.

I'm going to look at using Claude to automate a test-suite on my games from now on. To actually play them under load and make sure each and every path/feature is tested.

It's unfortunate, but is what it is. I'll do my best to make-good for those who have bought a copy. Meanwhile, though, the long-press exit does actually work as advertised provided you aren't HOLDING a direction at the same time.

Bah!

JetSetIlly

An emulator option to randomise user input maybe useful. A hotkey while in playmode to toggle it at different points. Should be able to make it scriptable too.
https://github.com/JetSetIlly/Gopher2600
@JetSetIlly@mastodon.gamedev.place
@jetsetilly.bsky.social

Andrew Davie

Quote from: JetSetIlly on 14 Oct 2026, 08:40 PMAn emulator option to randomise user input maybe useful. A hotkey while in playmode to toggle it at different points. Should be able to make it scriptable too.

I think using AI analysing the code and covering all possible code paths in testing is the way to go. I've already been doing a lot of testing with Gopher headless and Claude. As an interesting aside, Claude independently decided it wanted headless to be faster, so it pulled the Gopher source and removed the 60fps limit it thinks was preventing it running testing faster. Whether that was correct or not, it pulled the code, made the change, recompiled with Go, and then started using the updated version for its testing. All without me prompting.

Remarkable, really.

JetSetIlly

Quote from: Andrew Davie on 14 Oct 2026, 08:47 PM
Quote from: JetSetIlly on 14 Oct 2026, 08:40 PMAn emulator option to randomise user input maybe useful. A hotkey while in playmode to toggle it at different points. Should be able to make it scriptable too.

I think using AI analysing the code and covering all possible code paths in testing is the way to go. I've already been doing a lot of testing with Gopher headless and Claude. As an interesting aside, Claude independently decided it wanted headless to be faster, so it pulled the Gopher source and removed the 60fps limit it thinks was preventing it running testing faster. Whether that was correct or not, it pulled the code, made the change, recompiled with Go, and then started using the updated version for its testing. All without me prompting.

Remarkable, really.
Coding agents would be better if they only did what the user asked them to. They're over-reaching by a lot IMO.
https://github.com/JetSetIlly/Gopher2600
@JetSetIlly@mastodon.gamedev.place
@jetsetilly.bsky.social

JetSetIlly

Added -fpscap option to HEADLESS mode. Defaults to false
https://github.com/JetSetIlly/Gopher2600
@JetSetIlly@mastodon.gamedev.place
@jetsetilly.bsky.social

Andrew Davie

I think we're all just going to have to get used to the use of AI, in general, in all walks of life - including programming. I asked Claude to do a full test of my code, with specific attention to timing and user input and validating the fix to the bug/crash found on ZPH. It seems pretty comprehensive.

## Summary

None of the 3,576 test runs (3.06 million frames) on the fixed build had a problem: no lockups, no actions triggered by held-over input, no SaveKey corruption. Run against the old (pre-fix) ROM, the same harness reproduced your original crash: 64 lockups in 72 runs.

## Bugs checked

1. **Long-press exit lockup**
   - **Cause:** the game→menu handover runs one frame with the 6507 still marked as "in the game". The solver shortcut (fire + direction) had been moved outside the release check in 8897f40, so fire still held from the exit could start the solver in that frame. The 6507 never noticed the change back to the game and stayed in the menu loop.
   - This was also what saved the aborted level as solved perfectly in the SaveKey: `triggerSolve()` marks the level before the hang.

## What was tested

| Inputs | all 72 combinations (9 stick positions × fire × RESET × SELECT) |
| Hold lengths | 3, 45 and 300 frames, crossing the 20, 40 and 200-frame thresholds |
| Places | copyright, credits, menu, menu entry, game start, play, long-press exit, RESET exit, attract demo and its start, solver and its trigger, level completion, unlock screen and its entry, trophy, trophy at boot |
| Fuzz | 12 seeds × 20,000 frames of random input |
| Per-frame checks | 6507 and C agree on the kernel; every action comes from a fresh press on the current screen; SaveKey progress only changes on a real solve |
| Outcome checks | 3,121, e.g. RESET exits, the solver can't start from held-over input, level completion saves progress |

That took about 3 hours of runtime (on my machine, not Claude's time). I had 9 threads running close to 100% and my M4 MacBook did get rather warm.  But the cockles of my heart are warm, too, as it does give me some faith that I fixed the bug.

Thank goodness for Gopher's headless mode -- its a true miracle worker, and many thanks to @JetSetIlly for that, and the wonderful support.




Al_Nafuur

Quote from: Andrew Davie on 15 Oct 2026, 03:49 AMThank goodness for Gopher's headless mode -- its a true miracle worker, and many thanks to @JetSetIlly for that, and the wonderful support.

Hear, hear! 👏

Gopher2600's headless mode has been a great help when debugging TinyELF Basic, too!