summaryrefslogtreecommitdiff
path: root/test/replicas.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 18:42:12 -0300
committerGabriel Schneider <[email protected]>2026-11-19 19:36:31 -0300
commit786cddd24e2be36d30847300075cec8c45d1b0ca (patch)
treecc0217a69a04fd37ddcfad1da3d5b20844c2d80b /test/replicas.zig
parent957b02838c6df8a35fccfd9aae7678d61d4f63b9 (diff)
downloadpardes-786cddd24e2be36d30847300075cec8c45d1b0ca.tar.gz
pardes-786cddd24e2be36d30847300075cec8c45d1b0ca.zip
replicas: an idle client's check answered covers the units that came while it was asked, so an idle pair stops waking (the user's bar: an idle editor does not wake): every unit a client took marked a change (`Link.take`), and the session's pump that answers a check sends one before the answer (its clock read and its advance, taped: the clock is digested, so "an empty pump sends no unit" is not safe), so each answer was followed by another check 300 ms later, for ever: a check, a session's wake and pump, a unit and an answer every 0.3 s per idle client; strace of a real idle pair (my own detached session and one terminal client, 30 s) showed every wake of both processes was that cycle (the client's timer thread's 298 ms futex wait, its main loop asking, the session's reader taking the 5-byte check, its loop pumping, its writer, the client's reader taking unit and answer) and nothing else; now a unit taken while a check is asked marks no change (the answer comes after it in the stream's order and its digest covers it), and an answer let go (the client not quiet then) marks one; the test `an idle client's check answered covers the units that came while it was asked: it asks no other until something changes` (a Link on a socket pair over a replica joined from an Authority's dump: a change, a check asked, the pump's unit, the answer, then ten quiet seconds ask nothing; a unit after it asks again; an answer let go marks a change) failed on the base and passes; measured on that real pair idle 60 s after a 5 s settle: session 120 ms of CPU and 1236 context switches (20.6 a second: its loop 3.9, its client's writer 6.8 and reader 9.9 a second), client 140 ms and 1656 (27.6 a second) before; 0 ms and 0 switches in both, and in the daemon, after; the gates on the three changes together (i3): tui core-test 843/986 (143 skipped), shell-test 1022/1025, term 15/15, pane 183/184, kitty 45/45, behaviour-test 275/275 and --replay 275/275, process-test the base's two, gui unit-test 1620/1624 + BaselineHarnessMismatch; replicas --clients 5: diverged 0/0/0, unequal 0/0/0, deltas checked/wrong 1907/0, 2028/0, 1812/0, quiet checks 623/0, 835/0, 771/0, stops not on may_wait 0/0/0, corpus 22/22; daemon.py plain, --far, --games, --window-clients, --upgrade both ways pass, and --games 10 of 10 under 24 busy processes (load 11-37); cross_replay 27 digests agree each; the frame and perf gate against tree1 (d2-i3): frames 77/77 byte-identical, corpus2x +0.005% (noise 0.044%), the 97 per-operation counts within 0.1% (largest +0.031%)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/replicas.zig')
0 files changed, 0 insertions, 0 deletions