Repository navigation
perf(devtools): ingest write-amplification measurement probe (#1851) - #1900
Conversation
Problem: #1851's targeted-FTS-repair fix for daemon live-ingest write amplification has landed, but the issue still wants a deterministic, repeatable measurement artifact to establish the post-fix baseline and compare future changes. There was no way to attribute per-tier write bytes per ingest batch. What changed: new additive devtools command `ingest-amplification-probe` plus its measurement module and tests. It builds a deterministic synthetic fixture corpus (one session per file) under a private temp dir, ingests N single-session append batches through the existing public batch-ingest path (`parse_sources_archive`, unmodified), and attributes bytes written per archive component after each batch using `PRAGMA page_count * PRAGMA page_size` plus on-disk WAL size for each tier DB (source/index/embeddings/user/ops) and the content-addressed blob store. Emits a stable, host-independent JSON report: per-batch and per-component byte deltas plus a summary with bytes-per-payload-byte amplification ratios. No wallclock thresholds — every value is a byte count or derived ratio, reproducible for a given SQLite build + seed. Does not change any production ingest/daemon/storage code. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude <[email protected]>
|
Warning Review limit reached
More reviews will be available in 55 minutes and 34 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7221b8cfc6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Adds
devtools ingest-amplification-probe— a deterministic, host-independent measurement of per-tier write bytes per live-ingest batch, establishing the post-fix baseline for #1851 (slices 1-2/4). Additive tooling; no production ingest/daemon/storage code touched.Problem
#1851 wanted the amplification not just fixed (#1895) but measured and attributed, with a repeatable artifact comparable across PRs. There was no such measurement.
Solution
devtools/ingest_amplification_probe.py(new) bootstraps a fresh 5-tier archive in an env-isolated temp dir (XDG_DATA_HOME+POLYLOGUE_ARCHIVE_ROOT— never touches real data), builds a deterministic synthetic corpus, ingests N single-session append batches through the existing publicparse_sources_archivepath (read-only use), and after each batch attributes bytes viaPRAGMA page_count * page_size+ WAL size per tier DB plus the blob store. Emits a stable JSON report (per-batch + per-tier deltas, amplification ratios, per-component shares). Registered as aCommandSpec.Key finding: on the
parse_sources_archivepath the raw payload is not materialized to source.db/blob (only a 32-byte hash + small rows) — the full blob is written by the daemon's lease path. So this probe measures the parsed-index durable footprint vs raw wire payload (~0.8–1.0× post-fix, 100% in index.db);blob_storeis kept as an attributed component (shows 0 here rather than hiding it).Verification
Deterministic: two runs produce byte-identical JSON.
Ref #1851