netplay: state-message types for reliable channel protocol (#1) #14
No reviewers
Labels
No Label
blocked
bounced
in-progress
in-review
manual-only
needs-guidance
netplay
p1
p2
p3
rust
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: pbwraith/gopher64-netplay#14
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "issue-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements gopher64-netplay issue #1: extend the reliable channel protocol with state-message types for netplay state transfer.
NETPLAY_STATE_MESSAGE("netplay_state"),NETPLAY_STATE_READY_MESSAGE("netplay_state_ready"),RESYNC_STATE_MESSAGE("resync_state"),RESYNC_READY_MESSAGE("resync_ready").encode_message_chunks/decode_message/decode_packetssplit serialized messages into 16 KiB transport chunks and accumulate incoming data intoincoming_messageuntil a full postcard message parses (unchanged transport behavior, extracted into reusable helpers).send_netplay_state(netplay, data)/receive_netplay_state(netplay) -> Vec<u8>reuse the existing chunkedsend_message/ reliable-channel machinery — no new transport code.send_ready(netplay, name)/wait_for_ready(netplay, name)with the same 10 s timeout pattern asreceive_message(extracted intowait_for_message; input-delay/disconnect side effects preserved).Tests
4 new unit tests in
src/netplay.rs:state_message_constants_match_protocol— constant values match the wire names.large_payload_round_trips_through_chunked_codec— 5 MB payload through the chunked encode/accumulate/decode path.ready_ack_send_receive_within_timeout— ack encode/decode and queued-wait within timeout.missing_ack_times_out_with_standard_panic— missing ack panics with the existing"Could not receive message for {name}"pattern.cargo test --lib— 4 passed / 0 failed.(Note: build.rs/.cargo/config.toml remain untouched — local worker-box build tweaks are kept out of this PR.)
Closes #1
Not merged this sweep, and not bounced — this PR has not been found faulty.
Two things block a verdict, both recorded in gopher64-netplay#16:
cargo checkfails on aclean
origin/mainbefore compiling any of this repo's code — the CPU ispre-AVX2 and
.cargo/config.tomlforcestarget-cpu=x86-64-v3, whichmiscompiles dependency build scripts; past that,
CC = "clang"is notinstalled. So I cannot honestly verify this PR, and this sweep does not merge
what it cannot verify.
src/netplay.rs. Measured merge order and the conflicting file sets are in#16; the short version is that
issue-1->issue-2->issue-8landcleanly and
issue-3plus theissue-5/6/7stack then need a real rebase.No action needed from you until #16 is resolved. Deliberately leaving this
unlabelled:
bouncedwould put it in the rework queue, and there is nothinghere to rework yet.
Merged - the one PR in the netplay cluster that gates green
State-message types for the reliable channel (+258/-34,
src/netplay.rsonly). Gated as part of the composed set below, and independently:
Why this one and not its four siblings
I mapped the cluster with
git merge-base --is-ancestorrather than readingthe PR descriptions. !18 (
issue-4) contains this branch, !15, !13 and !9as merge commits. Of those five, only this one adds no test that constructs a
Device, so it is the only one that survives gate step 3 today -- the otherfour abort the whole test binary with a stack overflow (#23, filed with the
measurement).
Landing it is safe for the rest of the cluster precisely because of that
containment:
issue-4already has these commits as ancestors, so merging theupdated
mainback into !18 is trivial rather than a rebase.What it buys immediately
Gate step 3 went from 0 tests to 4 on
main. It had been reporting0 passedsince #16 established it, which is why the stack overflow in #23went unnoticed -- the step was green because it was empty. It now has real
content:
state_message_constants_match_protocolis the valuable one: it pins thewire constants against the protocol rather than restating them, so a
renumbering cannot pass silently.
Gate, against the composed MERGE RESULT
Not each PR alone --
main+ !21 + !22 + !14 merged into one warm clone on thereview box (WSL), then
./scripts/gate.sh:Control on
origin/main@8a46ac5in the same clone:gate_exit=0, butstep 3 ran 0 tests. So this set also makes gate step 3 non-vacuous for the
first time -- 0 -> 4 real tests.