feat(bench): RFC 0031 — bytes-read measurement channel (§3.6) - #472
Conversation
Both halves of the RFC 0031 §3.6 primary gate metric, feeding the
RFC0031.2–.5 bytes-read ratios.
Ourios half (mostly existed): QueryStats.bytes_read is already folded
from the engine's bytes_scanned scan metric on the RFC 0016 path and
live-asserted in the querier's execution tests. Expose it through the
comparative harness: `OuriosAnswer { lines, bytes_read }` via
`ourios_query_answer` — one query yields both the equivalence lines and
the measurement; `ourios_query_lines` stays as a thin wrapper (the
RFC0031.1 container test is untouched).
Loki half: `parse_loki_bytes_processed` reads
`data.stats.summary.totalBytesProcessed` from the query_range response,
sharing the extracted `parse_loki_root` error-response guard with
`parse_loki_streams`. A missing stats block is an ERROR, not a silent 0
— a zero would fake a perfect pruning ratio in the L-gates.
Tests: the fixture round-trip now runs through ourios_query_answer and
asserts bytes_read > 0 on the real store; the bytes parser covers the
value, missing-summary, and Loki-error-response cases.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe comparative benchmark query API now returns matched lines and storage bytes read. Loki parsing shares root-level error handling and adds validated extraction of processed-byte statistics, with updated public exports and tests. ChangesComparative benchmarking updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
Pull request overview
This PR extends the ourios-bench comparative harness to carry and validate the RFC 0031 §3.6 “bytes read” measurement for both Ourios and Loki, enabling future L-gate pruning ratio calculations alongside existing equivalence checks.
Changes:
- Introduces
OuriosAnswer { lines, bytes_read }andourios_query_answer, withourios_query_linesbecoming a thin wrapper. - Adds Loki-side
parse_loki_bytes_processedand factors shared Loki error-response handling intoparse_loki_root. - Updates comparative tests to assert the Ourios bytes-read measurement is non-zero and adds focused tests for Loki bytes parsing/error handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/ourios-bench/src/lib.rs | Re-exports the new comparative harness API (OuriosAnswer, ourios_query_answer, parse_loki_bytes_processed). |
| crates/ourios-bench/src/comparative.rs | Adds the Ourios bytes-read measurement channel and Loki bytes-processed parsing, with updated tests to cover both. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What
Both halves of the RFC 0031 §3.6 primary gate metric — bytes read from storage — the measurement the RFC0031.2–.5 must-win gates ratio. Locally verified end to end.
Ourios half (mostly already existed):
QueryStats.bytes_readis folded from the engine'sbytes_scannedscan metric on the RFC 0016 path and already live-asserted in the querier's execution tests. This PR exposes it through the comparative harness:OuriosAnswer { lines, bytes_read }viaourios_query_answer— one query yields both the equivalence lines and the measurement.ourios_query_linesbecomes a thin wrapper, so the merged RFC0031.1 container test is untouched.Loki half:
parse_loki_bytes_processedreadsdata.stats.summary.totalBytesProcessedfrom the samequery_rangeresponse the streams parser consumes, sharing an extractedparse_loki_rooterror-response guard (no duplicated Loki-error handling).Honesty choice
A missing Loki stats block is an error, not a silent 0 — a zero
bytes_readwould fake a perfect pruning ratio in the L-gates. Same principle as the RFC0031.1 completeness guard.Tests
ourios_query_answerand assertsbytes_read > 0against the real store (the metric can't silently be 0 for a query that scanned data).cargo test -p ourios-bench --lib comparative→ 14 passed; fmt + clippy clean.Next
With both measurement halves in place: the L-gate ratio math (where the §7 must-win margins
M_L1..L4land) → OTel-Demo-scale corpus → the first indicative Ourios-vs-Loki bytes-read number via aworkflow_dispatchrun.🤖 Generated with Claude Code
Summary by CodeRabbit