Repository navigation
sminos: desk open-fast — a session view opens in tens of milliseconds - #302
Merged
Merged
Conversation
Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…n reuse proven Two sender lanes, each a thread with one kept connection to the hub, post what the main thread queues: the log lane the log plane's frames (the connect's bundle, uploads, outcomes, rejections, machine presence, every re-hello, one entry per body), the session lane the session plane's, the requests' and the RPC results, a project's frames held until its hello was answered. The main thread never waits on the network; a held re-hello stalls the log lane alone. Marks the handshake heals are placed at enqueue, the others (presence tombstone, rejections reported, outcomes dropped) in a continuation run after the 200; any POST not answered 200 still ends the stream. A stale keep-alive is dropped before the send or retried once on a send failure; each dial and close is said in daemon.log with its count. sminos 1.2.8. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
… hello's own read, bookkeeping that never latches A project opened again (a `not-open` mid-stream) closes its session-lane gate before its new hello, its queued messages kept back in order, and is opened once while a hello of it is out. Each hello's continuation marks the presence read it carried, not the latest. A continuation opens the gate and clears its in-flight flags first; a rejection record or outbox drop that fails is kept and retried on the next pass, never posted again. An upload pass draws nothing while the log lane is full. The scripted hub takes a lane's early hang-up quietly. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…s out leaves its vector A `not-open` refusal that arrives while a hello of the project is out concerns a frame sent before that hello, which is opening it again; it no longer resets the vector that hello's `have` brought (the hub's chains answer apart), so the project's uploads go on. A loss after the hello is refused again once it is answered, and handled then. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
… sminos 1.2.9) Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…ow its hello Once the replacement hello's continuation releases the session lane the two lanes are independent, so an upload on the log lane may legitimately come after the session message (sminos-suites failed on 417210c with 2 != 3). Assert the message follows the replacement hello and carries its body, which is what the gate promises. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…look off the open path A transcript's build (index, jobs ledger, chain) is saved under daemon/plane/<sha256(realpath)[:24]>.build after its first extend in the process, after every SAVE_GROWTH of growth, as it is evicted and at the uplink's stop (STOP_SAVE_SECONDS), and the first extend of a new Transcript loads it; a build of another format, shape, file or inode, or of a shorter file, is removed and the build starts cold. The uplink sweeps builds past BUILD_KEEP_DAYS at its start. Each worker has a foreground and a background queue. The warmer, kept across the uplink's streams, holds every live member's main transcript of the open projects and extends it as a background job: one per transcript, WARM_PARALLEL across the process, round-robin. INDEX_KEEP rises to 32. An open's build no longer looks at the disk: the snapshot goes with the facts as they stand and the look is asked right after it. Both open branches (a bridge that keeps named blocks, and the legacy wait) are kept. The daemon's UPLINK_STOP_GRACE rises from 3 to 8 s so the stop save has its bound. bench_index.py measures a build cold, loaded and warm. bench_rig closes a spawned child's log file in the parent. sminos 1.2.10. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…o opens bench_scale opens on the branch showed the cold start's +0.5 s small open at E 0.51-0.73 s (0.02-0.09 s before M7): the first warm round began at the uplink's first tick, and two cold builds sharing the GIL stretched the stream's handshake threefold, with the open behind it. The first round now begins WARM_EVERY after the warmer's first tick, and no warm job is submitted while an open awaits its snapshot. With that, the same run gives small 0.02-0.11 s, large 0.43-0.45 s (its own cold build). test_scale's BenchOpens reads the builds as M7 makes them: the first open on a fresh machine is cold or warm, and after the restart it is loaded. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…the hub answered; a paced upload backlog sealed once P1: Requests.sent at enqueue dropped a settlement from the outbox and kept it in daemon/requests.json as relayed, so a POST lost, a stream cut or a daemon restart before the hub had it lost it for good (the handshake rebuilds the pending set, never a settlement). Requests and Rpcs split sent into sending (at enqueue: a complete set taken, an RPC result taken as sent on this stream, every other message in flight) and delivered (in the continuation of the POST that carried it); a welcome resets what was in flight. The relays send one entry per project, each with its own continuation. The DX4 compact messages had the same flaw and take the same path. P2: HubLog.uploads draws lazily and next_upload keeps the draw between the uplink's paced passes, so a backlog over UPLOAD_AHEAD is read and sealed once, not once a pass. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…er per file, departures, failed saves - A load reads 16 rows at their saved offsets (first, last, evenly between) rather than the last alone, so a same-inode rewrite that keeps the tail is refused. - An evicted Transcript stays `retiring` until its save has run, and is handed back if acquired meanwhile: one worker orders every save of a file, so an older build never lands over a newer one. - The warmer reconciles membership every period, pruning a pending round, so a round held up by opens no longer holds departed sessions. - `saved` is what is on disk; the growth throttle has its own mark. The stop and an eviction retry a dirty build, and the stop counts outcomes. - bench_index runs the scripts under a temporary HOME as well. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
… hub answered 200 and may have refused The hub answers 200 even to a session frame it refuses `not-open`, and the refusal comes down the stream before that answer or after it. A settlement in flight across a re-open was retired by the old POST's 200, and one answered before the refusal had already left the outbox: lost either way. New sminos_flights.Flights, used by Requests (settlements) and Rpcs (compaction messages): a per-project epoch that `sending` records and `delivered` checks, so a POST of an attempt a not-open voided takes nothing; a message answered 200 is held, still owed, until a hello of its project queued after it is answered (open, follow change, archive period), and only then is a settlement written to daemon/requests.json. A not-open (either branch of on_refused) owes again everything of the project in flight or held; a new stream owes again everything held. The hub takes a duplicate settlement once (Project.settled, markSettled). Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
… by a bounded probe A held message is stamped when it is answered 200, not when it was queued, so only a confirmation queued after that 200 confirms it. The confirmation is the project's own probe: an empty `events` frame on the log lane, CONFIRM_AFTER (2 s) after the first held message was answered, one out at a time per project (Link.confirm_held, every tick). The hub does nothing with it when it holds the project open and refuses it `not-open` before answering when it does not (the refusal owes the held messages again). The archive-period and follow-change hellos no longer confirm: a hello re-opens the project, so it cannot surface the refusal. A hello's own POST still confirms what it carried. A refusal lets go of the voided attempts' frames, keeping a newer attempt of the same one. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…ved prefix; numbered retirements - Index keeps the CRC-32 of the bytes before its end, folded in as it reads; a load checks the file's prefix against it (0.04 CPU-s for CI-opt's 317 MB) instead of a row sample, which two adjacent rows trading a byte, or a row re-parented at the same length, passed. BUILD_FORMAT 2. - Each eviction's retirement has a number an acquire voids, so a save that ends lets go of its own retirement only, never of one begun during it. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…lded Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…es left, said as they are confirm_held states its bound as CONFIRM_AFTER plus the probe's wait in the log lane's queue (behind uploads and any held log POST) plus its exchange, and sminos_flights names both losses left to the hub's answer: the frame's control-lane refusal undelivered on a project re-opened meanwhile, and the probe's replies-lane refusal not yet dispatched by the stream's reader when its answer's continuation runs. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
… the engine's limit The mod's first respawn of a child that ended on its own is immediate (RESPAWN_FIRST_MS 0), the next after RESPAWN_STEP_MS (1 s), then doubling to a minute; a stable run is timed on the engine's clock. A block's kept text is its last BLOCK_TAIL (65,536) characters, marked truncated, in the mod and the child alike (chunk events stay whole); a resync is posted alone and drops streaming messages oldest first past RESYNC_MAX; a batch too long for one post is split. bridge_order's reader takes the plane's rule for a loose cut (due from the snapshot, forgotten past it). DX5 amended. sminos 1.2.12. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…kill The mod follows a child that ran STABLE_MS at once and a younger one's successor after RESPAWN_STEP_MS, by design (open-fast §6); back-to-back kills measured that backoff (E_kill 0.19 / 1.18 / 2.41 s). Each kill now comes once the child has run 30.5 s, and its line says the child's age. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
… its inventory The kill scenario took its inventory at the session's result line, when the turn's last rows (the response, the Stop hooks' summary) are on disk but not yet at the client: they counted as holes when the race went that way (2 / 3 / 0 in one run, 0 in nine others). It now waits for the last row on disk to be held, as after-prompt and long-answer do, and says how many rows were still on their way at the result (rows_after_result). Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…; pending inputs bounded in a resync A failed post's 500 ms retry is scoped to the generation of the child it went to: a post in flight when its child died sets none, and a wait set for a child that then died holds up nothing of its successor's, so a respawn's session start and resync go at once. A resync still past RESYNC_MAX once its streaming entries are dropped shortens pending permissions' inputs, largest first, each string held to RESYNC_INPUT_CAP and the entry marked truncated; every request keeps its identity, and a question's input stays whole. The Unicode boundaries are tests: exact UTF-16 length, a cut across a surrogate pair, the child's code points, and the deliberate difference between the two. DX5 amended. sminos 1.2.12. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…the holes folded Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…and M8; sminos 1.2.13) Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
… corrected Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…he lanes; 1.2.14 CLAUDE.md's sminos row gains a clause for the plane's saved builds and bounded warmer and one for the uplink's sender lanes, their connection lines and the settlements' confirmation probe. The plane's docstring says a saved build loads only while its prefix's CRC holds and why the warmer waits; the bridge mod's says a crashed child is started again at once, and the stream's that an oversized resync shortens pending permissions' inputs after dropping streaming entries. sminos 1.2.14, the branch's last bump. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…d; two checks M6 and M8 outdated
A lane dropped a connection whose answer closed it ("the hub closed it")
before reading the status, so a 503 that also closed the connection was
logged as a close, not a failure: the owner's daemon.log read (A5, A9)
would misname it. The caller now drops after the status check, a non-200
first. Uplink.test_h read the class's whole daemon.log and passed in the
suite only on an earlier test's line; it reads what its release wrote. A
Lanes test pins the closing 503. live-bridge-check's stale-socket clause
assumed the respawn's old second; it now checks that a killed child's
endpoint is taken over by a successor that answers, with the time.
Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…edence in §3 Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…enews; one dial per lane; no split surrogate; 1.2.15 - Sender.hold drops a re-opened project's queued entries its hello sends anew (pending set, presence, raises, settlements, RPC results, compaction messages), so no older copy follows that hello; a subscription's messages are kept. - A lane has one dial out at a time: one its watcher gave up on is waited for by the next exchange and lands only while the lane stands, closing itself otherwise; lost() ends the lane. No late dial replaces the connection in use, and stalled warms leave one worker. - capped never ends a cut on a high surrogate (the resync's RESYNC_INPUT_CAP and TEXT_CAP alike); the bridge child keeps a held request's raised copy on a truncated resync, so a decision's digest still matches the input the session holds. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…ealed by a fresh set and presence A session-lane body of a project that was out when the hub refused it `not-open` can be applied after the re-open's hello (a large body still uploading while the small hello lands), its older pending set and presence over the new. Sender.hold now says whether a body carrying the project is out; when one was, the hello's continuation owes the set again and has the plane say the members' presence again, both behind that body on its FIFO lane. RPC results there are duplicates of final outcomes; compaction messages are already re-queued behind it; raises and settlements are covered by the fresh set. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…ady held, the branch stays 1.2.15 Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…ain merge Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…not running again; 1.2.17 A member whose live presence was in a session-lane body out at a `not-open` re-open, and that left meanwhile, lost its queued tombstone to Sender.hold; the heal re-sent current members only, so the hub, applying the held body after the hello, kept the leaver live for good. The plane now keeps the sessions it said not running and has not seen back (`gone`), and say_again's pass says them not running again too. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…bounded by age `gone` kept every session that ended in an open project for the uplink's whole life, and each re-open heal said them all not running again. Only a session live when a body still in flight was formed can be contradicted by it, so each leaver is now kept GONE_KEEP (300 s: the in-flight body's 60 s deadline, the hello's as long again, and the live presence's wait in the lane's queue) from when it was first said gone. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…dy it heals, not the leave; 1.2.18 A live presence can wait in the session lane's queue past any age bound from the leave, so a heal at 301 s missed a leaver whose body was still to land after the hello. Entries now record when they were queued, hold returns the oldest queue time of the project's lines in the body out, and the plane says again every leaver it first said gone at or after that time: a live presence is queued before its tombstone, so every leaver the body can contradict is among them. GONE_KEEP is now an hour's memory cap. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…olded Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
This was referenced Oct 21, 2026
Closed
Merged
9 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Desk open-fast: a session view in the desk now opens in tens of milliseconds at ordinary load, including mid-message, right after a prompt, after a daemon restart, and after a bridge child crash. Before, it took seconds, and some opens were abandoned after 19–51 s. All of this is machine side, in the sminos plugin. The two MAWS pieces, the hub's reply chain (#85) and the web's carried block (#86), are merged and deployed. Spec:
docs/doperpowers/specs/2026-10-20-desk-open-fast-design.md. Execution report:docs/doperpowers/specs/2026-10-20-desk-open-fast-report.md.What changes:
namedBlockskeeps the old cut wait.bench_open.py,bench_scale.py opens,bench_index.py, the reference consumer and inventory, the HTTP/1.1 hub stand-in and the pause proxy.Rolling order (the coordinator's): #301 (M5), then 4400ced (M6 and its fix), then this branch (M7 and M8). Every desk client must be refreshed before M5 rolls. This branch merges main after the first two land, taking main's version and bumping above it. Nothing on the wire between machine and hub changes, and no Durable Object storage changes.
Validation Evidence
All figures below are at load 4.9–9.7 (
uptimerecorded before each run), against the local hub (MAWS 0f9c18d65 with M4), with live haiku sessions. Logs are in the executing worktree under.doperpowers/sde/2026-10-20-desk-open-fast-design/m9-runs/.python3 sminos/tests/bench_open.py --uplink --hub local --maws <MAWS> --live --scenario idle --opens 10: E 15–20 ms (bound 0.3 s), N ≤ 0.01 s, inventory clean,complete: true.… --live --thinking --scenario mid-message --opens 5: 5 of 5 opens counted, E 18–21 ms (before M5: 2–2.6 s),waits0, 0 holes, dups, gaps or undrawn.… --scenario long-answer --opens 3: 3 of 5 trials counted, E 14–21 ms, noendbefore the step's end (before M5, the open died at about 5 s).… --scenario after-prompt --opens 5: E 14–26 ms (before: 0.28–0.53 s).python3 sminos/tests/bench_scale.py opens sminos/skills/sminos/scripts --live 40 --large 6: at +0.5 s a large session opens cold in 0.485 s (build 429 ms) and a small one in 0.118 s; at +30 s every session is warm, 2–39 ms; after a restart a large session opensloadedin 0.042 s (before M7: 0.42 s cold).python3 sminos/tests/bench_index.py <CI-opt's 333 MB transcript>: cold 0.74 CPU-s, loaded 0.05, warm 0.00.bench_open.py --uplink --hub local --scenario held --pause-stream 4 --backlog 16m:hub_write_blocked: true; every one of the 37 uplink POSTs in the 4 s window answered 200 (max 22 ms); chunk lag ≤ 31 ms; the stream survived on the same generation; an open made after the resume took E 9 ms. The hub's own proofs are its vitest suites (MAWS static,unit runs 39394499617 and 39397320894).bench_open.py … --live --scenario kill --opens 3: E_kill 0.438 / 0.190 / 0.191 s (bound 0.5 s; before: 1.17–6.55 s). Across M8 and M9, 12 of 13 spaced kills were within the bound and one was 0.525 s (see Unresolved Review Findings).bridge.test.ts: a 5,000,000-character tool input followed by a new child. Every post fits under 4,194,304 characters, the resync goes alone with the last 65,536 characters markedtruncated, and there is no gap and no second resync.bridge_order.py truncated_blockschecks the real child. Both run in sminos-mods and sminos.layer.test.ts, run again 35/35 on desk-open-fast-web 30db4165c; its fixture is byte-identical tosminos/tests/dx4-stream.json. MAWS e2e:desk-web run 39409278986.test_session_plane.py(Engine,Lanes,Uplink.test_i), which run in the gates.sminos/tests/mods/live-resume-check.py14/14;live-bridge-check.py15/15 after the M9 fix.The commits are bdc1c21..4072c8b.
window.deskLatency()and the by-hand daemon.log reads on the owner's Mac (A3build: warm, A4's open lines before a 503, A5, A9's hour), all after the roll;Unresolved Review Findings
sminos/hooks/mods/bridge.tsx(hello) andbridge-stream.tsx(the poster).release'supto).sminos/tests/bridge_order.py's reader still waitsUNNAMED_AFTERfor an unnamed head. No scenario reaches this case. The reader is slower to release, never wrong.bench_scale.py opensrestarts once.test_gflake. It failed once locally under load (stray sid not found). The gates are green.joinand getting-. The branch doesn't touch that code, and sminos-suites re-run alone on the same commit passed (39508461065).Residue
The hub should report refusals in a POST's answer. MAWS
apps/desk-hub/src/objects/project.ts,fromMachineFrame, sends a session frame for a project that isn't open torefuseMachine(void this.refusal(ctx, refusal, 'control')). The write is unawaited and names no frame, so the POST still answers 200. Two windows remain where a settlement is lost:The fix is per-frame outcomes in the answer (
{frames, refused: [{index, reason}]}), or a non-200 such as409 not-open. It is a DX2 wire change plus a hub deploy. With it, the machine's held list and probe can go.The machine's in-memory outbox. The outbox, the held list and
Rpcs.compact_outlive only in memory. If the uplink restarts while a settlement is unconfirmed and that session's bridge has ended, the settlement is lost, and so are compaction messages still owed. Persisting them, or rebuilding from a durable record, would close this.No hard memory cap on the held list. It has none while the log lane is delayed (the coordinator's reviewer). Its entries arrive at human rate, but a long-stalled log lane grows it without bound.
Oversized pending questions in a resync. When whole question inputs alone exceed the engine's limit (about 64 pending asks near 64 KiB each), the resync is still oversized and is retried as lost. Shortening a question breaks answer matching. A cap on pending asks, or a paged catch-up, would close it (§7).
A vanished block on transcript-only snapshots. While a dead child's socket is stale, the plane answers re-subscribes transcript-only, with no streaming, so the client drops the named block that was streaming and redraws it from the successor's snapshot. This predates the branch. The fix: the plane could withhold transcript-only snapshots while a bridge socket exists but doesn't answer, or the web could keep a named block across a snapshot with no streaming.
The web store's
older().apps/desk-web/src/depth/source/desk-transcript.tsdoesn't dedupe within a page, so a row a page carries twice feeds rebuilds twice.An unnamed block over 65,536 characters. On a reconnect during such a block, the web draws only its tail until the row lands. A web rule that splices the tail onto overlapping drawn text would fix it.
LocalHub.sendintest_session_plane.py. It has nooutputkey, soUplink.test_g_output_through_the_huberrors underDESK_HUB=…. This is a test-helper gap that predates the branch.Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)