Commit Graph
8 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 56148606e5 Headless: Keep ad hoc test instances in step in emulated time
Each instance paced itself against the wall clock, so on a busy machine
the one that got less CPU fell behind, and anything a test times across
instances (a peer leaving, a matching timeout) came out differently with
the load: pair/vanish and pair/matching3 failed on macOS CI.

With --sync-file and --sync-count, instances on one machine share a file
of one slot per instance. CoreTiming ends a slice at every emulated
millisecond, publishes it there, and waits until every other instance
has reached it too, so they're never more than a millisecond apart. It
works for any number of instances. One that stops moving (a debugger
pause, a crash) is waited for 2 s and then left out until it moves
again, and one that blocks the CPU thread in real time on something the
others must do (the relay PTP connect) stands aside meanwhile.

Tools/adhoc_multi.py and adhoc_session.py use it (--no-sync turns it
off). The host's 1 s head start is gone: they wait for the server's
port instead. adhoc_multi writes each instance's output to a file, as a
full pipe would now stop the other instances too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 09:04:00 +01:00
Henrik RydgårdandClaude Opus 5.5 6ae4ddc15a adhoc_session.py: Drop the slow network options for now
The relay's network simulation is coming separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:08:39 +01:00
Henrik RydgårdandClaude Opus 5.5 6b69e6d0b2 adhoc_session.py: Add type, for the system on-screen keyboard
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:08:11 +01:00
Henrik RydgårdandClaude Opus 5.5 9c53b53a4d adhoc_session.py: Add stick, to hold the analog stick
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:08:11 +01:00
Henrik RydgårdandClaude Opus 5.5 adaa14d0bb docs/adhoc-multiplayer-testing: Instances can share too little GPU
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:08:11 +01:00
Henrik RydgårdandClaude Opus 5.5 214b14fe63 Add --nickname, and give each adhoc_session.py instance its own
Games that show the system nickname in their lobbies can then tell the
instances apart. Also: press --times N --every S for menus that need
several presses, and start clears the last session's screenshots, which
could otherwise pass for this one's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:08:10 +01:00
Henrik RydgårdandClaude Opus 5.5 f0c6a26087 adhoc_session.py: Wait for screens, and collect logs
until waits for a region of the screen to match a reference crop (or
a pixel its color), optionally pressing a button meanwhile, since
loading screens take a different time on every run and a press before
a menu is ready is lost. crop makes the references. log sets a log
channel's level and watch collects the log messages for a while.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:07:57 +01:00
Henrik RydgårdandClaude Opus 5.5 8f3c49fb9d Tools/adhoc_session.py: Play a game's multiplayer with several instances
Starts N headless instances of a game against each other, with or
without the relay, and drives them over the debugger: button presses,
side-by-side screenshots, frame rates, and scripts of those. Each
instance gets its own memory stick with a copy of the savedata, so
autosaves can't collide. docs/adhoc-multiplayer-testing.md describes the
setup, by hand too, and the network simulation options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:07:57 +01:00