feat(fs-0007): implement v0 two-client multiplayer slice#11
Merged
danieldilly merged 1 commit intomainfrom Dec 23, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements FS-0007: v0 Two-Client Multiplayer Slice — the minimal end-to-end multiplayer foundation for Flowstate.
crates/sim): Deterministic World with fixed timestep, explicit tick parameter, FNV-1a 64-bit state digest, WASD movement (5.0 units/sec)crates/wire): Shared protobuf types (ClientHello, ServerWelcome, InputCmdProto, SnapshotProto, ReplayArtifact)crates/replay): Full verification pipeline with initialization and final digest anchorscrates/server): Input validation, InputSeq selection, TargetTickFloor management, LastKnownIntent fallback, session managementTrace Block
Files Changed
crates/sim/Cargo.toml— Updated metadatacrates/sim/src/lib.rs— Complete Simulation Core implementation (World, StepInput, Snapshot, Baseline, StateDigest)crates/wire/Cargo.toml— New crate for shared wire protocol typescrates/wire/src/lib.rs— Protobuf message types (prost derive)crates/replay/Cargo.toml— New crate for replay recording/verificationcrates/replay/src/lib.rs— AppliedInput, ReplayRecorder, verify_replay()crates/server/Cargo.toml— New crate for Server Edgecrates/server/src/lib.rs— Server main module (session lifecycle, stepping, finalization)crates/server/src/session.rs— Session managementcrates/server/src/validation.rs— Input validation (NaN/Inf, magnitude, tick window, rate limit)crates/server/src/input_buffer.rs— Input buffering with InputSeq selectionDeterminism / Simulation Impact
World::advance()is pure (no I/O), uses explicit tick parameter per ADR-0003, and produces identical StateDigest for identical inputs.test_t0_04_determinism_multiple_runsverifies digest equality across fresh World instances.test_t0_09_replay_verification_passesvalidates full replay path.Verification
just ci— All 58 tests pass (sim: 16, wire: 6, replay: 8, server: 28)just ids— Constitution IDs validjust spec-lint— Spec lint passedTest Coverage (Tier-0 Gates)
test_t0_01_two_client_handshaketest_t0_02_join_baselinetest_t0_04_wasd_deterministic_movement,test_t0_04_determinism_multiple_runstest_t0_05_advance_takes_explicit_tick, crate isolationtest_t0_05a_tick_floor_relationshiptest_t0_07_malformed_inputs_no_crashtest_t0_08_replay_artifact_has_required_fieldstest_t0_09_replay_verification_passestest_t0_10_initialization_anchor_failuretest_t0_11_future_input_bufferedtest_t0_12_lki_determinism,test_t0_12_lki_fallback,test_t0_12_empty_inputs_deterministictest_t0_12a_noncanonical_input_ordertest_t0_13_inputseq_tie_uses_lki, validation teststest_t0_13a_floor_enforcement_recoverytest_t0_14_disconnect_handlingtest_t0_15_match_terminationtest_t0_16_connection_timeouttest_t0_17_playerid_test_mode,test_t0_17_playerid_non_assumptiontest_t0_18_floor_coherency_broadcasttest_t0_19_wire_crate_exists(shared crate structure)just cipassesRisk / Notes
Checklist
docs/licensing/