feat(bench): RFC 0031 — floor-direction gate for L6/L7 reporting - #481
Conversation
L6 (broad scan) and L7 (ingest) are FLOOR/parity classes in RFC 0031 §2 — Ourios may be worse by at most F_L6/F_L7 — but the indicative report pushed the time-window pairs through bytes_must_win, the wrong direction (run #7 printed advantage 0.02 as a must-win fail instead of answering "is Ourios within 3x of Loki?"). Adds bytes_within_floor(ourios, loki, factor): pass iff ourios <= factor x loki, mirroring bytes_must_win's honesty guards (factor==0 and zero measurements are Invalid, never a pass). The overflow arm differs deliberately: an overflowing factor x loki budget would be a mathematically true pass on an implausible measurement, so checked_mul fails it closed as Invalid rather than letting a saturated budget pass everything. advantage keeps the loki/ourios orientation so both gates' tables read the same way; only the pass rule differs. The indicative report gains a GateKind on PairSpec: the severity pair stays must-win (m_l2), the time-window slices report via the floor gate (f_l6), and the gate lines name the direction. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQY9wfrfRggqSpMLH8Xj3Y
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe benchmark crate adds floor byte-gate evaluation alongside must-win comparisons, exposes the new function publicly, validates invalid and overflow cases, and applies gate-specific evaluation and labels to RFC0031 comparative reports. ChangesComparative gate evaluation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PairSpec
participant GateKind
participant bytes_must_win
participant bytes_within_floor
participant IndicativeReport
PairSpec->>GateKind: select gate kind
GateKind->>bytes_must_win: evaluate must-win pairs
GateKind->>bytes_within_floor: evaluate floor pairs
bytes_must_win-->>IndicativeReport: return outcome
bytes_within_floor-->>IndicativeReport: return outcome
IndicativeReport->>GateKind: obtain margin label
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Pull request overview
Adds the RFC 0031 “floor-direction” bytes gate to the ourios-bench comparative gate math and updates the indicative comparative report to apply the correct gate semantics for L6/L7 (bounded-loss) pairs, while keeping reporting orientation consistent (advantage = loki/ourios).
Changes:
- Implement
bytes_within_floor(pass iffourios ≤ factor × loki) with the same “honesty” guards asbytes_must_win, plus overflow-fails-closed behavior. - Export the new gate from
ourios-benchand add unit tests covering boundary/zero/overflow/factor-wiring cases. - Wire the indicative report to select
MustWinvsFloorper pair and label output accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/ourios-bench/src/lgates.rs | Adds the floor gate implementation + tests, and updates gate outcome docs to cover both gate families. |
| crates/ourios-bench/src/lib.rs | Re-exports bytes_within_floor for consumers (incl. integration tests). |
| crates/ourios-bench/tests/rfc0031_comparative.rs | Introduces per-pair GateKind and updates report printing/evaluation to use must-win vs floor as appropriate. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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/lgates.rs`:
- Around line 77-78: Update the field-level documentation for Invalid::reason to
also mention zero factor and overflow, matching the expanded variant-level
documentation while preserving the existing explanations for zero sides and zero
margin.
🪄 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: d6c92173-e30e-4b85-a023-f25f7e41ce42
📒 Files selected for processing (3)
crates/ourios-bench/src/lgates.rscrates/ourios-bench/src/lib.rscrates/ourios-bench/tests/rfc0031_comparative.rs
…am rename Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQY9wfrfRggqSpMLH8Xj3Y
What
Adds the missing floor-direction bytes gate to
lgates.rsand wires the indicative report to use it for the time-window (L6-family) pairs.bytes_within_floor(ourios, loki, factor)passes iffourios ≤ factor × loki— the RFC 0031 §2 disposition for L6 (broad scan) and L7 (ingest): bounded-loss classes, not wins to demonstrate. Run #7 reported the window pairs throughbytes_must_win, which asks the inverted question (it printedadvantage 0.021as a must-win fail when the semantically correct question is "is Ourios within 3×?" — which also fails today, but the report must ask the right question for the §9 record).Design
advantagekeeps theloki/ouriosorientation for both gates so report tables read identically; only the pass rule differs (floor passes atadvantage ≥ 1/factor).bytes_must_win: zero measurement →Invalidnever pass;factor == 0→Invalid(a floor with no budget fails everything — misconfiguration must be loud).factor × lokioverflowing u64 would be a mathematically true pass, but only on an implausible measurement —checked_mul→Invalid, mirroring the saturation trap fixed in feat(bench): RFC 0031 — L-gate must-win math + §7 margins as config #473 from the other side.PairSpecgainsgate: GateKind(MustWinfor the severity pair,Floorfor window slices); print lines now labelmust-win margin 10vsfloor factor 3.Invariants / hazards
Bench gate-math + report labels only; no hot path, no schema, no measurement-channel change.
bytes_must_winbehavior untouched (its tests unchanged). Part of the RFC 0031 reporting ladder (RFC0031.7–.8 direction); §7 factors stay provisional.Checks run
cargo fmt --all --check,cargo clippy --all-targets --all-features -- -D warnings(workspace-wide),cargo nextest run -p ourios-bench(126 passed, 13 skipped = the#[ignore]d Docker/dispatch tests). Five new boundary/guard unit tests for the floor gate.🤖 Generated with Claude Code
https://claude.ai/code/session_01WQY9wfrfRggqSpMLH8Xj3Y
Summary by CodeRabbit
New Features
Bug Fixes
Tests