Files
foxhunt/crates/ml-backtesting/Cargo.toml
jgrusewski 771faac723 test(ml-backtesting): Ring 2 invariant fuzz at N ∈ {1, 16, 256} (C10)
Property-based fuzz tests with random-walk MBP-10 sequences applied to
the LOB simulator at three backtest counts; assert per-snapshot
invariants that must hold regardless of input or block scheduling:

  fuzz_n1_book_only (200 events, no orders)
    Pure book-update kernel — verifies mid-drift random walks preserve
    book monotonicity and never produce a crossed book.

  fuzz_n16_with_orders (200 events, market orders every 8th event)
    16 backtests in parallel, each submitting random buy/sell market
    orders 1-3 lots at every 8th event. Asserts book invariants on
    each backtest's state PLUS:
      - position_lots stays within ±30 (plausible given fixture book depth)
      - realized_pnl + vwap_entry finite (no NaN/Inf leaks)

  fuzz_n256_with_orders (100 events, market orders)
    Production-scale parallelism. Same invariants as N=16. Each block
    has its own per-backtest Pos + OpenTradeState + TradeLog, exercising
    the per-block isolation discipline established in C5-C7.

All 3 pass on RTX 3050. Spec §8 Ring 2 confidence gate hit.

Adds rand + rand_chacha to ml-backtesting dev-dependencies.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 09:00:49 +02:00

42 lines
1.2 KiB
TOML

[package]
name = "ml-backtesting"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
publish.workspace = true
keywords.workspace = true
categories.workspace = true
description = "ML backtesting framework + LOB simulator + per-horizon execution policy"
[dependencies]
ml-core.workspace = true
ml-alpha = { path = "../ml-alpha" } # loader + trunk reuse — see real-LOB spec §1
cudarc = { path = "../../vendor/cudarc" } # CUDA bindings — same vendored fork as ml-alpha
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
serde_yaml.workspace = true
chrono.workspace = true
anyhow.workspace = true
csv.workspace = true
bytemuck = { workspace = true, features = ["derive"] }
tracing.workspace = true
thiserror.workspace = true
# Sweep aggregator artifact format (parquet + arrow) — see C9.
parquet.workspace = true
arrow.workspace = true
arrow-array.workspace = true
arrow-schema.workspace = true
[dev-dependencies]
tempfile = "3.12"
rand.workspace = true
rand_chacha.workspace = true
[lints]
workspace = true