Skip to content
quarry View Ticket
Login

View Ticket

Rebuild under 60s: adopt structural frames (zit#108), profile the fold

Fixedfa69d59bb2c62a95898cedefe47d48b6290ab12cCreated 102.0 days agoUpdated 67.9 days ago
Description2026-08-20 22:54:56
The direct frames-to-fold rebuild landed (see da65feae1c, f16b31e0b6): quarry 1s, sqlite 160s, tcl 237s — down from hours-and-never. The bar is 60 seconds for the largest store.

Remaining costs, in suspected order: 1. Streaming the full census: zit frames emits content blobs quarry discards — GBs streamed for ~200MB kept. Upstream ask filed as danmestas/zit#108 (frames --structural). Adopting it should be the dominant win. 2. Fold SQL: batched at 512/tx; FTS inserts per structural artifact; filechange ancestor rows. Profile after (1) and tune batch/tx sizes if still over. 3. Pass 2 (changes from the spool) and FinishBulk are already sub-dominant but unmeasured individually — add per-phase timing to the rebuild log line.

Invariant: full index rebuild of the largest store completes in under 60 seconds.

---- zit-side status, 2026-08-21:

zit#108 is SHIPPED (a2fb222e32, closed) and the binary on PATH carries it: 'zit frames --structural' is live. One estimate there needs revising downward before wiring: structural artifacts are 29% of sqlite's stream, not 1-2% -- --compatible manifests carry full file lists. Measured streams: sqlite 13.2GB -> 3.87GB, tcl -> 682MB. Worth wiring now, but the rebuild win is 3.4-9x on bytes, not 100x.

zit#109 is assessed, design settled, not started. Premise correction that matters here: the crosslink record holds hash/mtime/parents/tags/comment but NOT user and NOT file lists -- #107 added no file-list image. The plan is fossil's own shape: capture user + changed-files into the record at derive time (layout_version 5, one-time rebuild per store), so the dump verb replays the cache sub-second. Until it lands, do not build consumer-side manifest expansion you would throw away.

---- zit-side, 2026-08-21: zit#109 is SHIPPED (2a68d2fc79) and on PATH. 'zit crosslink' streams the derived records: checkin/user/comment/tag/file(A|M|D)/end, versioned header 'crosslink 1', card-escaped tokens, mtime in ms-epoch. Warm dumps: sqlite 0.11s/14.9MB (36,797 check-ins), tcl 0.17s/23.5MB (42,131). Take check-in state from crosslink and tickets/wiki/technotes from 'frames --structural'. One 'files unknown' per corpus store is CORRECT (genuinely absent parent) -- treat unknown as unknown, not empty. First read per store after the upgrade pays a one-time rebuild (sqlite ~60s, tcl ~90s; already pre-warmed here). Do not run pre-#109 zit binaries against these stores: mixed versions thrash the cache.

2026-08-21 01:29:01

quarry-side, 2026-08-20 20:28: frames --structural is wired (8a41f9c1e5) and per-phase timing added. Measured full rebuilds on the new path:

sqlite 164s total = stream+fold 77s changes 85s finish 2s
tcl 233s total = stream+fold 61s changes 163s finish 10s

--structural moved totals by ~nothing: the bottleneck is quarry's pass-2 change derivation (re-parse spooled manifests, expand --compatible full lists, diff) — the exact work zit#109's capture-at-derive design deletes. Confirms that assessment empirically. Not building interim pass-2 parallelism: stream+fold alone is 61-77s, so the sub-60s invariant is unreachable without #109, and the interim machinery would not survive it.

Blocked on zit#109 for the invariant. On its landing, quarry drops pass 2 and the spool, consumes the dump for check-in state, and keeps frames --structural for tickets/wiki/forum only.

2026-08-21 12:14:58

Closed 2026-08-21: the invariant holds. Solo-measured full rebuilds on the final path:

quarry 0.1s sqlite 35.5s (crosslink 12.0 | frames 21.1 | finish 2.3) tcl 55.6s (crosslink 23.2 | frames 21.8 | finish 10.6)

Landed: crosslink consumption (zit#109) with trigger-guaranteed parity and a search_doc parity fix; manifest sniff so frames never parses F-card walls; census read pipelined behind the check-in fold; wide filechange inserts; secondary indexes and FTS sync dropped during bulk, rebuilt once. Disposability harness pins crosslink-rebuilt stores semantically equal to artifact-folded ones.

Remaining headroom if ever needed: tcl finish 10.6s (index+FTS rebuild) and per-phase SQL; nothing blocking.