The lobby server starts a 2-player room the host relay cannot carry on ICE
(recomp-net-server start_transport, launch transport "ice"). This client
knew only "host" and the legacy server relay. It inferred a relay from
equal host/guest endpoints -- which is exactly what two peers behind one NAT
advertise -- and each peer dialled its own public address: the match stayed
at "linking" forever.
- psx_lobby_launch_transport.h: one pure decision (host / ice / relay /
direct) with a unit test covering ICE, same-NAT endpoints, host relay and
the legacy relay cases.
- PsxLobbyJoinInfo.transport_ice; the launch handler records it and never
turns it into a relay; launch fill and resolve_use_ice start ICE p2p
(signalled over the lobby) for it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep both netplay_peer_frontier.h and netplay_fmv_confirm.h includes; advance lib/recomp-net to a48d355 (main, includes #38).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- The dirty-RAM interpreter's IRQ poll stride is host-only; a load resets
it to phase 0 while Live carried an arbitrary phase, so a replay could
take the VBlank in RAM code at another instruction. It is now
re-anchored at every tick boundary in Live and Replay alike.
- The av digest zeroes the three depth-24 present helpers at the end of
the GPU snapshot (upload span, present hold, previous height): host
presentation state a suppressed-present replay leaves different, not
guest-visible.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PSX_RB_DET_SELFTEST on R4 4P showed a replayed save of tick T differing
from the live save of T. Each cause, and the fix:
- Replay's finish_frame poll passed no PC hint (Live used the IRQ resume
chain); it now uses psx_netplay_snap_resume_hint.
- Devices are serviced lazily up to the next event, so root counters and
cycles_since_vblank lagged the clock by a host-path amount at save; a
load re-anchors them at the clock and drops the lag. The save now
publishes pending cycle charges and services every device to the clock
first, and renders the SPU up to it.
- GTE / mul-div completion stamps and the load-delay give-back were
re-anchored at the restored clock on every load, so a stall in flight at
the snap point cost the live run cycles but the replay none. New
BS_SEC_CPUTIM carries them relative to the clock.
- The SPU CD-input FIFO was outside the snap and wiped on rollback loads;
new BS_SEC_SPUCD carries the queued frames and the load keeps them.
- LZCR is serialized as derived from LZCS (the raw backing stays 0 until
the first LZCS write; guests only ever read the derived value).
Older snaps without the new sections load as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replay's finish_frame saved its tick snap with no PC hint while Live used
the IRQ resume / last check / cpu->pc chain; the same tick's snap could
carry a different resume PC (psx_netplay_snap_resume_hint now serves both).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every K ticks the host rewinds 16 ticks with nothing mispredicted, so each
seat replays confirmed rows over ticks it ran live; with PSX_RB_SNAP_AUDIT
the diff tool then compares replayed saves with live ones field by field.
On R4 4P it shows replay saves taken at a different guest point than the
live save of the same tick (CPU pc, cycles_since_vblank, root counters).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The waiting-room pump sent set_ready every frame while the local seat was
not yet echoed as ready. Each set_ready is a lobby_update broadcast to the
whole room, so two waiting peers produced hundreds of updates; the host then
missed the seat update (seat 2 shown open, Start disabled) and, after Start,
the launch itself. Offer changes still go out immediately.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per ring save, the section CRCs (and small sections in hex) of the
boot_state blob, marked live or replay. tools/rb_snap_audit_diff.py
checks a seat's replay against its own live save and seats against each
other, naming the first differing section and bytes. Off unless set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Live realign restores the snap at T, sets the session to T+1 and
longjmps back into the guest from the admit spin. The resume ran before
T+1 was admitted, so that frame latched no inputs and did not advance;
the next frame was then counted as T+1 and the realigned seat ran one
frame ahead of its tick label from there on (ring saves after a NACK
realign carried the next tick's clock, 2x the cycles in the first
tick). Only the realigned seat shifted, so it forked from every other
seat; with four seats this produced the "resim core diverge" splits
and the later hc-fork / hang cascade.
flush_resume now admits the tick first on the Live realign path and
keeps spinning until it can.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gl_texture_lod_test (#585) and gl_blend_accuracy_test sat in the
SDL3::SDL3-static block after _gl_scale_sdl_inc was unset, so they got an
empty --sdl-include and were not registered at all where the static
target is absent. Move them into the gl_scale_invariance block that
defines both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Verifies the four PS1 semi-transparency modes, set-mask, mask check and
texel STP at 4x internal resolution with PGXP depth on and off, directly
and on the render thread, against the PS1 formulas and the software
rasterizer (new gl_blend_accuracy_test).
Finding: with the historical surface bases (fills and texels stored as
k*255/31, everything else as k*8) single-layer blends are off by one 5-bit
step in places (1312 of the test's checked pixels, e.g. B+F/4 over a fill).
[video] accurate_blending = true stores every VRAM write as k*8 so GL's
8-bit blend truncated by the readback is exactly the PS1 arithmetic; whites
of fills/texels then present as 248 like uploads already do. Default off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gl_texture_lod_test (#585) and gl_xbr_filter_test sat in the
SDL3::SDL3-static block after _gl_scale_sdl_inc was unset, so they got an
empty --sdl-include and were not registered where the static target is
absent. Move them into the gl_scale_invariance block that defines both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Filter mode 3 magnifies textures with an edge-directed rule after Hyllian's
xBR (written from the published description, no code reused): for the
texel corner nearest a sample, weighted YUV colour distances over a 5x5
neighbourhood decide whether an edge runs along the corner's diagonal; if
so the corner is cut with an anti-aliased boundary and takes the closer
side neighbour. Flat areas, straight edges, gradients, cutouts and 1:1 draws
stay nearest. Selectable from [video] texture_filtering, settings.toml,
PSX_TEXTURE_FILTER and the new texture_filter TCP command. Default unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Equal buttons hid sealed-row stick differences when chasing a 4-seat
resim divergence (36 guest cycles on the last replayed tick).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a resim divergence the §55 fork cap bounds the next load from
above and the §62 peer NACK floor bounds it from below. On a 4-seat WAN
race the two met (cap 3296, floor 3280): hc-fork recovery refused with
"no mutually-loadable snap", nothing else could open an episode, and two
pairs of seats finished the race on different states.
Bisecting cannot heal that fork, but a MEDIA_KF heal (which hc-fork
recovery requests) can: it transfers the initiator's pin to every
follower, so any recent mutual snap works. When the window is empty and
that heal is requested, choose_load now falls back to the uncapped
choice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lobby server starts a 2-player room the host relay cannot carry on ICE
(recomp-net-server start_transport, launch transport "ice"). This client
knew only "host" and the legacy server relay. It inferred a relay from
equal host/guest endpoints -- which is exactly what two peers behind one NAT
advertise -- and each peer dialled its own public address: the match stayed
at "linking" forever.
- psx_lobby_launch_transport.h: one pure decision (host / ice / relay /
direct) with a unit test covering ICE, same-NAT endpoints, host relay and
the legacy relay cases.
- PsxLobbyJoinInfo.transport_ice; the launch handler records it and never
turns it into a relay; launch fill and resolve_use_ice start ICE p2p
(signalled over the lobby) for it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clang on arm64 contracts a*b+c into an FMA by default; x86-64 GCC without
-mfma never does. The software rasterizer's float edge/shading math then
rounded differently on a Mac and a Windows peer: +-1 colour steps on single
pixels, so VRAM (the av digest) diverged from ~sim 1800 in every
cross-machine R4 rollback race while the core digest still matched. Each
rollback baseline compare then aborted on "baseline av mismatch", and the
realigns forked the session (3P never reached the race; 4P diverged
mid-race).
VRAM dumps from the same Mac-host 2P race at 16 ticks between sim 1600
and 2080: 1-3 differing pixels in 5 of 16 frames before, 0 after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With three or more seats two guests can mispredict the same tick and both
BEGIN. The tie-break (lower initiator slot wins) ran only on initiators,
so a follower followed whichever BEGIN arrived first and stashed the rest.
On a 4-seat WAN race the host followed slot 3's epoch while slot 1's won;
the seats split across epochs, each waited for baselines that never came,
and the match ended after 20 s at rb_baseline.
The epoch id names its initiator, so a follower now applies the same rule
to the episode it follows (netplay_rb_concurrent_begin): yield during the
handshake and follow the winner, or drop the loser's BEGIN. A follower
seeing a new epoch from the initiator it already follows (abort and
reopen, the only case two seats can produce) is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The X4 co-op contract already fingerprints SPU and private audio sources. Defer the additional global execution-contract inputs, added after the approved Windows build, until a coordinated rebuild of both platforms. This preserves the owner-tested Windows artifact for playtest 2.
Two rollback bookkeeping bugs that only show with more than two seats
over a real link:
- g_peer_resolved_through took the highest RESOLVED from any peer. With
three seats the fastest follower stood in for the others, so the host
opened loads past the slower followers' frontiers (3P WAN: load 2400 vs
frontiers 2344 and 2319); every follower refused, episodes aborted and
the session diverged at 2496 before the race started. Adverts are now
kept per seat (netplay_peer_frontier.h) and the lowest across the
peer roster is the frontier.
- The §55 bisect cap (next load < L after a baseline mismatch at L) was
only cleared by an episode commit. An abort followed by a Live heal
left it armed for the rest of the session; once its loads left the
snapshot ring every episode was refused with "no confirmed snap"
(4P WAN: cap 1928, agreed 3136, ring 2656..3166) and a later fork at
3150 was never repaired. A live hash-confirmed agreed ADVANCE at or past
the cap now retires it.
Bumps lib/recomp-net for RB_RESOLVED sender attribution and rb_* queue
retransmit coalescing (RetroPortingToolKit/recomp-net fix/rb-ctrl-queue-dedupe).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enhancement arenas (GPU DMA aperture, Expansion-1 mod memory) were untracked, so Crash widescreen drew every vertex native with no depth. Adds depth stats/clear causes to pgxp, depth to pgxp_tri_ring, input_route_start at_frame, integer number keys in game.toml.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Games that read ENVX right after KEYON saw 0 until the per-frame pump and keyed the voice off (Crash spin sfx at 21:9).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>