Skip to content

feat(runtime-baseline): add frozen threshold module + verifier (#390) - #392

Merged
AlexStocks merged 2 commits into
mainfrom
chore/runtime-baseline-freeze-thresholds
Jul 30, 2026
Merged

feat(runtime-baseline): add frozen threshold module + verifier (#390)#392
AlexStocks merged 2 commits into
mainfrom
chore/runtime-baseline-freeze-thresholds

Conversation

@AlexStocks

@AlexStocks AlexStocks commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

#390 / #350 follow-up: establish the threshold-freezing mechanism for the #351 quantitative acceptance gate without inventing benchmark numbers.

This PR now provides:

  • tools/runtime-baseline/src/thresholds.rs: placeholder constants plus a validated ThresholdPolicy; any placeholder or invalid policy returns PolicyUnavailable.
  • tools/runtime-baseline/src/verify.rs: a strict single-case threshold checker returning Pass, PolicyUnavailable, or Fail.
  • tools/runtime-baseline/schema/outcome.schema.json: a strict JSON Schema 2020-12 contract with required common fields and tagged case-specific metrics.
  • tools/runtime-baseline/tests/build_identity_test.rs: fixture coverage for the new source modules and embedded schema.
  • docs/performance/storage-runtime-baseline.md: the fixed-host measurement and follow-up contract.

A single-case Pass is not a publishable baseline-run decision. The later controller verifier must still prove manifest case-set conservation, required repetitions, CV, source identity, and provenance before publishing a complete run.

Why placeholders, not real numbers

The design prohibits freezing thresholds from Windows or GitHub-hosted runner measurements. The complete matrix must run on the designated fixed Linux/WSL host with the versioned case definition.

Until real measurements replace every placeholder, ThresholdPolicy::from_frozen_constants() fails closed and the checker returns PolicyUnavailable for otherwise valid input. Invalid input returns Fail even while the policy is unavailable.

Deferred follow-ups

  • Wiring and Smoke (Tasks 6-12): connect the baseline observer to the runtime production path, harness, controller, and versioned case manifest in a separately validated PR.
  • Baseline Results: run the complete fixed-host matrix, publish raw results and the report, freeze the measured thresholds, and implement the run-level controller verifier.

Validation

  • cargo test -p runtime-baseline --all-targets in WSL/Linux: 49 passed, 0 failed.
  • cargo clippy -p runtime-baseline --all-targets -- -D warnings -D clippy::unwrap_used: passed.
  • cargo fmt --all -- --check: passed.
  • SkyWalking Eyes header check: 462 checked, 0 invalid.
  • git diff --check: passed.
  • Isolated mutation probe: removing the resume-drain and slow-storage PING comparisons makes both targeted boundary tests fail.

Refs

Refs #390. Refs #350 #378 #351 #347.

Establish the threshold-freezing mechanism that serves as the #351
quantitative acceptance gate. This PR delivers the methodology plus
placeholder constants, not fabricated numbers:

- thresholds.rs: #351 acceptance threshold constants as placeholder sentinels
  (f64::NAN / usize::MAX / u64::MAX / i64::MAX, TODO(#351)) + all_frozen()
- verify.rs: Outcome comparator returning Publishable / NonPublishable / Fail.
  While thresholds are still placeholders, any case is NonPublishable — this is
  the hard guarantee that no placeholder value is mistaken for a pass. (Design
  spec forbids freezing Windows / hosted-runner numbers.)
- schema/outcome.schema.json: outcome structure expected by the verifier
- docs/performance/storage-runtime-baseline.md: methodology + the Linux-only
  backfill plan

Real values are filled on a fixed Linux/WSL host per a versioned cases.yaml
(Baseline Results PR); only then does the verifier flip to Publishable. The
observer wiring (Tasks 6-7) and the real-number matrix are separate Linux-host
follow-ups.

Refs #350 #378 #351.
@AlexStocks AlexStocks added the 🧹 Updates updates label Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AlexStocks, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 71d2b417-af22-44f1-9d83-74b0de949246

📥 Commits

Reviewing files that changed from the base of the PR and between 5b9d7fd and f70ec39.

📒 Files selected for processing (7)
  • .licenserc.yaml
  • docs/performance/storage-runtime-baseline.md
  • tools/runtime-baseline/schema/outcome.schema.json
  • tools/runtime-baseline/src/lib.rs
  • tools/runtime-baseline/src/thresholds.rs
  • tools/runtime-baseline/src/verify.rs
  • tools/runtime-baseline/tests/build_identity_test.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread docs/performance/storage-runtime-baseline.md Outdated
Comment thread docs/performance/storage-runtime-baseline.md
Comment thread tools/runtime-baseline/schema/outcome.schema.json
Comment thread tools/runtime-baseline/schema/outcome.schema.json Outdated
Comment thread tools/runtime-baseline/src/verify.rs Outdated
Comment thread tools/runtime-baseline/src/verify.rs Outdated
Comment thread tools/runtime-baseline/src/lib.rs
Comment thread tools/runtime-baseline/src/verify.rs Outdated
Replace incomplete run-level publishability with a strict single-case checker. Validate frozen policy values and case-specific inputs before evaluating every declared threshold, while leaving manifest conservation, repetition, CV, and provenance to the later controller.

Constraint: A single-case Pass is not a publishable baseline-run decision.

Confidence: High; boundary tests cover each threshold and isolated mutations prove the resume-drain and PING checks are observable.

Scope-risk: Limited to runtime-baseline threshold inputs, schema, fixture assembly, license configuration, and baseline documentation.

Tested: WSL cargo test -p runtime-baseline --all-targets; WSL cargo clippy -p runtime-baseline --all-targets -- -D warnings -D clippy::unwrap_used; cargo fmt --all -- --check; SkyWalking Eyes header check; git diff --check.

Not-tested: Fixed-host runtime baseline matrix remains deferred until real thresholds and the controller verifier exist.

Co-authored-by: OmX <omx@oh-my-codex.dev>
@AlexStocks
AlexStocks merged commit 3f1d21c into main Jul 30, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant