-
-
Notifications
You must be signed in to change notification settings - Fork 309
Rust phase 3: native .iafbt bundle I/O #524
Copy link
Copy link
Open
Labels
performancePerformance / memory optimizationPerformance / memory optimizationrelease:backlogNot yet targetedNot yet targetedrustRust port / native accelerationRust port / native accelerationtype:featureNew capabilityNew capability
Description
Activity
Metadata
Metadata
Assignees
Labels
performancePerformance / memory optimizationPerformance / memory optimizationrelease:backlogNot yet targetedNot yet targetedrustRust port / native accelerationRust port / native accelerationtype:featureNew capabilityNew capability
Goal
Native Rust reader/writer for the
.iafbtbundle format so backtests can be loaded, mutated and rewritten without crossing the Python ↔ Rust boundary for every snapshot/trade row. This unlocks the streaming pipeline in the next phase.Tasks
investing_algorithm_framework/domain/backtesting/bundle.py): msgpack manifest + parquet timeseries + JSON metadata. Treatbundle.pyas the spec.rmp-serdefor msgpack manifest read/write.polars(orarrow2) for parquet portfolio snapshots / trades — zero-copy where possible.read_bundle(path) -> NativeBacktestHandle(opaque handle holding the parsed bundle in Rust memory; Python never sees the full payload).write_bundle(handle, dst_path, include_ohlcv: bool).bundle_summary(path) -> dictfor fast index rebuild without loading timeseries.tests/resources/must read in Rust → write to a tempdir → re-open in Python and produce aBacktestbyte-identical to the original (manifests) and equity-curve-identical (timeseries).bundle.pyreader: target ≥ 5× faster cold read on a 5-year hourly bundle.Acceptance criteria
Backtest.open()path can optionally use the native reader behind theIAF_NATIVEflag, with byte-for-byte equivalent output.Dependencies
Notes
Part of the Epic: hybrid Python + Rust acceleration.