zit 0.3.10 makes the full derive — the pass that turns a store into its timeline, branches, tags, and leaves — dramatically cheaper on large repositories. The derive runs on the first open of a fresh clone, after any cache loss, and after a record-format upgrade; on a wide history each of those used to cost minutes. On the sub-manifest form of the pkgsrc corpus a cold derive drops from about 300 seconds to 22.
No artifact, tag namespace, or sync message changed, and no on-disk format changed. Everything here is a memo of the immutable log — delete it and the next open rebuilds it.
The cache is written in place, not copied (zit#182)
Both cache writers — the derived-state cache and the rebuild checkpoint —
concatenated their header, record body, and image into one resident buffer
before writing a byte. On pkgsrc that was a full extra copy of 343 MB and
216 MB respectively, at the derive's memory peak. They now stream the pieces
straight to the file with the checksum folded in incrementally, in the
reader's byte order. The output is byte-identical; a cmp against the prior
build's files confirms it. pkgsrc cold-open peak RSS falls from 2.32 GB to
2.07 GB.
A disposition sidecar skips what cannot contribute (zit#182)
The derive reconstructed every artifact in the store — through its full
delta chain — only to discard the roughly four in five that cannot
contribute a record: file blobs, and on a wide store the sub-manifest tree
nodes. zit now records one bit per stored artifact in an advisory
.zit-cache member — is this artifact crosslink-relevant, a check-in or a
control — distilled during the one derive that must touch everything anyway.
Every later full derive consults it and reconstructs only the relevant
frames. On the sub-manifest pkgsrc corpus that is a 13x cut, from 302 s to
22 s; a clone distills the map during the walk it already makes and consumes
it on the reopen.
The sidecar carries the same trust discipline as the existing log-scan index: self-checksummed, keyed to a validated log prefix, and stamped with the shun fingerprint it was distilled under, so lifting a shun discards the map rather than silently dropping a revived check-in. Any validation failure reads as absent, and the full derive is always the fallback. A consuming derive's record body is byte-identical to a from-scratch derive's, pinned by test.
Compatibility
- Artifacts, tags, and the sync protocol are unchanged; Fossil RFC revision 00 remains the target.
- No on-disk or cache format changed. The dispositions member is a new,
optional, self-validating file in the disposable
.zit-cachetier; an older binary ignores it, and a cache written without it is rebuilt on first open exactly as before. - No command, flag, or output changed.
ZIT_DERIVE_FOOTPRINT=1in the environment reports the derive record body's composition on exit, the same evidence-seam shape asZIT_MANIFEST_READS.
Qualification
zig build test, e2e, smoke (Fossil interop against a real fossil),
muscle (41 differential steps), git-import-e2e, git-export-e2e, and
dst, plus the three-runner CI battery (macOS ARM64, Linux x86-64, Linux
ARM64). Derive timings were taken on the sub-manifest and flat forms of the
pkgsrc corpus with release builds; cache and image output were compared
byte-for-byte against the previous build.