Skip to content

Latency telemetry: retain evidence-grade p99.9 samples - #466

Merged
proerror77 merged 10 commits into
mainfrom
codex/latency-evidence-retention-398
Jul 29, 2026
Merged

proerror77 merged 10 commits into
mainfrom
codex/latency-evidence-retention-398

Conversation

@proerror77

@proerror77 proerror77 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Change contract

Add benchmark-grade Binance local-stage latency evidence with explicit p99.9 sample sufficiency and exclusions, while keeping the 200-sample operational window non-evidentiary.

Issue relationship

Closes #398

Acceptance evidence

  • --latency-report-out writes count, p50, p95, p99, p99.9, max, capture provenance, capture exclusions, and per-stage record exclusions after a configured message/runtime bound completes.
  • Fewer than 10,000 eligible observations serialize as insufficient-sample with benchmark_gate_eligible=false.
  • Warm-up and post-bridge sequence-gap updates are excluded explicitly; failed, closed, or otherwise incomplete captures emit no benchmark artifact.
  • The runtime deadline wraps the WebSocket receive await, so a stalled stream cannot overrun the declared capture bound.
  • Artifact provenance binds parse/total start to the actual pre-materialization userspace WebSocket message-delivery boundary.
  • Prometheus latency, ACK, and fill histograms have finite buckets through the declared 120-second range.
  • The operational rolling-window log identifies itself as non-benchmark evidence.

Out of scope

  • Universal latency SLO values
  • Timestamp capture changes
  • Live enablement or runtime mutation

Dependency / merge order

PRs #438, #440, and #464 are merged. This branch includes exact main merge commit 0d11a012c7dd7befc1d9d1ff5db910e111e5ec45; the metrics conflict retained both #464 execution-span coverage and this PR's finite latency-tail bucket test.

Focused validation

  • cargo test -p hft-binance-md (14 passed)
  • cargo test -p hft-infra-metrics (5 passed)
  • cargo test -p hft-engine latency_monitor::tests (4 passed)
  • cargo check -p hft-binance-md -p hft-infra-metrics -p hft-engine --all-targets
  • cargo fmt on changed Rust files
  • git diff --check
  • Matt Spec review: PASS after provenance regression fix
  • Matt Standards review: PASS at exact head 935d972f11ad42314cf9f643fd5cfa3025af0223

Review-size exception

The final diff is 5 files, 830 insertions, and 54 deletions. Named standards reviewer /root/pr466_standards approved the atomic exception: bounded capture, exclusions/sample sufficiency, atomic artifact, the non-evidentiary operational-window label, and finite histogram range form one evidence-integrity contract and must land or roll back together to avoid a partially truthful artifact. The 765-line binary change includes its focused tests; splitting it would leave a dead or unverified evidence schema.

Rollout / rollback impact

No deployment or live enablement. The new artifact is opt-in through --latency-report-out; rollback is a single PR revert. Live trading remains disabled.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 25 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: f85e268a-fa23-4d0b-9a13-1fe03d2fbb2b

📥 Commits

Reviewing files that changed from the base of the PR and between 0d11a01 and 935d972.

⛔ Files ignored due to path filters (1)
  • rust_hft/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • rust_hft/apps/binance-md/Cargo.toml
  • rust_hft/apps/binance-md/src/main.rs
  • rust_hft/infra-services/core/metrics/src/lib.rs
  • rust_hft/market-core/engine/src/latency_monitor.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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e05e15612

ℹ️ 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".

Comment thread rust_hft/apps/binance-md/src/main.rs Outdated
Comment thread rust_hft/apps/binance-md/src/main.rs Outdated
Comment thread rust_hft/apps/binance-md/src/main.rs
Comment thread rust_hft/apps/binance-md/src/main.rs Outdated
Base automatically changed from codex/latency-real-samples-397 to main July 29, 2026 12:25
Comment thread rust_hft/apps/binance-md/src/main.rs Fixed
Comment thread rust_hft/apps/binance-md/src/main.rs Fixed
Comment thread rust_hft/apps/binance-md/src/main.rs Fixed
Comment thread rust_hft/apps/binance-md/src/main.rs Fixed
Comment thread rust_hft/apps/binance-md/src/main.rs Fixed
Comment thread rust_hft/apps/binance-md/src/main.rs Fixed
@proerror77
proerror77 merged commit c1bf158 into main Jul 29, 2026
45 checks passed
@proerror77
proerror77 deleted the codex/latency-evidence-retention-398 branch July 29, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Latency telemetry: add evidence-grade p99.9 retention and sufficiency

2 participants