Files
fidc-backtest-engine/docs/market-day-view-benchmark-20260831.md
T
2026-08-31 05:03:20 +08:00

52 lines
2.0 KiB
Markdown

# Market Day View Component Benchmark
Date: 2026-08-31
## Scope
The platform-expression selection loop already iterates one factor slice for a
single trading date. The previous implementation still resolved the same date
in the market and candidate `BTreeMap` for every symbol. `DailySnapshotView`
borrows the existing immutable market/factor/candidate slices and dense row
position arrays once per date, then performs only `symbol_id -> row` lookups.
The view does not copy snapshots, cache strategy results, share account state,
or change missing-row behavior. The optimization is independent of strategy
text, thresholds, rolling windows, execution mode and portfolio size.
## Release Component A/B
Contract:
- 6,000 symbols;
- 200 complete lookup rounds;
- each lookup reads market close and candidate `allow_buy`;
- baseline and view checksums must be exactly equal;
- `cargo test --release`, system allocator, local macOS host.
| Round | Baseline seconds | Day view seconds |
| ---: | ---: | ---: |
| 1 | 0.009000 | 0.002939 |
| 2 | 0.004370 | 0.001555 |
| 3 | 0.004274 | 0.001578 |
Median component time changed from `0.004370s` to `0.001578s`, an observed
reduction of about `63.9%` (`2.77x`). This is a component result only and is
not a complete backtest SLA.
## Correctness Gates
- sparse market-only symbols remain absent from factor/candidate views;
- dense and binary-search fallback lookup semantics remain unchanged;
- full engine suite: 529 passed, 3 ignored manual benchmarks;
- next-open execution-day risk, minute matching, fees, slippage, volume limits,
corporate actions, delisting and futures tests all passed.
## Deployment Status
Not deployed. The 177 FIDC-managed Boris factor task is still active, so no
Source Lake, backtest service or engine restart is allowed. After the task
ends naturally, acceptance must use the same frozen bundle and compare daily
selection, orders, fills, holdings, NAV, risk facts and canonical digest for
multiple daily/minute and fixed/dynamic-universe strategies.