diff --git a/docs/DEVLOG.md b/docs/DEVLOG.md index 3840d6c..fd954dd 100644 --- a/docs/DEVLOG.md +++ b/docs/DEVLOG.md @@ -760,3 +760,42 @@ high-priority issues, and A3, A7, A12 and A13 deferred. **Known gaps:** broadcast discovery hasn't been tried on a physical LAN; only loopback was tested. There are no menus yet, so the list exists only through `--browse` (A10). The connection limits are guesses and have not been tested against a real attack. **Pace:** v0.5 has N7 (#38, packaging) and N8 (#39, soak) left. It was due on the 11th, so this is still more than a day behind with three and a half days left. Next: N8 (#39), then N7 (#38). After that, v0.6 is cut to its high-priority issues: #78, A1, A2, A4, A5, A6, A8, A9, A10 and A11. + +## 2026-11-12 (night): N7 done, N8 mostly done + +**Start of run:** clean tree, and the fast-forward pull was a no-op. The Agents category had nothing addressed to this task, and nothing was posted. + +**Done:** +- **N7 (#38), dedicated server packaging.** Closed, and H7 (#70) with it. + - `packaging/server/tidewall-server` is a wrapper that turns SIGTERM and SIGINT into a clean stop, through the server's new `--stop-file`. + - New server options: `--config=PATH` (example: `packaging/server/server.cfg`), and `--health-port` and `--health-bind` for `GET /health` (`HealthServer`). + - `packaging/docker` has a `debian:13` image that is non-root, read-only and checksum-verified, and a Compose example named `tidewall-server`. `packaging/systemd` has a hardened unit. + - `make server-package-check` tests the whole path, and `tools/smoke.sh` now tests SIGTERM. +- **N8 (#39), the 24-client soak.** Built and committed, but **left open**. + - `make soak`: 24 `SoakPlayer` clients in 3 processes, each behind a `UdpRelay` that adds 60 ms ±20 ms and 2% loss. They play 2 real-time matches (about 28 min). + - `tools/soak_report.gd` checks world hashes, errors, unreadable packets, connections, memory between matches and the p99 tick. `make soak-selfcheck` proves a drifted world is caught. +- Opened H12 (#79): the server stalls for 1.8 s making the next island. + +**What the soak found:** +- The network's share took the p99 tick to 13.8 ms, over the 12 ms budget. The cause was building 24 snapshots. They now share encoded records within a tick, skip unchanged records with a native compare, and are spread over the snapshot interval. **p99 is now 7.3 ms**, with the simulation at 2.8 ms. +- ENet peers had a timeout limit of 0, which gives up as soon as any reliable message waits 5 s. It is now 32, ENet's default. +- **Still open:** with loss and jitter, one or two clients drop about 15 s into the second match's drop, in every run. One side's reliable message isn't acknowledged for 15 s while datagrams still flow. With no loss and no jitter, the soak passes. Details and leads are on #39. + +**Tests:** +- `make check` passes: 491 tests, self-check, and smoke with the new SIGTERM step. +- `make server-package-check` passes. +- `make soak-selfcheck` passes. +- `make soak` with no loss passes: 3,834 hashes compared, 0 differing; p99 tick 6.8 ms; no drops. +- `make soak` at 2% loss and ±20 ms fails on one dropped client. Otherwise it matches the no-loss run: 3,660 hashes, 0 differing; p99 7.3 ms; 27.9 kbit/s down and 14.2 up per client; about 0.5 MB of server memory growth and 1.6 MB per client process. + +**Decisions and what I learned:** +- Clients are spread over the snapshot interval in `NetGame.snapshot_due_for(handle)`. `snapshot_due()` is kept for LocalServer and tests, which carry one client's packets themselves. +- World hashes are never compared at simulation tick 0. Tick 0 lasts the whole lobby, and the world changes when the match starts, so "tick 0" names more than one state. The first soak's 1,234 "mismatches" were all that. +- Client memory is sampled at the start of PLAY, not DROP. Until a client's first drop snapshot, its prediction still holds the last match's ground, which looked like a 25 MB leak. +- A Dictionary holding a `PackedByteArray` hands out a copy, so `(dict["data"] as PackedByteArray).append_array()` changes nothing. `HealthServer` hit this. +- The engine doesn't pass SIGTERM to scripts, so graceful stop needs the wrapper. A server run directly still dies on SIGTERM. +- Splitting one working tree into two commits: save the full files, strip one issue's hunks, commit, restore. It is fiddly with shared files. Next time, commit each issue before starting the next. + +**Known gaps:** the soak drops a client under loss (#39). The 1.8 s match-change stall (#79). The systemd unit has been checked with `systemd-analyze verify`, but it hasn't been installed or run anywhere. Broadcast discovery inside Docker needs host networking. Everything from the last entry still applies: nobody has played it, there's no HUD or menus, and so on. + +**Pace:** v0.5 has only N8 left, and it is open on a real bug. It was due on the 11th, so this is still more than a day behind, with about three and a half days left. Next run: chase the N8 drop with ENet per-peer statistics, and fix #79, which removes one suspect. If that doesn't land quickly, move on to v0.6's high-priority issues (#78, A1, A2, A4, A5, A6, A8, A9, A10, A11), because a playable client matters more for Monday. The soak passes at no loss, so multiplayer works on a clean link.