Repository navigation
Closed
Labels
clienhancementNew feature or requestperformanceLatency, memory, query cost or sizesize: Mhamsterwheel
Description
Follow-up to #296. Its AC3 (the cold rules phase with the rule cache on is no slower than with fan-out on and the cache off) was measured on 2026-11-15 and missed the +3% bar: cache-on-cold median CPU 15.31 s vs cache-off 14.51 s (+5.5%), on a 189-page crawl, 9 interleaved runs per arm, with a temporary uncommitted toggle. The runs were noisy (paired median difference +0.5%; two slow runs carried the gap), and the corpus was small because larger local crawls no longer have stored HTML. Details: #296 (comment)
This issue makes the measurement repeatable and settles AC3.
Acceptance Criteria
-
apps/cli/scripts/template-fanout-bench.tshas a permanent--rule-cache off|cold|warmarm;coldtruncates the rule cache before every run,warmruns against a populated cache,offdisables it - A fresh crawl of our own sites (docs.squirrelscan.com, or squirrelscan.com plus docs) with 1,000+ pages and stored HTML, made in a Daytona sandbox, is kept as the bench corpus, and where it is stored is recorded on this issue (2,279 HTML pages over squirrelscan.com, docs and openelectricity.org.au; archived as
bench-corpus-dt/corpus-1971.tgzon the maintainers' backup volume, sha2568b3f266d6374844d99f7b4514cf125e294c3b0ca1701c369212dacc10e773bd7) - The bench runs at least 15 interleaved off/cold pairs in a dedicated Daytona sandbox with nothing else running in it (load average under 4), never on the laptop, and the raw per-run numbers and sandbox size are posted here (accepted by maintainer decision on 2026-11-21: 15 pairs each on squirrelscan.com and docs on a 4 vCPU / 8 GB sandbox, but load average was 4 to 18, not under 4; openelectricity had only 5 pairs and moved to Rule cache cold-run cost on very large pages (openelectricity +3.8% in the #1971 bench) #2206)
- AC3 restated: the median of the paired (cold minus off) CPU-time differences is at or under +3% of the off arm's median; the unpaired medians, min and max are reported alongside (accepted on squirrelscan.com +2.2% and docs +0.6%; openelectricity +3.8% over 5 noisy pairs is tracked in Rule cache cold-run cost on very large pages (openelectricity +3.8% in the #1971 bench) #2206)
- The CHANGELOG claim that the template fan-out cache cost (~7%) is gone is either verified by this measurement or corrected in the next release notes (released notes are not edited; corrected via changelog.d in docs(changelog): correct the rule cache cost claim with the #1971 measurement #2207 for the next release notes)
- Make the rule-result cache and template fan-out compose #296 is closed only when AC3 passes on this measurement (Make the rule-result cache and template fan-out compose #296 stays open here; closing it is a separate maintainer call)
Metadata
Metadata
Assignees
Labels
clienhancementNew feature or requestperformanceLatency, memory, query cost or sizesize: Mhamsterwheel
Activity
feat(cli): add --rule-cache off|cold|warm arm to the template fan-out…
feat(cli): add --rule-cache off|cold|warm arm to the template fan-out…
Merge remote-tracking branch 'origin/main' into docs/agent-setup-v2
feat(bench): permanent --rule-cache off|cold|warm arm in the template…
nc9 commentedon Nov 20, 2026
AC1 is done in #2150 (ccfcf91).
template-fanout-bench.tshas a permanent--rule-cache off|cold|warmarm, routed through the real rule-cache switch, with tests inapps/cli/tests/scripts/rule-cache-arm-1971.test.ts. The measurement (AC2 to AC6) still has to run on a quiet machine, so this stays open.nik
nc9 commentedon Nov 21, 2026
Bench corpus crawled 2026-11-20/21 with the CLI from main, passive,
--level full,-m 1500, into a dedicated content store with a 20 GB cap andkeep_audits = 0, so no eviction or retention can drop the HTML. Corpus root:/Volumes/BACKUP/squirrel-store/bench-corpus(external disk on the maintainer's Mac). Content store:content-store.dbin that root.home/.squirrel/projects/docs-squirrelscan-com/project.dbhome/.squirrel/projects/squirrelscan-com/project.dbhome/.squirrel/projects/openelectricity-org-au/project.dbStore: 2153 blobs, 2.24 GB raw, 202 MB compressed. "Resolves" is a join of every distinct
pages.html_hashagainstcontent.hash.On AC2: the two squirrelscan sites together are 874 pages with HTML, under 1,000. Their sitemaps list 586 (docs) and 86 (squirrelscan.com) URLs, and following links the crawls reached 591 and 293 pages. Both crawls finished well under the 1,500 page cap, so the two sites have no more reachable pages to add. openelectricity.org.au alone clears it (1,404 pages with HTML). Whether it counts as "our own sites" for this AC is a maintainer call, so AC2 is left unticked.
Benches run on copies, never on these files.
nik
nc9 commentedon Nov 21, 2026
The off/cold bench (AC3) will not run on a laptop: the corpus build and a bench beside it ran the maintainer's machine out of memory. It stays
blockeduntil the bench runs in a Daytona sandbox or on Boat. The corpus recorded above stays in place.nik
nc9 commentedon Nov 21, 2026
Moved the crawl and the bench to a Daytona sandbox (AC2, AC3): crawls and corpus work no longer run on the laptop. The earlier local corpus run is left in place but is not the bench corpus.
nik
nc9 commentedon Nov 21, 2026
Bench corpus for AC2: squirrelscan.com plus docs come to about 880 pages (both crawls finish under the cap), so openelectricity.org.au (also ours) is added to reach 1,000+. All three are crawled in the bench sandbox, and the per-site counts get posted here.
nik
nc9 commentedon Nov 21, 2026
Round 2 results (Daytona, 4 vCPU / 8 GB, crawls at
--level full -m 1500).AC2 met. The corpus is 2,279 pages with HTML across three sites:
Every
html_hashresolves in the content store (214.5 MB).AC3 compares cold vs off CPU time using interleaved pairs, with host load average 4 to 18:
Why the openelectricity number is unsettled:
--batch 200was OOM-killed and--batch 50reached 7.5 GB. The completed runs usedBUN_OPTIONS=--smol --batch 20, peaking at 3.3 GB.--smolinflates CPU in both arms, so these absolute numbers aren't comparable with the other two sites.Options to settle it: 15 pairs on a quieter host (about 17 hours of sandbox time), or a different method for large-page sites, for example measuring the cache write separately.
The corpus (three
project.dbfiles pluscontent-store.db, each integrity-checked) is archived for reruns, sha2568b3f266d6374844d99f7b4514cf125e294c3b0ca1701c369212dacc10e773bd7.nc9 commentedon Nov 21, 2026
Closing per the maintainer decision on 2026-11-21: AC3 accepted on squirrelscan.com (+2.2%) and docs.squirrelscan.com (+0.6%). The large-page result on openelectricity.org.au (+3.8%, 5 noisy pairs) moved to #2206. The CHANGELOG correction for the next release notes is #2207.
docs(changelog): correct the rule cache cost claim with the #1971 mea…