Commit Graph

76 Commits

Author SHA1 Message Date
Claude
79e88dc821 tests: fix resume mock session registration and RDRAM sizing
Some checks failed
Rust / build-linux (linux-x86_64, X64, ubuntu-24.04, x86_64-unknown-linux-gnu) (pull_request) Failing after 2s
Rust / build-android (29.0.14206865, ubuntu-24.04, 33) (pull_request) Failing after 1s
Rust-lint / lint-linux (pull_request) Failing after 1s
Rust / build-linux (linux-aarch64, ARM64, ubuntu-24.04-arm, aarch64-unknown-linux-gnu) (pull_request) Has been cancelled
Rust / build-windows (windows-aarch64, woa64, windows-11-arm, aarch64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-windows (windows-x86_64, win64, windows-2025, x86_64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-macos (macos-aarch64, ARM64, aarch64-apple-darwin) (pull_request) Has been cancelled
Rust / Collect release artifacts (pull_request) Has been cancelled
mock_netplay built a one-player session for a local handle of 1,
which the vendored ggrs fork rejects; register every handle (the
local player at player_number, dummy Remote PeerIds elsewhere).
The resume tests loaded saved states into fresh Device::new(false)
instances whose RDRAM backing store is empty, tripping
copy_from_slice in apply_savestate; pre-size the RDRAM like a real
emulated device, matching the saved session's RDRAM.
2026-08-25 16:21:12 -05:00
Claude
92a4781ce6 netplay: count same-batch peer acks in session-resume handshake
wait_for_ready_all counted acks by removing them from the by-name
messages map, which collapses every ack that arrives in the same
channel poll into one entry: with 3+ players the host could
undercount and time out a session whose peers all synced. Count the
matching messages of each decoded batch instead (process_reliable_messages
now returns the batch it decoded).
2026-08-25 15:29:40 -05:00
Claude
1bb409f085 netplay: resume both sides at the saved GGRS frame (issue #5 reset_frame) 2026-08-25 11:50:33 -05:00
Claude
412977f91d Merge remote-tracking branch 'origin/issue-5' into issue-4
# Conflicts:
#	src/device.rs
#	src/netplay.rs
#	src/savestates.rs
2026-08-25 11:31:06 -05:00
Claude
9097b455db netplay: session resume — reload saved state and broadcast to peers (#4) 2026-08-25 11:22:52 -05:00
Claude
dab9fabc01 merge: netplay session save to disk (#3, PR #13) — dependency for session resume
# Conflicts:
#	src/netplay.rs
#	src/savestates.rs
2026-08-25 05:44:55 -05:00
Claude
891d12c08a netplay: add state-message types to reliable channel protocol (#1)
Some checks failed
Rust-lint / lint-linux (pull_request) Failing after 1s
Rust / build-linux (linux-x86_64, X64, ubuntu-24.04, x86_64-unknown-linux-gnu) (pull_request) Failing after 1s
Rust / build-android (29.0.14206865, ubuntu-24.04, 33) (pull_request) Failing after 1s
Rust / build-linux (linux-aarch64, ARM64, ubuntu-24.04-arm, aarch64-unknown-linux-gnu) (pull_request) Has been cancelled
Rust / build-windows (windows-aarch64, woa64, windows-11-arm, aarch64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-windows (windows-x86_64, win64, windows-2025, x86_64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-macos (macos-aarch64, ARM64, aarch64-apple-darwin) (pull_request) Has been cancelled
Rust / Collect release artifacts (pull_request) Has been cancelled
Add message-name constants and reliable-channel helpers for netplay
session state transfer:

- Message-name constants: netplay_state, netplay_state_ready,
  resync_state, resync_ready
- Chunked message codec (encode_message_chunks / decode_message /
  decode_packets) reusing the existing 16 KiB reliable-channel
  transport; send_message/process_reliable_messages refactored onto it
- send_netplay_state / receive_netplay_state for full session state
- send_ready / wait_for_ready ack helpers (10s timeout, same pattern
  as receive_message); receive_message extracted to wait_for_message
  with preserve of input_delay/disconnect side effects
- Large payloads (>1MB) accumulate into incoming_message until a full
  postcard message parses
- Unit tests: 5MB payload round-trip through the chunked codec, ack
  send/receive within timeout, missing ack times out with the standard
  panic pattern

Closes #1
2026-08-25 02:34:07 -05:00
Claude
15fc132cf2 netplay: session save to disk (host) [issue-3]
Some checks failed
Rust-lint / lint-linux (pull_request) Failing after 1s
Rust / build-linux (linux-x86_64, X64, ubuntu-24.04, x86_64-unknown-linux-gnu) (pull_request) Failing after 1s
Rust / build-android (29.0.14206865, ubuntu-24.04, 33) (pull_request) Failing after 1s
Rust / build-linux (linux-aarch64, ARM64, ubuntu-24.04-arm, aarch64-unknown-linux-gnu) (pull_request) Has been cancelled
Rust / build-windows (windows-aarch64, woa64, windows-11-arm, aarch64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-windows (windows-x86_64, win64, windows-2025, x86_64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-macos (macos-aarch64, ARM64, aarch64-apple-darwin) (pull_request) Has been cancelled
Rust / Collect release artifacts (pull_request) Has been cancelled
Add host-side netplay session save:
- storage::paths.netplay_state_file_path next to other state files
- savestates::create_savestate_in_memory + SavestateData::save_to_memory
  (in-memory capture, same zip layout as on-disk savestates)
- netplay::save_netplay_session(device, path): postcard-encodes
  {state, frame, input_delay, rom_hash, players}, zstd-compresses and
  writes atomically (tmp + rename); onscreen 'Session saved — safe to quit'
- only the host (player_number 0) may save; others get an onscreen notice
- configurable hotkey (emulation.netplay_save_key, default F7), edge
  triggered in ui::input::get and consumed per-frame in check_callback
- unit tests: encode/decode round-trip + file metadata verification
2026-08-25 01:11:51 -05:00
Claude
eb5cf56ee3 Fix GGRS frame counter reset after state load (#5)
Some checks failed
Rust / build-linux (linux-x86_64, X64, ubuntu-24.04, x86_64-unknown-linux-gnu) (pull_request) Failing after 5s
Rust / build-android (29.0.14206865, ubuntu-24.04, 33) (pull_request) Failing after 2s
Rust-lint / lint-linux (pull_request) Failing after 2s
Rust / build-linux (linux-aarch64, ARM64, ubuntu-24.04-arm, aarch64-unknown-linux-gnu) (pull_request) Has been cancelled
Rust / build-windows (windows-aarch64, woa64, windows-11-arm, aarch64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-windows (windows-x86_64, win64, windows-2025, x86_64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-macos (macos-aarch64, ARM64, aarch64-apple-darwin) (pull_request) Has been cancelled
Rust / Collect release artifacts (pull_request) Has been cancelled
After a netplay savestate load, the GGRS session's internal frame counter
must be reset to match the savestate's frame, or desync detection fires
immediately on resume.

Changes:
- Patch vendored ggrs 0.13.0 to expose set_current_frame(frame) on
  P2PSession and SyncTestSession, with internal SyncLayer and InputQueue
  reset methods to clear stale saved states, checksum history, and input
  queues
- Add [patch.crates-io] ggrs = { path = 'vendor/ggrs' } in Cargo.toml
- Add netplay::reset_frame(session, frame) wrapper function
- Record current GGRS frame in Savestate.netplay_frame during
  create_savestate when in netplay context
- Call reset_frame after load_savestate in netplay context
- Add tests: advance 120 frames, reset to 60, verify current_frame()==60
  and clean resume with matching inputs; reset to 0; idempotent reset

Closes #5
2026-08-25 00:37:22 -05:00
Logan McNaughton
3bc7c96191
move input polling (#1145)
* move input polling

* more

* more

* more
2026-07-02 08:04:51 +00:00
Logan McNaughton
08e7ec71d9
clippy fix (#1123)
* clippy fix

* more
2026-06-25 13:09:18 +00:00
Logan McNaughton
c97f14980b
show proper number of players (#1121) 2026-06-25 12:28:09 +00:00
Logan McNaughton
d6b46037b4
update netplay connection (#1118) 2026-06-24 20:44:38 +00:00
Logan McNaughton
926338ba62
fix desync issue (#1116)
* fix desync issue

* more

* more

* more

* more
2026-06-24 12:52:56 +00:00
Logan McNaughton
2dda5c8706
handle matchbox panics (#1104) 2026-06-21 08:51:32 +00:00
Logan McNaughton
d6aa2ddce3
send disconnect notice (#1103)
* send disconnect notice

* more

* more

* more

* more
2026-06-20 16:40:56 +00:00
Logan McNaughton
c82edae338
show message more frequently (#1101)
* show message more frequently

* more
2026-06-20 07:58:25 +00:00
Logan McNaughton
57327c1f73
improve netplay startup (#1100) 2026-06-19 21:06:05 +00:00
Logan McNaughton
e3a22bf7d0
tweak connection times (#1099)
* tweak connection times

* more

* more
2026-06-19 07:26:39 +00:00
Logan McNaughton
97a8b63c9c
fix disconnect (#1096) 2026-06-16 16:46:57 +00:00
Logan McNaughton
b173598320
reset timeout (#1094) 2026-06-16 14:45:04 +00:00
Logan McNaughton
f211eede3b
retry socket creation (#1093)
* retry sockey creation

* more

* more

* more

* more
2026-06-16 14:22:53 +00:00
Logan McNaughton
b123ed9fa3
input delay cannot be less than 1 (#1092) 2026-06-16 14:02:02 +00:00
Logan McNaughton
2b0d8e5423
skip save states (#1091)
* skip save states

* more
2026-06-16 13:34:18 +00:00
Logan McNaughton
49b8024fbe
Revert translation changes (#1090)
* revert translation changes

* more
2026-06-16 13:05:58 +00:00
Logan McNaughton
be987e1434
don't spam errors (#1089) 2026-06-16 12:58:16 +00:00
Logan McNaughton
27e2b89fcf
re-arrange netplay setup (#1088)
* re-arrange netplay setup

* more

* more

* more

* more

* more

* more

* more

* more
2026-06-16 12:48:31 +00:00
Logan McNaughton
c261a746a3
enable rollback (#1087)
* enable rollback

* more
2026-06-16 10:43:50 +00:00
Logan McNaughton
19142a30c6
use unbounded channel (#1084)
* use unbounded channel

* more
2026-06-15 17:44:20 +00:00
Logan McNaughton
45963aeea5
Fix ping recommendation (#1082)
* don't block tokio

* more

* more

* more

* more

* more
2026-06-15 15:29:51 +00:00
Logan McNaughton
9b7aeccd48
close window on user request (#1079)
* close window on user request

* more

* more

* more
2026-06-15 06:53:54 +00:00
Logan McNaughton
10d55bd25c
move netplay init (#1078)
* move netplay init

* more
2026-06-14 20:36:54 +00:00
Logan McNaughton
16224cd5a6
use spinbox for latency (#1077)
* use spinbox for latency

* more

* more
2026-06-14 18:28:36 +00:00
Logan McNaughton
d6da1656b8
clean up ICE config (#1072) 2026-06-13 17:29:36 +00:00
Logan McNaughton
ae7bac65d5
use custom ICE server config (#1071)
* use custom ICE server config

* more

* more

* more

* more

* more

* more
2026-06-13 16:28:33 +00:00
Logan McNaughton
6cae2ed3ac
dont use usize in netplay messages (#1068) 2026-06-13 09:55:12 +00:00
Logan McNaughton
be74e3358a
Use mpsc instead of mutex (#1065)
* use mpsc

* more

* more

* more
2026-06-12 14:16:06 +00:00
Logan McNaughton
4cc85d595f
pass channel to ggrs (#1064)
* pass channel to ggrs

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more
2026-06-12 13:34:21 +00:00
Logan McNaughton
72e4a6b94a
early rollback code (#1054)
* some rollback test

* more
2026-06-10 15:09:07 +00:00
Logan McNaughton
af163dac62
Fixed input delay (#1044)
* disable rollback

* more

* more

* more

* more

* more

* more
2026-06-09 14:10:49 +00:00
Logan McNaughton
577741907f
move speed limiter out of save state (#1030) 2026-06-07 09:55:18 +00:00
Logan McNaughton
21238c8e41
cleanup if statement (#1023) 2026-06-06 19:20:53 +00:00
Logan McNaughton
3184305c41
increase disconnect timeout (#1020) 2026-06-06 12:42:13 +00:00
Logan McNaughton
c89c5d1cc3
increase disconnect timeout (#1016)
* increase disconnect timeout

* more
2026-06-06 06:22:52 +00:00
Logan McNaughton
19dc966abd
use different rooms for lobby and game (#1009) 2026-06-05 21:35:59 +00:00
Logan McNaughton
9140138843
Don't render frame during roll forward (#1006)
* no update check on android

* more

* more

* more

* more

* more
2026-06-05 15:37:56 +00:00
Logan McNaughton
618e3a32f2
netplay error checking (#1005)
* netplay error checking

* more

* more

* more

* more

* more

* more

* more

* more
2026-06-05 12:16:01 +00:00
Logan McNaughton
681f8670f5
GGRS netplay (#1004)
* update netplay

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more
2026-06-05 07:43:31 +00:00
Logan McNaughton
5c7170268e
Don't store luts in savestate (#993)
* use hashmap for tlb

* more

* more

* more

* more

* more
2026-05-31 06:37:11 +00:00
Logan McNaughton
a69a74bf37
cleanup some if statements (#846) 2026-05-06 11:57:04 +00:00