Skip to content

Commit 64ec70b

Browse files
feat(phase-55): split setup vs query and honest percentiles (#33)
The 64.6s "TOC navigation" p50 was build_toc_segment (ingest-time MockSummarizer rollup) plus two RocksDB lookups. Query navigation is now timed separately: medium/warm single.toc p50 = 0.13ms (n=30). Vector model load, index build, and query are three steps. p90 requires n>=10; p99 requires n>=30; otherwise min/median/max. Warm = one setup + N queries. Schema 2 baseline regenerated from a real medium/warm/30 run. Co-authored-by: Richard Hightower <rick@spillwave.com>
1 parent d937d1d commit 64ec70b

11 files changed

Lines changed: 1008 additions & 627 deletions

File tree

.planning/ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
-**v2.6 Cognitive Retrieval** — Phases 39-44 (shipped 2026-03-16)
1313
-**v2.7 Multi-Runtime Portability** — Phases 45-50 (shipped 2026-03-22)
1414
- **v3.0 Competitive Parity & Benchmarks** — Phases 51-53 + Phase 51.5 (in progress; Phase 51.5 merged 2026-04-28)
15-
- **v3.1 Make It True** — Phases 54-58 (in progress; Phase 54 Integration Truth executing)
15+
- **v3.1 Make It True** — Phases 54-58 (in progress; Phase 54 merged 2026-08-30, Phase 55 executing)
1616

1717
## Phases
1818

.planning/STATE.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ gsd_state_version: 1.0
33
milestone_name: Make It True
44
status: in_progress
55
stopped_at: null
6-
last_updated: "2026-08-30T08:00:00.000Z"
7-
last_activity: 2026-08-30 — Phase 54 Integration Truth implemented on feature/phase-54-integration-truth
6+
last_updated: "2026-08-30T17:30:00.000Z"
7+
last_activity: 2026-08-30 — Phase 55 Performance Truth implemented (medium/warm/30 artifact)
88
progress:
99
total_phases: 5
10-
completed_phases: 0
10+
completed_phases: 1
1111
total_plans: 14
12-
completed_plans: 6
13-
percent: 43
12+
completed_plans: 8
13+
percent: 57
1414
---
1515

1616
# Project State
@@ -20,39 +20,36 @@ progress:
2020
See: .planning/PROJECT.md (updated 2026-03-22)
2121

2222
**Core value:** Agent can answer "what were we talking about last week?" without scanning everything
23-
**Current focus:** v3.1 Phase 54Integration Truth (wire orchestrator, fix silent no-ops)
23+
**Current focus:** v3.1 Phase 55Performance Truth (setup vs query split; honest percentiles)
2424

2525
## Current Position
2626

27-
Phase: 54 of 58 (Integration Truth)
28-
Plan: 01-06 implemented on `feature/phase-54-integration-truth` (PR pending)
29-
Status: Phase 54 code complete; awaiting PR review
30-
Last activity: 2026-08-30 — RouteQuery spliced through MemoryOrchestrator; BM25 outbox indexes events; Hybrid fuses BM25+vector; recover_lock policy; honest `--background`
27+
Phase: 55 of 58 (Performance Truth)
28+
Plan: 01-02 implemented on `feature/phase-55-performance-truth` (PR pending)
29+
Status: Phase 54 merged; Phase 55 code + medium/warm/30 artifact ready
30+
Last activity: 2026-08-30 — `single.toc` query p50 = 0.13ms; 64.6s was `toc_build`
3131

32-
Progress: [████░░░░░░] ~43% (6/14 plans; Phase 54 of 54-58)
32+
Progress: [██████░░░░] ~57% (8/14 plans; Phase 55 of 54-58)
3333

3434
## Out-of-band Work
3535

3636
### Open PRs
3737

38-
| PR | What | Notes |
39-
|---|---|---|
40-
| #31 | v3.1 design spec (docs only) | Keep separate from this implementation PR |
38+
None.
4139

4240
### Recently Merged
4341

4442
| PR | What | Merged |
4543
|---|---|---|
44+
| #32 | Phase 54 Integration Truth | 2026-08-30 |
45+
| #31 | v3.1 Make It True design spec | 2026-08-30 |
46+
| #30 | Phase 53 Benchmark Suite | 2026-08-30 |
4647
| #25 | Phase 53.5: cross-project federated query | 2026-05-14 |
4748
| #29 | Phase 52: Simple CLI API | 2026-05-14 |
4849
| #28 | Phase 51: Retrieval Orchestrator | 2026-04-28 |
49-
| #27 | Phase 51.5: API summarizer wiring | 2026-04-27 |
5050

5151
## Decisions
5252

5353
- v3.1 scope: Make It True — no new capabilities; close claim/reality gap (Phases 54-58)
54-
- Orchestrator is wired on the daemon/service side behind RouteQuery (gRPC callers benefit)
55-
- Canonical fusion API: `fuse` / `fuse_weighted` in memory-orchestrator (only site matching rrf|reciprocal)
56-
- Lock policy: recover_lock, never panic
57-
- `--background` exits non-zero; default start is foreground
58-
- Execution-evidence + crate-reachability + human_verification-as-blocker rules in `.planning/config.json`
54+
- Phase 55: split setup vs query in `perf_bench`; p90/p99 withheld below 10/30 samples
55+
- Warm = one setup + N query samples; cold = new store per iteration
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
phase: 55-performance-truth
3+
plan: 01
4+
type: execute
5+
wave: 1
6+
depends_on: []
7+
files_modified:
8+
- crates/e2e-tests/src/bin/perf_bench.rs
9+
- docs/benchmarks.md
10+
- crates/e2e-tests/benchmarks/latest.json
11+
- crates/e2e-tests/benchmarks/baseline.json
12+
autonomous: true
13+
---
14+
15+
<objective>
16+
Split setup vs query in perf_bench so `*.toc` and `*.vector` measure navigation/search, not rollup/model load. Attribute ingest-time cost honestly.
17+
</objective>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
phase: 55-performance-truth
3+
plan: 02
4+
type: execute
5+
wave: 1
6+
depends_on: []
7+
files_modified:
8+
- crates/e2e-tests/src/bin/perf_bench.rs
9+
- docs/benchmarks.md
10+
- crates/e2e-tests/benchmarks/baseline.json
11+
autonomous: true
12+
---
13+
14+
<objective>
15+
Honest percentiles: default 30 query iterations; p90/p99 omitted unless sample count supports them; cold vs warm structurally different; regenerated baseline + caveats.
16+
</objective>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Phase 55: Performance Truth - Context
2+
3+
**Gathered:** 2026-08-30
4+
**Status:** In execution
5+
**Source:** docs/plans/v3.1-make-it-true-plan.md
6+
7+
## Phase Boundary
8+
9+
Make recorded perf numbers support — rather than contradict — the core value
10+
claim. Measurement methodology must survive scrutiny. No new retrieval
11+
capabilities.
12+
13+
## Root cause (55-01) — confirmed in code
14+
15+
`crates/e2e-tests/src/bin/perf_bench.rs` times **setup + query** under query
16+
step names:
17+
18+
- `*.toc` wraps `build_toc_segment` (MockSummarizer rollup of the whole
19+
corpus) plus two `get_toc_node` lookups. That is the 64.6s "TOC navigation"
20+
number. Real navigation is the lookups.
21+
- `*.vector` wraps Candle embed + HNSW index build plus one search. That is
22+
the 7.2s "vector" number.
23+
- `*.bm25` wraps Tantivy index build plus one search (~245ms).
24+
- `*.route_query` already times only the RPC (~2.3ms) — the honest query path.
25+
26+
## Decisions
27+
28+
- Split every step into `*_build`/`*_index` (setup, ingest-time) vs query.
29+
- Default query iterations = 30. p90 only if n≥10; p99 only if n≥30; otherwise
30+
min/median/max and say so.
31+
- Warm: setup once, warmup one query, then N query samples.
32+
- Cold: new harness per iteration; still split setup vs query timers.
33+
- `vector_model_load` is a one-shot setup metric, never folded into query.
34+
- Re-baseline `baseline.json` schema version 2; rewrite `docs/benchmarks.md`.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
phase: 55-performance-truth
3+
verified: 2026-08-30
4+
status: passed
5+
---
6+
7+
# Phase 55: Performance Truth Verification
8+
9+
**Phase Goal:** recorded perf numbers support the core value claim; methodology survives scrutiny.
10+
11+
## Execution evidence
12+
13+
| # | Truth | Status | Evidence |
14+
|---|-------|--------|----------|
15+
| 1 | 64.6s "TOC navigation" was rollup | RUN | `single.toc_build` p50 = 76714 ms on 240 events; old `single.toc` was this timer |
16+
| 2 | Query `*.toc` is navigation | RUN | `single.toc` p50 = **0.13 ms**, n=30, medium/warm |
17+
| 3 | Vector model load not in `*.vector` | RUN | `vector_model_load` 156 ms; `vector_index` 12.6 s; `vector` 4.15 s (query embed) |
18+
| 4 | p90/p99 withheld below 10/30 samples | UNIT + RUN | unit tests; setup steps in latest.json omit p90/p99 (samples=1) |
19+
| 5 | Warm vs cold are different loops | CODE | Warm: one setup + N queries; cold: new store per iteration |
20+
| 6 | docs name corpus, samples, caveats | DOCS | `docs/benchmarks.md` committed-result table |
21+
| 7 | Re-baselined latest.json / baseline.json | RUN | schema 2, 2026-08-30T17:30:20Z, linux/x86_64, 240 events, 30 samples |
22+
23+
## Human verification (blockers)
24+
25+
- [x] Committed `latest.json` from a real medium/warm/30 run
26+
- [x] `single.toc` warm p50 < 500ms (0.13 ms)
27+
- [x] Vector split: model load vs index vs query

0 commit comments

Comments
 (0)