OverviewFilesCommitsIssuesDocsReleasesPeers

keet-daemon commits / aa6e606

CPP-PORT-DESIGN §9.4: R1 done — hc::rt matches Bare (real + virtual), drill 12/13 + 1 equivalent
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aa6e606d24359318e84fde3123327dda7a8f3086
by plankatron <fleeky@gmail.com> · 2026-10-04T19:03:00.000Z

Changed files (1) +18 -0

docs/CPP-PORT-DESIGN.md +18 -0
……@@ -3144,6 +3144,24 @@ injected per layer:
31443144- **R1:** `hc::rt`, both the real libuv runtime and the virtual one. Gate: Bare probe scripts
31453145 (microtask vs timer vs immediate vs I/O vs uncaught ordering, as in the 2026-10-04 probe)
31463146 must give the same trace on `rt`.
3147- **R1 DONE 2026-10-04** (keetd 45bb1a1 + 2 gate commits). `hc::rt`: the Real (libuv) and
3148 Virtual runtimes behind one API.
3149 - **Gate `tools/rt/rt-gate.sh`:** 14 op scripts; Bare 1.28 vs rt real AND virtual, identical
3150 traces, stable over 5 runs.
3151 - **Drill `r1`: 12/13 red, 1 equivalent:** the virtual per-timer creation guard. The phase's
3152 due list is snapshotted first, so the guard matters only for a refresh to 0 ms mid-phase.
3153 - **Bare's rules, MEASURED:**
3154 - a throw in a callback is delivered after that callback's microtasks drain;
3155 - a microtask's throw is held to the end of the iteration (after the immediates);
3156 - an immediate queued in the check phase runs on the next iteration;
3157 - pending immediates run in the current iteration even if unreferenced, and Bare always
3158 runs the first iteration after the main script.
3159 - **TRAP:** libuv's `UV_RUN_ONCE` re-runs due timers after the check phase. The forced first
3160 iteration uses `UV_RUN_NOWAIT`.
3161 - **NOT ordered on Bare (measured 4/5 vs 1/5):** a 0 ms timer vs an immediate queued from an
3162 immediate. It races the clock's granularity, so gates must never compare it.
3163 - libuv 1.51.0 (keetd, via librocksdb) vs Bare's 1.52.0: one minor version apart. Align it
3164 when convenient.
31473165- **R2:** ss onto `rt` (`ss::Loop` and `ss::Timers` removed). The secret-stream trace and
31483166 interop gates are unchanged.
31493167- **R3:** mux / replicator / Core onto `rt` (Clock, `onsettimeout`, `Host::defer`,