feat(bench): add the B1 predicate-pushdown bench + zstd|grep reference - #115
Conversation
|
Warning Review limit reached
More reviews will be available in 46 minutes and 36 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ 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: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR introduces a B1 Criterion benchmark for Ourios that constructs a synthetic Parquet dataset, validates correctness and row-group pruning, and measures query latency against a fair in-process zstd-compressed reference corpus. ChangesB1 Synthetic Benchmark
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Pull request overview
Adds a new B1 benchmark (“predicate-pushdown query latency”) and an in-process zstdcat | grep | wc -l-style baseline comparator to support the thesis-gate measurement plan in the bench harness.
Changes:
- Introduces
ReferenceCorpus(compressed in-window raw lines + token scan) as the B1 “zstd|grep” baseline. - Adds
benches/b1.rssynthetic benchmark that measures Ourios vs the reference on the same in-window file set. - Wires the new
b1Criterion bench target intocrates/ourios-benchand exportsReferenceCorpus.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/ourios-bench/src/reference.rs | Adds the in-process “zstd |
| crates/ourios-bench/src/lib.rs | Exposes the new reference module and re-exports ReferenceCorpus. |
| crates/ourios-bench/Cargo.toml | Registers the new b1 Criterion benchmark target. |
| crates/ourios-bench/benches/b1.rs | Adds the B1 synthetic benchmark comparing Ourios query latency vs the reference baseline. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d67d23f to
08136b7
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
08136b7 to
13cb718
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
13cb718 to
d30e0a6
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
d30e0a6 to
c9b26e6
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
c9b26e6 to
28111b6
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/ourios-bench/src/reference.rs`:
- Around line 86-95: The compressed_bytes method currently uses
u64::try_from(b.len()).unwrap_or(u64::MAX) which silently substitutes a max
value; change this to use expect with an explicit assumption to match crate
convention: replace the unwrap_or(u64::MAX) on the try_from result inside
compressed_bytes (the fold over self.blocks) with .expect("usize fits in u64 on
every supported Rust target") so the conversion is infallible by contract and
failures are explicit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 15446077-ec43-4049-8510-54d8c9c40215
📒 Files selected for processing (4)
crates/ourios-bench/Cargo.tomlcrates/ourios-bench/benches/b1.rscrates/ourios-bench/src/lib.rscrates/ourios-bench/src/reference.rs
Second step of the B1/B2 measurement plan: a wall-clock B1 instrument (docs/benchmarks.md §3 B1 / RFC0007.1) alongside an honest baseline. - `ReferenceCorpus` (src/reference.rs): the in-process equivalent of `zstdcat files_in_range.zst | grep TOKEN | wc -l` — no system zstd/grep, reproducible on any host (same bundled zstd as the A1 codec). Fairness: the caller passes ONLY the in-window files' raw lines (the file-level pruning the baseline gets for free); within those it scans every line, where Ourios additionally skips row groups via column statistics — so the ratio reflects within-window pruning, not a strawman full scan. - `benches/b1.rs` — `b1/synthetic` (always runs): a window of ERROR rows (one file) + INFO rows (another), plus out-of-window ERROR filler. The Ourios query (tenant + time window + severity_text='ERROR') prunes the INFO row group (severity stats) and the out-of-window file (time stats); the reference greps the same in-window files. Both return the same count; the bench prints the pruned fraction and times each side. `b1/otel-demo` is deferred to the corpus run: it needs the OTLP/JSON loader's per-record severity (the plain-text loader forces INFO) plus in-window raw-line extraction with a real time window. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
28111b6 to
a3bf366
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
…ed column (#178) Specs the effective-timestamp fallback (maintainer option 1, 2026-06-11): derived effective_time_unix_nano = time_unix_nano when non-zero, else observed_time_unix_nano.unwrap_or(0) — per the OTLP logs data model's "Use Timestamp if it is present, otherwise use ObservedTimestamp" recommendation. New OPTIONAL stats-bearing RFC 0005 column (writer-derived; MinedRecord unchanged; RFC0001.10 verbatim preservation intact); range() shall filter it; absent-column read rule effective := time_unix_nano (explicit carve-out from the absent⇒false convention) so old files behave identically; partitioning already fell back (choose_partition_timestamp) — now named/unified. RFC 0002 additionally pins half-open [from,to) window bounds (closing RFC 0010's local-pin gap). Scenario RFC0005.13 added. Unblocks B1 on the v5/v6 corpora (~15% observed-only records). Final round merged under the PR #115 trivial-only convergence precedent (wording-only round; CodeRabbit + CI green). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…C 0007 stays green (#180) Records the maintainer-authorized (2026-06-12) thesis-gate measurements in docs/benchmarks.md §9 per its conventions: - §9.2 — A1/C1/C2 at ~1GB (runs 27370641352, 27373716667): A1 0.828×/0.824× FAIL (series 0.465→0.824, size-driven, crossover not reached); C1 1.000000 both (the formal ≥1M-line gate); C2 PASS. - §9.3 — the FIRST B1 real-corpus readings (runs 27379085890, 27357104694): v5 40.0× / v6 30.4× vs zstdcat|grep with exact row-count matches — the §3 ≥10× gate passes indicatively; B2 PASS-supportive (windowed flat ~3.4–4.1ms vs full-span growth). All ci-runner, caveats recorded plainly. - RFC 0007 stays GREEN: the ladder requires baseline-8vcpu-32gib for validated; the status note carries the validated-pending checklist (baseline rerun REQUIRED; denser error band + second corpus family supporting). - query-bench.yml stale recording note fixed (RFC 0006 §1 anticipated B1/B2 recording — no amendment needed). Final round merged under the PR #115 trivial-only convergence precedent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…182) Records the authoritative baseline-8vcpu-32gib thesis-gate results in §9.4 (A1 series 0.439→0.751/0.749 FAIL w/ a hardware-sensitivity open item; C1 1.000000 everywhere; C2 PASS; B1 34.2×/25.4× PASS with exact counts; B2 flat incl. the first second-corpus-family reading — HDFS_v1, 11.2M rows, windowed 5.92ms scanning 1/14 row groups) and flips RFC 0007 to validated per the verification.md §3 ladder (the gates the querier pillar touches — B1/B2 — pass authoritatively; A1 gates the compression pillar/RFC 0006). Final round merged under the PR #115 trivial-only convergence precedent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
README predated all code (2026-04-24). Now: truthful pre-release status block; live badges (CI, self-hosted coverage endpoint at 87.8%, OpenSSF Scorecard [activates on first main run], License, Rust/MSRV, mdBook); corrected ingest diagram (WAL-before-ack order); shipped feature syntax (template_id == 42, resolves_to, drift from -7d to now); real repo layout; bench section cites §9 as the live scoreboard. Best Practices + Codecov left as maintainer-enrollment placeholders. Final round wording-only, merged under the PR #115 precedent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… derivation (#183) Pins the #148 alias-index write path persistence: alias_asserted(4)/alias_retracted(5) audit event kinds with kind-prefixed OPTIONAL columns (alias_member_ids LIST<INTEGER(64, signed=false)> per the positions_widened precedent; alias_representative_id own column; alias_actor; reason reused w/ ""-NULL rule); the unknown-event_kind tolerance rule (opaque envelope events, never file failures — the writer's interim rejection retires in the impl slice as an RFC-gated contract change); and the v1 read path: the querier folds the per-tenant alias map from the audit stream at compile time with a total (timestamp, file path, row index) fold order. The cached per-tenant artifact stays deferred behind the RFC 0009 §3.4 manifest fork (#94/#147) — the event log is the truth either way. Final round wording-only, merged under the PR #115 precedent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
What
Second step of the B1/B2 measurement plan (after #114 added the
severity_textpredicate): a wall-clock B1 instrument plus an honest baseline.B1's thesis gate (docs/benchmarks.md §3): Ourios ≥10× faster than
zstdcat files_in_range.zst | grep ERROR | wc -lon predicate queries.How
ReferenceCorpus(src/reference.rs) — the in-process equivalent of thezstdcat | grep TOKEN | wc -lpipeline: no systemzstd/grepbinary (reproducible on any host; same bundledzstdas the A1 codec). Fairness is explicit: the caller passes only the in-window files' raw lines — the file-level pruning the baseline gets for free by namingfiles_in_range.zst— and within those the reference scans every line, where Ourios additionally skips row groups via column statistics. So the ratio measures within-window pruning, not a strawman.benches/b1.rs—b1/synthetic(always runs): a query window of ERROR rows (one file) + INFO rows (another), plus out-of-window ERROR filler. The Ourios query (tenant+ time window +severity_text='ERROR') prunes the INFO row group (severity stats) and the out-of-window file (time stats); the reference greps the same in-window files. Both return the same count; the bench prints the pruned fraction + times each side.Indicative result (laptop,
scratch/, NOT recorded in §9)The pruning mechanism works (2/3 row groups skipped — only the in-window ERROR row group read). But at this toy scale Ourios is ~11× slower on wall clock: the query is dominated by fixed per-query DataFusion overhead (~1 ms: context + schema inference + plan build), while the reference is a trivial decode+scan of 2.5 KB. This is the same small-corpus regime as the
b2/syntheticfinding — B1's 10× win is explicitly a ≥1 GiB claim (the reference's cost grows with corpus bytes; Ourios's stays ~flat). The synthetic arm is a correctness/mechanism instrument; the wall-clock win needs the real corpus.Deferred
b1/otel-demoneeds the OTLP/JSON loader's per-record severity (the plain-text loader forces a constantINFO, so aseverity='ERROR'query over a mined text corpus returns nothing) plus in-window raw-line extraction with a real time window. Wired in the corpus run (Phase 2).Tests / verification
ReferenceCorpusunit tests (in-window-only counting; empty corpus).cargo bench --bench b1 -- --testruns both sides + the probe assertions.cargo fmt --all --check,cargo clippy --workspace --all-targets --all-features -D warnings,cargo test --workspaceall green.Part of epic #81 (thesis-gate benchmark validation).
🤖 Generated with Claude Code
Summary by CodeRabbit