Skip to content

feat(backtest): SHA cache warmer and local Parquet replay - #666

Merged
proerror77 merged 1 commit into
mainfrom
codex/cex-parquet-cache-backtest-652
Aug 3, 2026
Merged

proerror77 merged 1 commit into
mainfrom
codex/cex-parquet-cache-backtest-652

Conversation

@proerror77

Copy link
Copy Markdown
Owner

Change contract

Add a manifest-bound local cache warmer and canonical Parquet input path for hft-backtest. The warmer verifies the artifact SHA, stages privately, publishes atomically, and binds a .ready marker to the manifest SHA; same-manifest cache hits avoid source transfer. The backtest reader validates the canonical manifest, artifact SHA/schema, sequence and timestamp continuity, applies the configured time window, and records immutable manifest/config/source evidence plus replay row count.

Issue relationship

Closes #652

Out of scope

No live/runtime enablement, risk-limit changes, collector materialization changes, remote/object-store deployment, or result publication changes.

Dependencies and merge order

None; this consumes the canonical replay Parquet contract already on main.

Focused validation

  • cargo test -p hft-backtest --locked (28 unit + 1 local-Parquet CLI integration passed)
  • cargo test -p hft-collector --test binance_replay_parquet_materializer --locked (2 passed)
  • cargo test -p hft-collector --test binance_replay_parquet_cache_warmer --locked (2 passed)
  • cargo clippy -p hft-backtest --all-targets --no-deps --locked -- -D warnings
  • cargo clippy -p hft-collector --all-targets --features collector-binance --no-deps --locked -- -D warnings
  • cargo metadata --locked --no-deps, targeted rustfmt checks, git diff --cached --check, and worktree preflight passed.
  • Safety counterexamples are covered: corrupted/conflicting cache entries and artifact SHA mismatches fail closed; a cache hit succeeds after the source artifact is removed.

Rollout and rollback

None. This is a local cache/backtest path and does not resume live execution; rollback is reverting this single commit.

Scope exception

One-time atomic exception approved by /root: 8 scoped files and 918 non-generated additions exceed the 750-line guideline because cache warming and the no-raw-source canonical-Parquet reader form one independently testable and rollbackable contract; splitting would leave an orphan cache or bypassed reader.

@coderabbitai

coderabbitai Bot commented Aug 3, 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: 42 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: 1cf1beca-c7f8-4c79-9b63-27f68280af23

📥 Commits

Reviewing files that changed from the base of the PR and between 47facfd and 1fc6d1e.

⛔ Files ignored due to path filters (1)
  • rust_hft/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • rust_hft/apps/backtest/Cargo.toml
  • rust_hft/apps/backtest/src/config.rs
  • rust_hft/apps/backtest/src/main.rs
  • rust_hft/apps/backtest/tests/local_parquet_replay.rs
  • rust_hft/tools/collector/Cargo.toml
  • rust_hft/tools/collector/src/bin/binance-replay-parquet-cache-warmer.rs
  • rust_hft/tools/collector/tests/binance_replay_parquet_cache_warmer.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.

@proerror77
proerror77 merged commit 9b8b36b into main Aug 3, 2026
50 checks passed
@proerror77
proerror77 deleted the codex/cex-parquet-cache-backtest-652 branch August 3, 2026 17:14
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.

CEX: SHA 缓存预热与本地 Parquet 回测

1 participant