# Entity and physics networking: diagnosis, state of the art, plan Round `net-entity`, 2026-10-27. Research and measurement only: nothing here changes product behaviour. The branch carries throwaway instrumentation (a server JSONL trace, a client dispatch log, a test knob), listed in §12; none of it is for merge. The owner's goal: entities that move smoothly, perceptually close to realtime, "the standard for multiplayer games with physics", and terrain/entity edits that respond at once. The owner's hypotheses were smaller packets, a UDP-style transport with custom ordering, and client-side prediction. This doc tests each against measurements. ## Answer 1. **The judder we have today is not the network's fault. It is how the client applies poses.** - A physics body's pose is applied the moment it arrives, with no buffer and no interpolation (`client/src/main.ts` `onEntityPos`). - At 60 fps with ~25 updates/s, **60 % of frames show a moving body standing still** and the rest jump 2–4 frames' worth. - The per-frame motion error is **1.4–1.6× the true per-frame motion** on every link, from the LAN to 100 ms RTT (§4). - A real browser renders exactly this: headed Chromium on utsuho showed 59–64 % frozen frames at a steady 60 fps (§4.4). - A timestamped snapshot buffer of 100–125 ms cuts that error 6–8× on the same packets: 1.46 → 0.17–0.27 on the LAN, 1.58 → 0.19–0.35 at 100 ms. - The cost is +70–90 ms of display latency for *observed* bodies. That is the industry default (Source `cl_interp` 100 ms; Fiedler ≈ 3 send intervals). - It needs a server tick stamp on each pose, which the wire does not carry today. This is the largest single win, and it works on the current WebSocket. 2. **The update rate is lower and less regular than the bands say.** - The "30 Hz" near band delivers **24–26 Hz**, with 66 ms holes at p95 and 100–133 ms at p99. The cause is a race between the throttle and the 33 ms tick: `nowMs < nextMs` skips a slot whenever the tick fires a few ms early. A 16 ms slack fixes it: **25.4 → 29.0 Hz, p95 gap 66 → 35 ms** (§3.2). - The near band ends at 6 m and the mid band at 24 m. A body 7 m away updates at 10 Hz, and one 25 m away at 1 Hz. No render model makes 10 Hz pile motion look realtime (§4.3). - In a busy scene the per-tick cap of **48 messages** is the binding limit: pile-huge peaks at 1388 of the possible 1440 EntityPos/s. Mid-band bodies then get p95 248 ms and p99 396 ms between updates, and near-band ones p50 114 ms. 3. **Packet size: 47 → 13.5 → 8.3 B per body update** (§6). - 47 B is today's message plus its WebSocket header. Quantising to 1/32 voxel (1 mm) with a smallest-three quaternion (10 bits, 0.09°) gives 13.5 B. Delta against the last sent pose gives 8.3 B. Over TCP the last sent pose is the acknowledged one, so delta coding is valid on the current WebSocket. - All 500 pile-huge bodies at 30 Hz would cost 5.6 Mbit/s today, 1.6 Mbit/s quantised and 1.0 Mbit/s delta-coded. - So the owner's "optimized data packet size" holds: 3.5–5.7× is available. But it buys *rate*, not smoothness. Smoothness comes from (1). 4. **Head-of-line blocking is real, and it is a loss-only effect.** - At 40 ms RTT with 1 % loss, 3.4 % of entity-state messages arrive more than 1 RTT late (send→arrival p99 91 ms vs 25 ms without loss). - At 100 ms with 2 % loss it is 8.7 % (p95 181 ms, p99 220 ms vs 55 ms). - Against a datagram model fed the same sends (validated against the lossless runs), TCP costs: - at 40 ms / 1 %: little (step error 0.27 vs 0.22 at a 100 ms buffer); - at 100 ms / 2 %: **2.4–2.9× the motion error at the same buffer** (0.85 vs 0.36 at 100 ms, 0.65 vs 0.23 at 125 ms), or **~100 ms more buffer** for equal smoothness (adaptive TCP needs 250 ms to reach 0.29). - So the UDP-style transport hypothesis holds for lossy links only, and only after (1). On a clean link it buys nothing measurable. 5. **Edits are slow because we ship results, not commands.** - A radius-12 sphere edit makes the server send **~205 KB** (compressed, on the fixture slab) of `RegionEdit`s: the region plus the halo regions whose normals refresh. The `EditTerrain` command that caused them is ~40 B. - Click → `RegionEdit` arrives: LAN 37 ms, 40 ms RTT 80 ms, 100 ms RTT 137 ms. Of that, the server takes 16–20 ms to apply the CSG and refresh normals. - Under loss the edit bursts fill the TCP queue: 40 ms / 1 % → p50 182 ms, max 0.9 s. 100 ms / 2 % → **p50 680 ms, p95 1.3 s**. - Everything else on that socket waits behind them. With edits every 2 s at 100 ms / 2 %, realtime state is **1.5 s old at p50 and 3.0 s at p95**, and a die spawn takes 1.06 s. Without edits it is 55 ms. - **No edit is applied optimistically today.** 6. **Own avatar: there is nothing to predict.** - The player flies client-authoritatively: input, collide-and-slide against the terrain and the entity parts the client renders, then `PlayerPos` to the server at 30 Hz. Input to visible motion is the local frame, 0 network latency. - What lags is everything the avatar *touches*. The server's kinematic shadow pushes bodies, and the result comes back after a round trip plus sampling. A held (grab/drag) body follows the cursor one RTT plus 17–50 ms late, plus the spring's own response. - A snapshot buffer (1) would add another ~100 ms to bodies near the player. That is the case for predicting *touched* bodies (§7). 7. **Client-side physics is feasible.** - `physics-rs` compiles to `wasm32-unknown-unknown` unmodified (only a wasm linker was needed): **918 KB raw, 257 KB gzip, 180 KB brotli**. - Its native build uses no `target-cpu`, no `mul_add` and no transcendentals in the step, so bit-identical native/wasm stepping is plausible. It is untested. - micropool's threads would need the serial path on wasm. 8. **Transport, with Safari (§9).** - WebTransport shipped in Safari / iOS 26.4 (2026-03-24) with datagrams, so the old Safari blocker is gone. - It still needs a non-Bun sidecar: Bun has no WebTransport server, and stable Caddy (2.11.7) cannot proxy it; the passthrough is merged for 2.12. - It also needs a WebSocket fallback for the 3–5 % of networks that block UDP. - It is worth doing *after* the WebSocket-side steps, and only for the lossy tail. The plan (§10): (a) timestamped snapshot interpolation plus the throttle fix, (b) priority accumulator plus quantised delta poses in one batched message per tick, (c) edits as commands with optimistic application and seq/ack reconciliation, (d) local simulation of touched bodies, (e) WebTransport datagrams for poses. Steps a–c work on the current WebSocket. ## 1. What happens today (code) ### 1.1 Server - **Physics** runs at 60 Hz on its own clock in the physics Worker (`server/src/physics/physics-worker.ts`). Step batches go up to the main thread, which writes each awake body's pose, `core/velocity` and `core/rigidbody` into the entity store (`worker-host.ts` `_applyWriteback`). - **The look tick** (`server/src/main.ts` `lookTick`, `setInterval` 33 ms) runs `tickPositions` (`entity-manager.ts`). For every non-static entity and every session that has it in scope it does: - skip the owner (a player's own avatar); - skip if the pose is byte-equal to the last one sent (sleeping bodies cost nothing); - otherwise throttle by distance band: < 96 v (6 m) every 33 ms, < 384 v (24 m) every 100 ms, else every 1000 ms; - enqueue a 45-byte `EntityPos` in the session's `OutgoingQueue` (`server/src/net/outgoing.ts`), coalesced latest-wins per entity. - **The flush** sends at most **48 messages / 12 KiB per session per tick**. The rest wait, ordered by priority, then least recently served, then sequence. - **`EntityPos`** carries `id u32`, `Position` (3×i32 super-region + 3×f32 offset), and `invRot` 4×f32. - There is **no timestamp, tick or sequence**, and **no velocity**: `core/velocity` is written to the store but never reached the wire in any recorded run. - Each message is its own WebSocket frame (2 B header), sent straight to `ws.sendBinary` (the realtime class). - **Entity scope** (`streamScope`, 10 Hz) sends `StructureRegister` before `EntitySpawn`. Despawn sends `EntityDespawn`. - **Edits.** - Terrain: `EditTerrain` (brushes) → `applyTerrainEdit` (CSG on the region, persist, undo snapshot) → normals refresh on the worker pool → `broadcastRegionResult`. The broadcast sends `RegionEdit` (the full post-edit region + normals, deflated) for the edited region and every halo region whose normals changed, to every holder, through the bulk lane as *urgent*. - Entity: `EditEntity` → `editEntity` → `StructureRegister` (the whole structure) plus a `core/structure` change on copy-on-write. - Spawn: `SpawnConstruct` → `EntitySpawn`. - **Grab/drag.** - The client sends `EntityGrab` (target point) every frame. - The server runs a PD spring on the body (`physicsHost.grabBody`). - The pose comes back through `EntityPos` like any other body's. ### 1.2 Client - The net Worker decodes; `WorldClient` dispatches on the main thread. - **Constructs (physics bodies):** `onEntityPos` calls `partRegistry.updateTransform` immediately. **The rendered pose is the latest one received**: no buffer, no interpolation, no extrapolation. - **Actors (allays, remote players):** the pose becomes a target. `worldOrigin` decays toward it exponentially, with τ = gap/3 clamped to [40, 400] ms (`actor-animation.ts`). There is no timestamp, so the smoothing follows arrival times, and it lags by ~τ. - **Own avatar:** - `stepCamera` integrates input; `resolvePlayerCollision` collide-and-slides the eye against terrain and the entity parts as currently rendered; the player pose follows the camera. - `PlayerPos` (with smoothed velocity) is sent every 33 ms. - The server trusts it (`session.ts`, finite check only) and drives the avatar's kinematic shadow, which pushes bodies. - `PlayerLeak` (brace residual) is an additive, smoothed camera channel that is non-zero only with a finite `PHYS_BRACE`. The default is ∞, so it is never sent. - **Edits:** `sendEditTerrain` and wait. No local application: the GPU `NormalsBuilder` that would serve "a future optimistic client-side-edit path" is unwired. ## 2. Method - **Scene:** `surface-gi-motion`. The *roller* (entity 1) is a dynamic marble sphere, radius 24 v, kicked to 40 v/s and reversing every 3 s; mean speed 21 v/s. The viewer stands at (226, 120, 60), 75 v away, which is the near band. Busy scenes are `pile-huge` (500 bodies, viewer at spawn) and `realistic-island-16` (viewer over one island). - **Server trace (`NET_ENT_TRACE`, throwaway):** - every physics step as the main thread replays it: step index, replay time, every written-back body's pose and velocity; - every `EntityPos` a socket accepts; - edit receive / apply / ready times; - look-tick starts. - **Truth:** the body's pose per step, timed at its main-thread replay. Steps replayed in one batch are back-dated one step apart. This follows the sim's own time dilation; pile-huge runs at 0.58× real time for its first 9 s. - **Clients.** - *Headless:* a node client (`logs/net-entity/entclient.ts`) on utsuho over the vmlan bridge. It records each frame's arrival, decodes entity messages, and runs scripted actions: sphere edits every 2 s, die spawns every 3 s, a grab. - *Browser:* headed Chromium on utsuho (RX 5700, 60 Hz). A throwaway log records main-thread `EntityPos` dispatch times and frame starts, read with a bench `ent_trace` command. - Clock offsets come from NetProbe echoes (min-RTT 5 %). - **netem:** `net-latency`'s method (`netem.sh`). Delay split per side; jitter with a pfifo child (no reordering); loss on nazrin's egress only. The kernel is nazrin's default: CUBIC, no `tcp_notsent_lowat`. Conditions, realised RTT (ping avg): | tag | per side | RTT | |---|---|---| | LAN | — | 0.32 ms | | 40 ms ±10 | 20 ±5 ms | 38 ms | | 40 ms ±10, 1 % | + 1 % loss | 42 ms | | 100 ms ±10 | 50 ±5 ms | 104 ms | | 100 ms ±10, 2 % | + 2 % loss | ≈ 104 ms | - **Render models**, replayed offline on the recorded arrivals at 60 Hz frame times (`anal.py`): - *snap*: today's constructs; - *exp-smooth*: today's actors; - *interp ts D*: a timestamped snapshot buffer rendering at server time − D, linear, holding the last sample when starved; - *interp adaptive*: D = p99 over 2 s of how late each sample was, slewed at ≤ 2 % of real time, so it never jumps; - *interp no ts*: the same buffer on arrival times, i.e. what is possible without a wire change; - *extrapolate*: dead reckoning from the last two samples, ≤ 100 ms, exponential blend τ 50 ms. - **Scores**, on frames where the body moves faster than 5 v/s: - **step error**: RMS of |rendered per-frame displacement − true per-frame displacement|, divided by the mean true per-frame displacement. 0 is perfect. 1 means the judder is as large as the motion itself. - **frozen**: share of frames where the rendered body did not move while the true one did. - **delay**: the display latency that best aligns the rendered trajectory with the truth. - **Datagram model** (`--simudp`): the same server send times, arrival = send + one-way delay + |N(0, 3 ms)|, no reordering, independent loss, no waiting behind a lost packet. On the lossless runs it reproduces the measured TCP scores within 0.01–0.04, e.g. 40 ms interp 100: 0.23 model vs 0.24 measured. - **Hygiene:** - utsuho runs held `logs/utsuho.lock`; no `/tmp/gi-gate*.lock` was held. - qdiscs were cleared in a trap and checked (`mq` root on both VMs). - Servers ran under `systemd-run` scopes, ports 3960–3967. - **Scratch:** `logs/net-entity/` (`runs/`, `res/`, scripts). ## 3. On the wire ### 3.1 Bytes and rates | scene (viewer) | moving bodies | EntityPos/s (max) | entity-state KiB/s p50 / p95 / max | per-update | |---|---|---|---|---| | surface-gi-motion (near the roller) | 2–5 | 34 (39) | 1.6 / 1.8 / 1.9 | 45 B + 2 B WS | | realistic-island-16 (over one island) | 416 at the drop, 19 at p50 | 79 (676) | 0.8 / 30 / 94 | same | | pile-huge (spawn) | 500 → ~220 | 814 (1388) | 34 / 60 / 84 | same | - **Pile-huge hits the cap.** 1388 of the 1440 messages/s the 48-per-tick cap allows. Sends cover every moving body only by spreading them over ticks. - Per-entity intervals by distance (client arrivals, gaps < 3 s): | scene | band | p50 | p95 | p99 ms | |---|---|---|---|---| | realistic-island-16 | near (< 96 v) | 45 | 304 | 385 | | | mid (< 384 v) | 104 | 333 | 385 | | | far | 1016 | 1046 | 1052 | | pile-huge | near | 114 | 423 | 1008 | | | mid | 104 | 248 | 396 | | | far | 1010 | 1037 | 1098 | - So near-band bodies in a busy scene get mid-band rates. The cap is round-robin by least-recently-served, so nothing is prioritised by relevance. - **Velocity and sleep.** - No velocity reaches the client. - A body that falls asleep sends its final pose and then nothing (byte dedupe). It is correct: the final pose is the resting pose. - `core/audio_emitter` updates (rolling sound) ride `EntityComponentSet` at ~1/s per rolling body. ### 3.2 The near-band throttle race - The near band is 33 ms, and the tick is a 33 ms `setInterval`. - `tickPositions` skips a session when `nowMs < posBroadcastNextMs`. - A tick that fires 0.1 ms early skips the whole slot. - Look-tick intervals themselves are steady: p50 33.2, p99 35.1, max 38 ms. - Loopback A/B, 50 s each, throwaway knob `NE_THROTTLE_FIX=1` = 16 ms slack: | | rate Hz | gap p50 / p95 / p99 ms | interp 125 step error | |---|---|---|---| | today | 25.4 | 34 / 66 / 67 | 0.15 | | slack 16 ms | **29.0** | 33 / **35** / 99 | **0.12** | - The remaining 99 ms gaps are steps that had not reached the main thread by the tick: the worker's batch jitter, which dedupe then turns into a skipped slot. A timestamped buffer absorbs these. ## 4. Remote smoothness ### 4.1 The roller, headless client over the bridge Cells: **step error / display delay ms / frozen frames**. Lower is better in every column. "Datagram model" rows feed the same sends through §2's model. | condition | snap (today) | exp-smooth | interp 75 | interp 100 | interp 125 | interp adaptive | interp, no ts, 100 | extrapolate | |---|---|---|---|---|---|---|---|---| | LAN (bridge) | 1.46 / 34 / 60% | 0.50 / 66 / 0% | 0.40 / 78 / 3% | 0.27 / 102 / 1% | 0.17 / 126 / 0% | 0.32 / 96 / 2% | 0.23 / 110 / 1% | 0.27 / 46 / 0% | | 40 ms ±10 | 1.45 / 56 / 60% | 0.50 / 88 / 0% | 0.42 / 92 / 3% | 0.24 / 118 / 1% | 0.20 / 142 / 0% | 0.28 / 116 / 1% | 0.27 / 132 / 0% | 0.29 / 60 / 0% | | 40 ms ±10, 1% loss | 1.43 / 54 / 60% | 0.52 / 88 / 0% | 0.41 / 94 / 3% | 0.27 / 116 / 1% | 0.21 / 142 / 0% | 0.29 / 126 / 1% | 0.48 / 132 / 0% | 0.26 / 62 / 0% | | 40 ms ±10, 1% loss — datagram model | 1.36 / 58 / 58% | 0.47 / 90 / 0% | 0.27 / 96 / 1% | 0.22 / 122 / 0% | 0.18 / 146 / 0% | 0.22 / 112 / 0% | 0.29 / 132 / 0% | 0.24 / 64 / 0% | | 100 ms ±10 | 1.58 / 88 / 62% | 0.55 / 120 / 0% | 0.55 / 126 / 5% | 0.35 / 148 / 2% | 0.19 / 174 / 0% | 0.34 / 156 / 2% | 0.30 / 162 / 1% | 0.32 / 94 / 0% | | 100 ms ±10 — datagram model | 1.58 / 90 / 62% | 0.53 / 124 / 0% | 0.54 / 128 / 5% | 0.35 / 152 / 2% | 0.19 / 176 / 0% | 0.35 / 156 / 2% | 0.31 / 164 / 1% | 0.34 / 96 / 0% | | 100 ms ±10, 2% loss | 1.89 / 104 / 67% | 0.74 / 138 / 4% | 1.10 / 134 / 16% | 0.85 / 154 / 12% | 0.65 / 176 / 7% | 0.29 / 250 / 1% | 1.05 / 178 / 7% | 0.44 / 100 / 0% | | 100 ms ±10, 2% loss — datagram model | 1.55 / 90 / 61% | 0.52 / 124 / 0% | 0.53 / 128 / 4% | 0.36 / 152 / 1% | 0.23 / 176 / 0% | 0.35 / 158 / 2% | 0.34 / 162 / 1% | 0.31 / 96 / 0% | Arrivals for the same runs: | condition | rate Hz | arrival gap p50 / p95 / p99 / max ms | send→arrival p50 / p95 / p99 / max ms | > 1 RTT late | |---|---|---|---|---| | LAN (bridge) | 24.3 | 34/67/132/134 | 0/0/1/1 | 0.1% | | 40 ms ±10 | 24.2 | 35/72/108/138 | 21/25/25/25 | 0.0% | | 40 ms ±10, 1% loss | 25.3 | 34/71/109/152 | 21/34/91/109 | 3.4% | | 100 ms ±10 | 23.0 | 35/99/133/141 | 51/55/55/55 | 0.0% | | 100 ms ±10, 2% loss | 23.8 | 34/132/198/255 | 53/181/220/256 | 8.7% | `logs/net-entity/owner/roller-per-frame-motion.png` plots the per-frame speed the client renders over 4 s, for the truth, snap and a 100 ms buffer, at 40 ms and at 100 ms / 2 % (TCP and the datagram model). **Reading.** - **Snap is the problem everywhere.** The error is 1.4–1.9 and 60–67 % of frames are frozen. Even on a perfect link, a 25 Hz pose stream rendered at 60 Hz without interpolation is a 25 Hz stutter with uneven steps: 1–8 physics steps per update. - **Today's actor smoothing** removes the frozen frames (0.50–0.55 error) but trails the truth by τ. It corners late at each reversal (§4.2). - **The timestamp matters.** - The same buffer on arrival times ("no ts") reaches 0.23–0.30 on clean links: the send cadence is regular enough. - Under loss it degrades to 0.48 at 40 ms / 1 % and 1.05 at 100 ms / 2 %, against 0.27 and 0.85 with timestamps. - Arrival time is a bad clock exactly when the link is bad. - **Buffer depth:** - 75 ms is too short for this stream: 66–133 ms gaps from §3.2, so 3–5 % of frames frozen. - 100 ms gives 0.24–0.35 and 125 ms 0.17–0.21 on clean links. - With the throttle fix, the needed depth drops by one tick (§3.2). - The adaptive rule lands at ~100–160 ms on clean links and 250 ms at 100 ms / 2 % (TCP). It never jumps, because it slews. - **Extrapolation** gives the lowest delay (46–100 ms, ≈ one-way + 10 ms) at 0.26–0.44. - It owes that to the roller's straight-line motion. - The surveyed sources reject it for colliding rigid bodies: it goes through floors and snaps back (Fiedler, *Snapshot Interpolation*). - Our piles would show that, so it is a bounded fallback for a starved buffer, not the model. - **Head of line (owner hypothesis 2).** - **40 ms / 1 %:** TCP vs datagram at interp 100 is 0.27 vs 0.22. Not worth a transport. - **100 ms / 2 %:** 0.85 vs 0.36 at 100 ms, and 0.65 vs 0.23 at 125 ms. Matching the datagram's 125 ms smoothness costs TCP ~250 ms of buffer. That is the measured value of a datagram transport: **~100–125 ms of remote-body latency on a 100 ms / 2 % link**, and nothing on a clean one. - These rows are entity state alone. §5 shows what happens when edits share the socket. ### 4.2 Reversals (a qualitative note) The roller reverses every 3 s (a scripted impulse). - Snap shows the reversal on the first frame after the pose arrives. - A buffer shows it D ms later, but at the right speed. - Exp-smooth shows it late *and* rounded: a ~τ slew through zero velocity. - No model invents motion that did not happen, except extrapolation, which overshoots by up to one update (≤ 1.3 v here). ### 4.3 A pile body at the mid-band rate `pile-huge` entity 326 (loopback, 8.5 Hz delivered, gaps p95 183 ms / p99 338 ms, jostling at 12 v/s): | model | step error | delay | frozen | |---|---|---|---| | snap | 2.05 | 108 | 95% | | exp-smooth | 2.22 | 162 | 11% | | interp 125 | 1.80 | 126 | 34% | | interp 150 | 1.48 | 130 | 16% | | interp adaptive | 1.62 | 184 | 11% | - At 8 Hz with 0.3–0.4 s holes, no render model rescues contact-rich motion: the samples miss the bounces. - **This needs rate, which is §6 + §10 (b), not a better buffer.** ### 4.4 Browser (headed Chromium on utsuho) Headed Chromium (RX 5700, `with-gpu-display`, 60 Hz vsync), GI on, 800×600, camera at the headless viewer's pose. 60 s per condition, one run each. - **Data:** the main thread's `EntityPos` *dispatch* times (what `onEntityPos` applies) and the real frame-start times. - **"Snap"** replayed on these is exactly what the browser rendered: the latest dispatched pose at each frame start. The other models are what the same browser would render from the same dispatches. - **Frames were steady** in every run: interval p50 16.8–17.0 ms, p99 17.3–17.5 ms, max 22.6 ms. So the judder below is not frame pacing. Steady state (from 15 s, or 25 s at 100 ms / 2 %; see below). Cells are step error / delay ms / frozen frames. | condition | rate Hz | send → main-thread dispatch p50/p95/p99/max ms | snap (today, as rendered) | interp 100 | interp 125 | interp adaptive | |---|---|---|---|---|---|---| | LAN | 22.1 | 1/2/3/4 | 1.61 / 40 / 63% | 0.31 / 102 / 1% | 0.19 / 126 / 0% | 0.36 / 106 / 2% | | 40 ms ±10, 1 % | 25.8 | 22/37/101/188 | 1.40 / 56 / 59% | 0.24 / 118 / 1% | 0.17 / 142 / 0% | 0.27 / 122 / 1% | | 100 ms ±10, 2 % | 25.9 | 53/165/203/256 | 1.71 / 98 / 64% | 0.73 / 152 / 8% | 0.54 / 174 / 5% | 0.37 / 216 / 1% | - **Today's rendered motion in a real browser:** 59–64 % of frames show the moving roller frozen, with a step error of 1.4–1.7. This matches the headless replay (§4.1) within run noise. - **The main thread adds little:** send → dispatch is 1–4 ms on the LAN. - **During the cold arrival the browser is far worse than any steady row.** Region streaming shares the socket, and nazrin runs CUBIC without `tcp_notsent_lowat`. - 40 ms / 1 %, first 15 s: entity state p95 575 ms, max 1.7 s. - 100 ms / 2 %: entity state is **12–15 s old for the first 15 s**, 4–6 s at 15–20 s, then settles at ~53 ms p50 from ~25 s. - LAN: one stall to 2.4 s in the first 15 s, the first-paint window. - This is `net-latency` §3 again. It is a host-sysctl matter (§5.1), not an entity-protocol one. No render model can hide seconds. ## 5. Edits, spawns, the realtime queue Headless client 75 v from the edits; a sphere carve/fill, radius 12 v, every 2 s. Times are client-side, from send to the first `RegionEdit` for the edited region. Server columns come from the trace. | condition | click → RegionEdit p50 / p95 / max ms | server apply / +normals ms (p50) | spawn → EntitySpawn p50 / p95 ms | realtime age while editing p50 / p95 / p99 ms | without edits p50 / p95 / p99 | |---|---|---|---|---|---| | LAN | 37 / 52 / 76 | 17 / 20 | 1.3 / 2.1 | 0.2 / 0.4 / 0.7 | 0.2 / 0.4 / 0.5 | | 40 ms ±10 | 80 / 92 / 103 | 16 / 19 | 41 / 65 | 22 / 25 / 25 | 22 / 25 / 25 | | 40 ms ±10, 1 % | **182 / 309 / 919** | 17 / 20 | 42 / 61 | 24 / **524 / 779** | 23 / 42 / 100 | | 100 ms ±10 | 137 / 145 / 153 | 16 / 19 | 103 / 141 | 53 / 55 / 55 | 52 / 55 / 55 | | 100 ms ±10, 2 % | **680 / 1333 / 2185** | 16 / 19 | **1055 / 2341** | **1465 / 3037 / 3418** | 55 / 184 / 223 | - "Realtime age" is the NetProbe stamp age: the age of entity state when the client reads it. - **Bytes per edit:** ~205 KB on the wire per small sphere edit, about 9 `RegionEdit`s each. That is the fixture slab, which deflates ~26× (`net-latency` §10.7); natural terrain deflates ~5×, so expect several times more. - **Reading.** - On a clean link an edit costs RTT + ~20 ms server + decode. - Under loss, a single CUBIC stream carrying ~100 KB/s of edit results is near its Mathis bound. At 100 ms / 2 %, MSS/RTT · 1.22/√p ≈ 125 KB/s. The kernel queue fills, and the realtime class (entity state, spawns) waits behind it for seconds. - This is `net-latency`'s finding again, now driven by edits instead of streaming. - The host sysctls decided for chiyari (BBR, `tcp_notsent_lowat`) target exactly this; §5.1 measures them. - Sending the *command* (~40 B) instead of ~205 KB removes it at the source. - **Grab/drag.** The headless grab script was not a valid step test: the held die swung on the spring, and 50 %-crossing times mixed spring dynamics with network. The network part of a held body's lag is the command's one-way trip plus the state's (§4.1, send→arrival) plus 0–33 ms sampling and the throttle race: - ≈ 20–60 ms on the LAN; - ≈ 60–110 ms at 40 ms; - ≈ 120–170 ms at 100 ms; - several hundred ms at p95 under loss while edits run. - The spring's own response is physics and is not counted. ### 5.1 With chiyari's host sysctls (BBR + `tcp_notsent_lowat`) **Not measured.** Running it means switching nazrin's system-wide `tcp_congestion_control` and `tcp_notsent_lowat` for the batch. The session's permission check refused that, because it changes a host setting the other agent's servers share. It is left for a run the owner approves. What the earlier rounds measured for the same mechanism (one socket, bulk lane, BBR + a small unsent queue) suggests the size of the effect: - `net-transport` §10.3, headless at 80 ms + 0.5 % loss: realtime state p50/p95/p99 40/64/129 ms with BBR + lowat, against 5.3–11.4 s p50 on main. - `net-latency` §3.2: 40/63/146 ms for the same pair. - If edit bursts behave like streaming bursts, BBR + lowat should bring §5's 1.5 s p50 / 3.0 s p95 while editing back to about RTT/2 + 1 RTT at p95. - It does not shrink the ~205 KB per edit. BBR sustained 6–9 MB/s at 80–150 ms with 0.5–1 % loss (`net-latency` §2), so that is ~25–35 ms of link time plus a retransmit RTT when a segment is lost. On natural terrain (~5× less compressible) it is several times that. - Only (c) removes those bytes, and with them the edit's place in the queue. ## 6. Packet size `logs/net-entity/quant.py` re-encodes the recorded pile-huge (48 825 updates, 1595 ticks, 30.6 bodies per tick) and realistic-island-16 (5953) streams: | encoding | pile-huge B/update | realistic-island-16 | |---|---|---| | today: 45 B message + 2 B WS header each | 47.0 | 47.0 | | batched f32, one frame per tick | 44.2 | 44.4 | | batched f32 + deflate per tick | 29.8 | 26.5 | | **quantised**: id varint, position 3×22 bit at 1/32 v (±65 536 v), smallest-three 3×10 bit | **13.5** | 13.7 | | **quantised delta** vs the last sent pose (zigzag varints), rotation only if changed | **8.3** | 8.8 | - **Error.** Position ≤ 0.016 v (1 mm). Rotation p50 0.09°, p99 0.14°, max 0.23°. On a 64 v die that is ≤ 0.13 v at the corners. 12-bit components quarter that for +0.75 B. - Velocity (for Hermite interpolation or extrapolation) would add ~6 B. - **Scale.** All 500 pile-huge bodies at 30 Hz: - 705 KB/s (5.6 Mbit/s) today, which the 48-message cap prevents; - 203 KB/s (1.6 Mbit/s) quantised; - 125 KB/s (1.0 Mbit/s) delta-coded. - Under a 0.5 Mbit/s budget, delta-coded: 7700 updates/s, i.e. every body at 15 Hz, or near ones at 30 Hz. - Teardown's budget is about 1 Mbit/s per client (§8). - **Delta on TCP.** Over the WebSocket every sent pose is delivered in order, so "last sent" *is* the acked baseline. Over datagrams it needs acks (Fiedler's per-object acked baseline, Unity's 3 baselines). ## 7. Own avatar and touched bodies - **Own avatar: already zero-latency locally** (§1.2). Remote observers see it through the actor path: - `PlayerPos` every 33 ms, one way, then the next look tick (0–33 ms), the throttle race, one way back; - then exp-smooth, ~40 ms lag at 30 Hz. - Roughly RTT + 40–100 ms behind, and smooth. - A timestamped buffer (§10 a) applies to actors too and replaces the τ lag with a fixed delay. - **The unpredicted part is contact.** - The client collides the eye against entity parts *as rendered*: one way + sampling old today, and + the buffer delay once (a) lands. - The server's shadow pushes bodies at the *reported* pose (one way + ≤ 33 ms old). - So a player walking into a moving body collides against where it was, and sees a push answered one RTT later. - The same holds for grab/drag (§5). - **Interpolating nearby bodies 100 ms in the past makes contact worse, not better.** This is why every surveyed stack splits bodies into interpolated (observed) and predicted / locally simulated (touched). Examples: Unity's prediction switching, Photon's Forecast physics, Roblox and Fiedler-VR ownership. - **Client physics in wasm (measured here):** - `cargo build --release --target wasm32-unknown-unknown` of `physics-rs` succeeds unmodified, with `wasm-ld` from nixpkgs lld 21: **918 094 B, 256 602 B gzip -9, 179 715 B brotli -q 11**. That is about Rapier's 1.57 MB. - **Not run.** It exports the same C ABI as the `.so`, so a JS shim would marshal into linear memory as `rust-host.ts` does. - `micropool` (per-body parallel detection) must take its serial path: wasm32-unknown-unknown has no threads without the atomics build, and detection is already parity-preserving serial vs parallel. - **Determinism:** no `target-cpu`, no `mul_add`, no transcendental in the step (only `sqrt`, which IEEE rounds exactly). So native x86-64 and wasm f64 should be bit-identical. Test it the way the Rapier docs suggest: hash the state every step on both and compare. - **Terrain:** the client holds the same SVT region bytes (ml0 within the full-detail radius, 4 regions, which is also where collision matters). But the physics engine needs surface initiators, which it builds natively (`phys_build_surface_init`), and those would build client-side too. - **What it would take:** the client steps a *local island* (held body, bodies in contact with the avatar or the held body, their contacts) at 60 Hz on the client clock, plus the avatar as a kinematic body. It reconciles to server state by a render-only error offset that decays (Fiedler's 0.95–0.85 per frame). §10 (d) has the plan and the owner decisions. ## 8. State of the art (survey) A literature pass (`docs/net-entity-survey.md`, 2026-10-27). GDC Vault was in maintenance and Valve's wiki returned 403, so items from those are marked **[unverified]** where they rest on search snippets. **(secondary)** marks a write-up by someone other than the author. **Remote bodies: snapshot interpolation.** - Fiedler, *Snapshot Interpolation* (2014), https://gafferongames.com/post/snapshot_interpolation/ - buffer ≈ 3 send intervals to survive two lost packets (350 ms at 10 pps, ~150 ms at 30, ~85 ms at 60); - Hermite with velocity at low rates; - "avoid extrapolation for rigid bodies". - Valve Source: `cl_interp` 0.1 s = 2 intervals; extrapolation only ≤ 0.25 s when starved; deltas vs the last acked snapshot. https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking **[unverified]** - Unity Netcode for Entities: interpolated vs predicted ghosts. The interpolation delay adapts to RTT, jitter and arrival rate; clock time-scale slewing; extrapolation capped at 20 ticks. https://docs.unity3d.com/Packages/com.unity.netcode@1.6/manual/interpolation.html, …/time-synchronization.html - Clock slewing rather than jumping: Overwatch (≈ 15.2 vs 16 ms steps, **(secondary)** https://edgegap.com/blog/game-backend-deep-dive-overwatch-2016-netcode-architecture-rollback); Rocket League STS/CSTS (Epic help page, **[unverified]**). **Bandwidth: priority and compression.** - Fiedler, *Snapshot Compression* (2015), https://gafferongames.com/post/snapshot_compression/ - smallest-three 29 bits; bounded position 50 bits at ~2 mm; - delta vs the last acked snapshot, unchanged = 1 bit; - 901 cubes at 60 Hz fit 256 kbit/s. - Fiedler, *State Synchronization* (2015), https://gafferongames.com/post/state_synchronization/ - priority accumulator under a byte budget; a jitter buffer of 4–5 frames; - render-only error offset, ×0.95–0.85 per frame by error size; - at-rest priority boost until acked. - Halo: Reach (Aldridge, GDC 2011): Tribes-model prioritised unreliable state plus reliable events **(secondary)**. - Unity: importance × age × distance, up to 3 acked baselines. **Touched bodies: authority or local prediction.** - Fiedler, *Networked Physics in Virtual Reality* (2018), https://gafferongames.com/post/networked_physics_in_virtual_reality/ - the toucher takes authority, a grab gives ownership, the host arbitrates; - quantise both sides every step; - co-op only, because the server cannot verify the client. - Roblox network ownership: automatic proximity hand-off; `SetNetworkOwner`; the server must validate. https://create.roblox.com/docs/physics/network-ownership - Photon Fusion 2 *Forecast Physics*: extrapolate network bodies into local time and reconcile; full predicted resimulation is "very CPU expensive". https://doc.photonengine.com/fusion/v2/getting-started/release-notes/whats-new-2-1 - Unity predicted ghosts re-run physics per rollback tick; it "can spiral". Prediction switching moves a body between classes. https://docs.unity3d.com/Packages/com.unity.netcode@1.6/manual/physics.html - Rocket League (GDC 2018): full prediction of a few bodies. The detail is **[unverified]**, and it works because there are 9 bodies. - Rapier: wasm "fully cross-platform deterministic" given insertion order and deterministic init math. https://rapier.rs/docs/user_guides/javascript/determinism **Edits.** - **Teardown multiplayer** (Gustafsson, 2026-03-13), https://blog.voxagon.se/2026/03/13/teardown-multiplayer.html - destruction rewritten in fixed point and sent as **reliable ordered commands** ("cut shape at voxel x,y,z"); - sending voxel data "choked" connections; - bodies sync unreliable latest-wins with a per-client priority queue, ~1 Mbit/s; - late join replays the command log; - visible snapping under load. - Architecturally the closest public analogue. - **Minecraft (1.19+) block-change sequence / Acknowledge Block Change.** The client tags local changes with a sequence, keeps server-verified state per position, and reverts its guesses on ack. https://minecraft.wiki/w/Java_Edition_protocol/Packets - Fortnite building: no primary source found. **Transport.** - WebTransport with datagrams: Safari / iOS 26.4 (2026-03-24). https://webkit.org/blog/17862/webkit-features-for-safari-26-4/, https://caniuse.com/webtransport - RFC 9308 cites 3–5 % of networks blocking UDP. - Google's QUIC paper (SIGCOMM 2017): 4.4 % of clients blocked. - RACK-TLP (RFC 8985): a lost tail is repaired in ~2–3 RTT. - Simula thin-stream work: game streams rarely trigger fast retransmit. - Fiedler: TCP lockstep hitches "every few seconds" at 100 ms / 1 %. - Full survey with every URL and the unverifiable items: `docs/net-entity-survey.md`. **Mapped onto us.** - We are server-authoritative with chaotic piles, so the default class is **interpolated** (snapshot buffer). - Prediction is reserved for the avatar (done: client-authoritative) and for the handful of bodies it touches. - Lockstep/rollback of the whole world is out: hundreds of bodies, 4 TGS substeps, and late joiners. - Edits map one-to-one onto Teardown's command stream plus Minecraft's seq/ack. ## 9. Transports with Safari | option | Safari | removes TCP HoL | server side for us | deploy | what it buys (§4–5) | |---|---|---|---|---|---| | **WebSocket (today)** | all | no | Bun built-in | Caddy, working | baseline | | WebSocket + BBR + `tcp_notsent_lowat` (host sysctls on chiyari) | all | no; keeps the queue short | none | sysctls (decided 2026-10-25; `net-latency` §10.1) | §5.1 | | Two WebSockets (state / bulk) | all | separates queues; each still in order | Bun | trivial | state no longer waits behind edit and terrain bytes; loss still stalls state (§4.1 TCP rows) | | **WebTransport** (QUIC: datagrams + streams) | macOS / iOS **26.4+** (OS floor); Chrome, Edge, Firefox | yes: datagrams for poses, a stream per edit / region | **not Bun** (#13656 open): a sidecar, Go `webtransport-go` or Rust `wtransport` | UDP to chiyari; stable Caddy 2.11.7 cannot proxy (passthrough merged for 2.12), so its own UDP port + cert or Caddy master; WebSocket fallback for 3–5 % | 100 ms / 2 %: ~100–125 ms of buffer, or a 2.4–2.9× smoothness gain; none on clean links | | WebRTC DataChannel (`ordered:false, maxRetransmits:0`) | Safari 11+ | yes | node-datachannel / werift (Bun unverified) or a Pion / str0m sidecar | ICE (ICE-lite on a public IP), DTLS/SCTP, UDP; TURN-over-TCP or WS fallback | same as above, heavier stack | | WebSocket over HTTP/2 / HTTP/3 (RFC 8441 / 9220) | — | no (h2) / per stream (h3, not shipped in browsers) | — | — | nothing | Safari WebTransport sharp edges **(secondary, measurement-based**, https://echo.semantic-ui.com/compat): - the server must advertise `WT_MAX_SESSIONS` and the initial flow limits; - user-installed root CAs are ignored; - the HTTP/2 fallback silently drops datagrams (use `requireUnreliable: true`); - `datagrams.createWritable()`; - don't open a stream per message (credit is not released). ## 10. Plan Ranked. Each step is measurable on its own; numbers are from §3–§7. **(a)–(c) need no transport change.** ### (a) Remote smoothness: timestamped snapshot interpolation (first) - **Wire:** a look-tick header carrying the server sim time (or step index) for every pose in the tick. This is natural once poses are batched (b). Before then, it is a 4-byte field on `EntityPos`. - **Client:** - a per-entity ring of (server time, pose); - a render clock = estimated server time − D; - D adaptive: p99 of sample lateness over ~2 s, slewed ≤ 2 % of real time, floor ≈ 2 send intervals; - linear position + slerp; Hermite once velocity is sent; - hold, then bounded extrapolation (≤ 100 ms) when starved. - The same for constructs and actors, which deletes the separate τ smoothing. - **Server:** the throttle slack (§3.2), or schedule by tick count. - **Expected:** step error 1.4–1.9 → 0.2–0.35 on clean links (0.17 at 125 ms); 1.89 → 0.29 adaptive at 100 ms / 2 %. Display delay +70–90 ms for observed bodies. - **Cost:** small. A client module, one wire field, the throttle line. - **Risks / standing rules:** - **No mode shifts.** - Starting: a body waking after sleep must interpolate from a sample at its rest pose stamped one interval before the first moving sample, not from the old sleep timestamp. Otherwise it slides for the whole gap. - Stopping: the final pose is already sent; the buffer converges onto it with no pop. - Delay changes slew (no jumps); rule-checked in the prototype by the adaptive model's ≤ 2 % slew. - **Terrain parity:** none involved. - **Contact with nearby bodies gets older** (§7); (d) addresses it. - **Measure in the prototype:** - the §4 table in the browser on utsuho (step error, frozen, delay), LAN and 100 ms / 2 %; - a sleep/wake strip of `slam-stack` / `die-slam` for pops; - the per-frame CPU of the buffer at pile-huge (500 bodies). ### (b) Rate: priority accumulator + quantised, delta-coded batched poses - One message per look tick per session: - a tick header; - entities sorted by id (varint deltas); - position at 1/32 v, smallest-three (10–12 bits); - delta vs the last sent pose (TCP = acked); - optional velocity. - Replace the bands and the 48-message cap with a **priority accumulator** under a byte budget: - priority from distance, screen size, "recently collided / woke", "held or touched by anyone"; - unsent bodies accumulate, so nothing starves. - **Expected:** 47 → 13.5 → 8.3 B per update. All 500 pile-huge bodies at 30 Hz in ~1.0 Mbit/s, or every body ≥ 15 Hz in 0.5 Mbit/s, against today's mid-band p95 248 ms / p99 396 ms. - **Cost:** medium. An encoder and decoder in common, the scheduler, and the budget knob. - **Risks:** an owner-set bandwidth budget per client. The quantised pose must be what the client renders *and* the baseline the next delta is coded from. Server physics stays f64; quantising the sim itself is not needed without client physics. - **Measure:** the §3 and §4.3 tables at pile-huge and realistic-island-16: bytes/s, per-body interval p95/p99 by distance, step error of mid-distance bodies. ### (c) Edits as commands, applied optimistically, reconciled by seq/ack - `EditTerrain` / `EditEntity` carry a client sequence number. - **Client:** - applies the brush locally at once: `applyCsgEdit` is in `common/`, and the stamp resolver needs the prefab bytes the client already has for previews; - refreshes normals locally for the dirty bbox; - keeps the server-verified bytes for touched regions and structures; - while edits are pending, holds back server region updates for those regions. - **Server:** - applies in arrival order; - broadcasts the **command** with (editor, seq, server order) to peers holding the region, instead of the result; - sends the result bytes only on divergence, to late joiners, or as a periodic hash check. - The editor gets an ack(seq) plus a region version / hash. - On mismatch the client adopts the server bytes: the same path as today's `RegionEdit`. - **Parity:** the same rule for terrain regions and entity structures. Both are SVT64 byte trees edited by `applyCsgEdit`; COW and interning stay server-side, and the ack carries the resulting structure id. **No terrain/entity split is needed.** - **Determinism:** the client must produce the server's bytes. - `applyCsgEdit` is shared TypeScript over integer voxel coords. Shape tests use float maths (sphere / box / rotated stamp), but the code is the same, so it is deterministic unless the inputs differ. - Normals (`refreshNormalSVT`) are shared too. - A hash in the ack catches any drift. - **Expected:** - Click → visible: one client frame (~16 ms + upload) instead of 37 ms (LAN) / 80 ms (40 ms) / 137 ms (100 ms), and 0.7–2.2 s at 100 ms / 2 %. - Wire per edit: ~205 KB (fixture; more on natural terrain) → ~50 B per peer. - That also removes §5's queue: realtime age while editing at 100 ms / 2 % was 1.5 s p50. - **Risks:** - **Rejected or reordered edits** (another player's concurrent edit, permissions) need a visible rollback. It is rare by construction, but it is a *mode shift*: the predicted voxels flip to the server's. Flagged: needs an owner call on how it should look — instant replace, or a short material cross-fade. - Edit *physics* consequences (bodies resting on carved terrain) are still server-side. The local edit makes a body appear to float until the server's pose arrives, about one RTT + D. Flagged. - Undo / redo become commands too. - Late join: today's region bytes already include all edits, so no command log is needed (unlike Teardown). - **Measure:** click → visible frame in the browser (bench timestamp the local apply vs the ack); a mismatch rate from the hash over a scripted edit soak; bytes per edit; the §5 realtime-age table while editing. ### (d) Touched bodies: a local island simulated on the client - The client runs `physics-rs` (wasm, §7) over a **local island**: the held body, bodies in contact with the avatar or with it, and their contact neighbours. Terrain comes from the client's ml0 regions. - Server state stays authoritative. Two options: - **(d1) authority transfer:** Fiedler VR / Roblox. While held, the client's pose for that body is accepted by the server within validation limits (speed, penetration), and the server simulates the rest of the world against it as a kinematic-ish driver. - **(d2) prediction:** Unity "predicted ghosts" / Photon Forecast. The client predicts, the server corrects; the client blends to the server pose with a decaying render offset. No trust, more corrections. - **Expected:** grab/drag and avatar push at local-frame latency, against RTT + 17–50 ms + spring today. Corrections are bounded by the divergence over one RTT; for a held body, small. - **Cost:** large. - The wasm build and a shim; the region and surface-initiator feed; an island selector; reconciliation. - A per-frame budget: a local island of ≤ ~20 bodies at 60 Hz. The native step reaches p90 18.7 ms at 16 islands (`docs/physics-worker.md` §1), so the whole pile on the client is out. - **Risks / standing rules:** - **Visible mode shift** when a body enters or leaves the local island, switching between the predicted and interpolated timelines (one D apart). It must be blended across ~D, or it pops. **Flagged; an owner decision.** - (d1) trusts the client. - Determinism (native vs wasm) must be tested before (d2) relies on it. - **Measure:** - a native-vs-wasm state hash per step over the fixture suite; - wasm step cost for 1 / 5 / 20 bodies in Chromium, Firefox and Safari; - a grab tracking error (target vs rendered) at 100 ms; - a correction-offset magnitude distribution. ### (e) Transport: WebTransport datagrams for poses (last) - A sidecar (Rust `wtransport` fits the toolchain) terminates QUIC on chiyari's own UDP port with the `*.7x1.co` cert. - It forwards to the Bun server over a local socket. - Or it hosts the pose fan-out itself, fed by the look tick. - Poses go as datagrams: latest-wins, deltas against **acked** baselines, so (b)'s delta needs acks here. - Edits (commands) and regions go on streams. Pool streams; do not open one per message (Safari credit bug). - The WebSocket stays the fallback: same schema, coalesced. - **Expected:** - only on lossy links: at 100 ms / 2 %, ~100–125 ms less buffer for the same smoothness, or 2.4–2.9× smoother at the same delay; - at 40 ms / 1 % ~0.05; - on clean links none; - edits and regions per-stream, no cross-region HoL. - **Cost:** large and operational: a second server, UDP on the edge, certs, two code paths, Safari interop testing on 26.4+ devices. - **Measure:** the §4 table over real WebTransport (Chromium and Safari), datagram loss and reordering, and fallback rate. ### What not to do - **Not** extrapolation as the main model: it is good on the roller, but colliding bodies overshoot into contacts. - **Not** whole-world rollback / lockstep: hundreds of bodies and late joiners. - **Not** a second WebSocket instead of (c): it separates queues, but edit result bytes stay ~5000× the command. ## 11. Owner decisions 1. **Remote-body display delay (a).** Adaptive, ≈ 100–125 ms on clean links (step error 0.17–0.35, frozen ≤ 2 %), against today's ~35–90 ms with 60 % frozen frames. The trade is +70–90 ms on observed bodies for 4–8× smoother motion. Alternatively, a fixed floor. 2. **Per-client bandwidth budget (b).** 0.5 Mbit/s gives every pile-huge body ≥ 15 Hz; 1 Mbit/s gives 30 Hz (delta-coded). Today's uncompressed stream is capped at ~0.55 Mbit/s by message count. 3. **Rotation precision (b):** 10-bit smallest-three (0.09° p50, 13.5 B) or 12-bit (+0.75 B). 4. **Optimistic edits (c):** how a rejected or reordered prediction looks (instant replace or cross-fade); bodies on edited terrain lag by ~RTT + D. Both are visible states the owner should pick. 5. **Touched bodies (d):** authority transfer (d1, client-trusting, simplest, smallest corrections) or prediction (d2, server-trusting, needs determinism and a blend when a body joins or leaves the island). Also whether (d) is wanted at all before (a)–(c) are measured. 6. **WebTransport (e):** whether a sidecar, UDP on chiyari and a 26.4+ floor (with WebSocket fallback) are worth ~100 ms on lossy links. 7. **Host sysctls on chiyari** (BBR + lowat, decided 2026-10-25): §5.1 says what they buy for edits and state. Confirm they are applied. ## 12. Throwaway instrumentation on this branch None of it is for merge: - `server/src/net/ent-trace.ts` (`NET_ENT_TRACE=`) and its hooks in `worker-host.ts`, `entity-manager.ts`, `session.ts`, `main.ts`; - the `NE_THROTTLE_FIX` knob in `entity-manager.ts`; - `client/src/net/ent-trace.ts`, its two hooks in `main.ts` and the bench `ent_trace` command; - `scripts/net-entity/entclient.ts`.