Add M10.5a session protocol v2 and snapshot replication core
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (client) (push) Failing after 9m57s
Foundation / checks (network) (push) Successful in 11m17s
Foundation / checks (tsan) (push) Successful in 7m49s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 25m43s
Foundation / checks (postgres) (push) Canceled after 15m44s

Session protocol v2 adds Interest, SnapshotChunk and SnapshotAck (v1 is refused).
ReplicationServer filters by a server-capped client focus and a perception
predicate, sends per-tick entity deltas against the acknowledged baseline (kept
up to 40 ticks), nearest first within 16 KiB with a slower distant tier, as
self-contained datagram chunks. SnapshotAssembler applies complete snapshots to
one of two baselines and validates them as presentations. ADR-0093.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-06 10:22:11 -04:00
co-authored by Claude Opus 5.5
parent ca0939dda5
commit e640b6d3a3
17 changed files with 1342 additions and 9 deletions
+33
View File
@@ -4347,3 +4347,36 @@ Probe changes: host names are resolved (IPv4) and printed (`resolved HOST ADDRES
`closed` lines name the QUIC transport cause (`RegionSessionClient::transport_cause`).
Executed: Windows MSVC preset `quic` build; Linux GCC preset `quic` CTest 4/4; clang-tidy 19
on the client, probe and evo-server sources.
## 2026-10-06 — M10.5a session protocol v2 and replication core (ADR-0093)
Implemented session protocol v2 (`Interest`, `SnapshotChunk`, `SnapshotAck`; version 1
refused), `ReplicationServer` and `SnapshotAssembler` (`include/evo/network/replication.hpp`)
and `tests/network_replication.cpp` (part of `evo-network-tests`).
Tests: v2 codec round trips, version 1 refused, chunk header rules (baseline >= tick, index
>= count, count 0 or > 16, zero epoch or tick), exactly one datagram of records accepted and
one byte more refused, every header truncation refused; radius clamped to 7; a fresh
225-cell baseline arriving nearest first within 16 KiB per tick over two ticks; nothing
outside the interest square ever received; converged ticks sending one empty chunk; a near
change sent at once and a far change deferred exactly 4 ticks; removal; a dropped chunk
leaving the snapshot unacknowledged and the next delta against the older baseline; the
acknowledged baseline kept 40 ticks and a fresh baseline after that; acks for evicted or
another epoch's snapshots ignored; a new interest restarting from a fresh baseline with only
the new square; concealment (an organism one session may not perceive and organisms outside
interest absent from the encoded bytes); client rejection of truncated, unknown-kind and
other-slice records and disagreeing chunk headers, stale and foreign-epoch chunks ignored,
deltas against unknown baselines dropped, at most 4 assemblies; 32 dense sessions for 40
ticks with a changing row (report: max 16,320 bytes per session per tick, mean 1,404,
28,800 retained entity states).
Found and fixed during development: eviction of the acknowledged baseline when acks lag
four or more ticks (normal at 100 ms RTT) would have forced fresh baselines (it is now always
kept); a dangling reference to an erased assembly entry; enum values cast before validation
in the record reader; MSVC narrowing in tuple keys and an ambiguous map erase.
Executed: Linux GCC 14 preset `quic` CTest 4/4; session tests 10/10 repeated; Clang 19
ASan/UBSan session and network tests; clang-tidy 19 on the new and changed sources and
tests; format check (only unrelated uncommitted files of the maintainer fail it); Windows
MSVC 19.44 preset `quic` build and CTest 4/4 (binaries rebuilt, timestamps checked).
Not done: wiring into RegionSessions, evo-server and the clients (10.5b); the GUI client
(10.5c).