arborist/docs/tickets
russell@unturf.com 967fedbbe0
#000065: pin M=4 + bench script + SQLite-alternative decision tree
Pinned the canonical shard count at M = 4 based on real-Wikipedia
ingest + query benchmark (bench/shard_count_sweep.py). Captured the
"when does SQLite stop being the right substrate" decision tree so
future operators know what bench would justify a fork or replacement.

Bench numbers (Wikipedia 2003 cur dump, 2000 docs, 4 cells of
M ∈ {1, 2, 4, 8}, 50 FTS queries per cell):

     M   chunks/s    q_p50_ms    q_p99_ms   attach_ms
     1    3,648        0.05        0.20        1.61
     2    5,649        0.03        0.19        3.24
     4    6,405        0.07        0.30        9.00
     8    6,959        0.03        0.28        9.65

Key observations:
- M=1→M=2 is the biggest ingest win (+55%). Most gain happens there.
- M=2→M=4 is +13%. M=4→M=8 is only +9% — diminishing returns.
- Real wikitext canonicalization is per-worker Python CPU bound, not
  SQLite-writer-lock bound. More shards don't unlock more CPU.
- Query p50/p99 is flat across M within noise (50 queries small).
- ATTACH cost grows linearly: 1.6 / 3.2 / 9.0 / 9.7 ms.

Why M=4 specifically:
- Captures 92% of peak ingest throughput (6,405 / 6,959).
- 6 ATTACH slots free under SQLite's 10 ceiling for aux DBs
  (qa.db, snapshots.db, selfmodel-chain.db, crawl_*.db, future
  mesh_*.db) — comfortable headroom. M=8 leaves only 2 slots.
- Mobile-tolerable: phone NAND attach is 5-10x slower than NVMe;
  M=4 = 45-90 ms cold start (instant), M=8 = 50-100 ms (sluggish
  with no headroom).
- Matches fox's current 4-shard layout = cheapest migration.

Decision tree for when SQLite stops being right (full text in
ticket §"When the SQLite-default substrate stops being right"):

A. ATTACH ceiling pressure (auxiliary DBs grow past 5) → bench
   forked SQLite with SQLITE_MAX_ATTACHED=125, M ∈ {16, 32, 64};
   if attach cost stays linear past M=10, fork viable but pays
   permanent "no longer stock sqlite3" tax.

B. Ingest hits >10k chunks/s sustained ceiling → first tune
   page_size / WAL checkpoint / mmap_size / synchronous. If
   tuning gets 2-5x, stay on SQLite. If still ceiling-limited,
   candidates: DuckDB (columnar, MVCC, FTS), libmdbx (B+tree no
   FTS; we'd build it). In-house DB rejected without specific
   failure of those.

C. Federation needs multi-writer-same-shard → SQLite writer-lock
   serializes peers, becomes federation bottleneck. First try
   leader-election (single-writer-per-shard with WAL replication
   to followers). If true multi-writer required, SQLite is wrong;
   candidates: FoundationDB, CRDT-on-KV-store. DuckDB does NOT
   solve this — its MVCC is single-process.

Honest verdict: for current arborist workload (single-writer-per-
shard, read-mostly federation), stock python3 sqlite3 is the right
substrate. None of A/B/C are close to firing. The bench discipline
exists to know what to measure when something changes.

bench/results/shard-count-sweep-2026-05-26T16-20-48Z.csv (synthetic
baseline) + 2026-05-26T16-31-34Z.csv (real Wikipedia) committed as
the load-bearing measurement for the M=4 choice.
2026-05-26 12:40:48 -04:00
..
ticket-000001-retrieval-keywords-audit-gap.md feat: cross-language Q&A (Operation Sandwich) + Windows quickstart — all default-OFF 2026-05-18 12:12:23 -04:00
ticket-000002-reference-frame-polarity-contract.md aborist/arborist 2026-05-07 09:31:49 -04:00
ticket-000003-anchor-class-warrant.md aborist/arborist 2026-05-07 09:31:49 -04:00
ticket-000004-directive-coverage-in-bench.md docs: tickets/ subdir + delete naming-deferral, ref-frame, coverage-audit 2026-05-02 12:51:09 -04:00
ticket-000005-label-ladder-migration.md aborist/arborist 2026-05-07 09:31:49 -04:00
ticket-000006-bench-emergent-findings.md #000006 — +30 emergent cycles (2026-05-12); verifier-ladder health re-confirmed 2026-05-12 11:28:57 -04:00
ticket-000007-query-layer-hyphen-fold.md aborist/arborist 2026-05-07 09:31:49 -04:00
ticket-000008-broad-quantifier-preflight-guard.md aborist/arborist 2026-05-07 09:31:49 -04:00
ticket-000009-quantifier-preflight-dag-binding.md aborist/arborist 2026-05-07 09:31:49 -04:00
ticket-000010-metacognition-preflight-guard.md docs/tickets: stale-map sweep — 3 deferred markers refreshed 2026-05-10 07:00:56 -04:00
ticket-000011-soft-preflight-hint-sidecar.md aborist/arborist 2026-05-07 09:31:49 -04:00
ticket-000012-selection-consensus-protocol.md docs(#000058,#000059,#000060): ticketize Dav1dPrometheus protocol-layer report 2026-05-20 19:27:08 -04:00
ticket-000013-spatial-temporal-substrate.md #000013 closed: v7-W spatial-temporal substrate paper + namespace 2026-05-09 15:00:05 -04:00
ticket-000014-self-model.md selfmodel: land ticket #000014 (identity record + falsification) 2026-05-07 16:36:34 -04:00
ticket-000015-pi-star-domain-library.md pi_star: land ticket #000015 (π* domain library + composition algebra) 2026-05-07 16:51:33 -04:00
ticket-000016-zk-frontier-proof.md #000016 parked: ZK frontier-proof bench plan + wire protocol 2026-05-09 15:05:08 -04:00
ticket-000017-memory-root-lifelong-learning.md memory: land ticket #000017 (memory-root lifelong learning summary) 2026-05-07 16:46:41 -04:00
ticket-000018-soft-hash-covert-channel.md docs/tickets: open #000034 / #000035 / #000036 — #000018 follow-ups 2026-05-09 14:50:15 -04:00
ticket-000019-specification-methodology.md docs: land ticket #000019 (spec methodology for π*, V, policy fields) 2026-05-07 16:53:28 -04:00
ticket-000020-capital-cost-ledger.md capital: land ticket #000020 (8-capital-form cost ledger) 2026-05-07 16:41:48 -04:00
ticket-000021-bench-fixtures-5s-5t-5r.md docs/tickets: stale-map sweep — 3 deferred markers refreshed 2026-05-10 07:00:56 -04:00
ticket-000022-adapter-loss-report.md loss_report: land ticket #000022 (adapter LossReport sidecar) 2026-05-07 17:58:50 -04:00
ticket-000023-5s-phase-1b-syllogism-synthesis-semiotics.md bench: land #000023 + #000024 + #000025 (Phase 1a/1b — Dav1DPrometheus suite) 2026-05-07 20:14:44 -04:00
ticket-000024-5t-phase-1b-and-rename.md bench: land #000023 + #000024 + #000025 (Phase 1a/1b — Dav1DPrometheus suite) 2026-05-07 20:14:44 -04:00
ticket-000025-5f-battery.md #000025 §10.11 + §10.13 + §10.14 — close the 5F battery 2026-05-11 07:41:37 -04:00
ticket-000026-real-shard-workload-baseline.md tickets: close #000026 (Phase 3 landed 60b5748) 2026-05-10 15:54:32 -04:00
ticket-000027-canonical-projections-in-providence-cache.md #000027 + #000028: canonical projections persist; STRICT-WITNESSED reachable 2026-05-09 11:37:06 -04:00
ticket-000028-multi-modality-witness.md ticket #000028 §2.6 sketch: refresh stale TODO post-#000027 2026-05-10 07:52:54 -04:00
ticket-000029-claim-pack-source.md ticket #000029: claim-pack source for axiom/theorem JSON bundles 2026-05-09 11:44:08 -04:00
ticket-000030-math-pi-star-expansion-sympy-substrate.md fan-out: close #000030 · composition fixtures · witness end-to-end 2026-05-09 13:29:59 -04:00
ticket-000031-surface-ingest-cited-textbooks.md docs: refresh stale alias counts (residual 40/54 → 74) 2026-05-10 12:27:23 -04:00
ticket-000032-combinatorics-pi-star.md ticket #000032: combinatorics@v1 π* (pure-integer counting kernel) 2026-05-09 13:20:29 -04:00
ticket-000033-claim-pack-pillar-vii-combinatorics.md ticket #000033: pillar VII (combinatorics) live in shard 000 2026-05-09 15:42:40 -04:00
ticket-000034-hessian-alignment-phi-linear.md docs: ticket §7 status refresh (#000034 + #000036) + CLAUDE.md AUTOCOUNT rule + #000045 ref 2026-05-10 18:39:05 -04:00
ticket-000035-prg-choice-phi-prg.md #000035 closed — v7 substrate spec into the repo; § 9.10 folded in 2026-05-11 17:06:19 -04:00
ticket-000036-t3-per-window-bound.md ticket #000036: add KAT-regen tooling + close 2026-05-11 08:02:25 -04:00
ticket-000037-prometheus-sigma-recursive-falsification-controller.md #000012 Phase 1c follow-through: wire #000037 §12 Trigger 1 probe to fork_score_branches 2026-05-11 06:56:09 -04:00
ticket-000038-phase-4-content-acquisition.md docs: refresh stale citation-alias counts (40 → 54 → 74) across 4 surfaces 2026-05-10 10:41:07 -04:00
ticket-000039-sqlite-vec-optional-backend.md docs: lexical-first-rationale.md — why the cheap retrieval path is the default 2026-05-12 09:23:50 -04:00
ticket-000040-phase-5-resolver-content-tokens.md docs/tickets: stale-map sweep — 3 deferred markers refreshed 2026-05-10 07:00:56 -04:00
ticket-000041-citation-aliases-table.md docs: refresh stale citation-alias counts (40 → 54 → 74) across 4 surfaces 2026-05-10 10:41:07 -04:00
ticket-000042-term-aliases-table.md docs: 100% claim-pack warrant resolution recorded across tickets 2026-05-10 08:40:35 -04:00
ticket-000043-t3-bound-constant-tightening.md ticket #000043: open empirical-tightening sub-ticket for T3 bound constants 2026-05-10 11:55:36 -04:00
ticket-000044-autocount-doc-drift-discipline.md ticket #000035: flip φ_PRG counter big-endian → little-endian to match v7 TLV 2026-05-11 07:47:35 -04:00
ticket-000045-prometheus-sigma-phase-3-sleep-sweep.md docs: #000045 §4 sweep-swap closure + cookbook prometheus_audit 22→25 2026-05-10 19:37:20 -04:00
ticket-000046-harder-5sf-fixture-tier.md #000048 closed; #000049 opened — the attribution-aware verifier is its own ticket 2026-05-12 08:31:57 -04:00
ticket-000047-fork-score-delta-aggregator.md #000047 — close: delta_aggregator knob on ForkScore (Option D) 2026-05-11 08:27:38 -04:00
ticket-000048-verifier-upgrade-recombination-segmentation.md #000048 closed; #000049 opened — the attribution-aware verifier is its own ticket 2026-05-12 08:31:57 -04:00
ticket-000049-attribution-aware-grounding-check.md feat(#000049 §7 #28): tinygrad NLI backend + deterministic engine-agreement A/B; ONNX-immunity rationale 2026-05-19 12:34:04 -04:00
ticket-000050-vec-rrf-hybrid-fusion.md #000050: add §2a — semantic-allusion fixture set (tracked cases) 2026-05-12 21:03:35 -04:00
ticket-000051-federated-vecpack-distribution.md docs: fold 2026-05-13 Dav1d review amendments into #000050 + #000051 2026-05-12 12:57:39 -04:00
ticket-000052-relevance-coherence-meta-cognition.md #000052 §3.2.2 step 2: relevance shadow sweep on 808 pooled bench-qa STRICT — universal walk-back, runtime veto NOT VIABLE on this design 2026-05-13 14:17:38 -04:00
ticket-000053-acronym-aware-content-tokens.md #000053: acronym-aware verifier content tokens 2026-05-12 19:41:47 -04:00
ticket-000054-acronym-parens-concept-extractor.md #000054: record Phase-2 bench result (n=3 limit=5: 30/45 STRICT, 0 regressions on basics) 2026-05-13 10:27:57 -04:00
ticket-000055-windows-quickstart-no-make.md feat: cross-language Q&A (Operation Sandwich) + Windows quickstart — all default-OFF 2026-05-18 12:12:23 -04:00
ticket-000056-operation-sandwich-crosslang-grounding.md docs(#000056): firm cross-language numbers + correct the French figure 2026-05-18 14:23:49 -04:00
ticket-000057-witness-preserving-recursive-drift-ab.md feat(#000057): control experiment harness — Hermes-solo vs Arborist, blinded Opus judge (smoke-verified) 2026-05-19 08:58:38 -04:00
ticket-000058-cache-key-9-verifier-policy-legibility.md docs(#000058,#000059,#000060): ticketize Dav1dPrometheus protocol-layer report 2026-05-20 19:27:08 -04:00
ticket-000059-admission-discipline-graveyard-self-providence.md docs(#000059): bounded-ingestion hard constraint on the claim graveyard 2026-05-20 19:28:48 -04:00
ticket-000060-habcdefg-same-model-substrate-delta-harness.md docs: fold Dav1d review (2026-05-26) into ticket stack 2026-05-26 10:22:17 -04:00
ticket-000061-cold-object-store-tier.md #000061: pack format v2 — self-sufficient new-peer hydration 2026-05-25 22:21:45 -04:00
ticket-000062-mechanistic-witness-governed-sidecar.md docs: fold Dav1d review (2026-05-26) into ticket stack 2026-05-26 10:22:17 -04:00
ticket-000063-cold-object-private-ciphertext-mode.md #000061: fold 3 gaps from Dav1d review (manifest/latest, license_class, cold_pending) 2026-05-26 10:50:57 -04:00
ticket-000064-cold-object-operations-toolkit.md #000061: fold 3 gaps from Dav1d review (manifest/latest, license_class, cold_pending) 2026-05-26 10:50:57 -04:00
ticket-000065-canonical-shard-count-content-hash-routing.md #000065: pin M=4 + bench script + SQLite-alternative decision tree 2026-05-26 12:40:48 -04:00