Skip to content

Add native NumPy delivery and end-to-end backtest evidence - #1

Merged
HayronHgh merged 4 commits into
mainfrom
research/backtest-lifecycle-20261022
Oct 22, 2026
Merged

HayronHgh merged 4 commits into
mainfrom
research/backtest-lifecycle-20261022

Conversation

@HayronHgh

Copy link
Copy Markdown
Owner

Python callers previously had to cross a process/JSON boundary to use FastK. This publishes the current 0.2 native NumPy interface, its core ownership/IO fixes, and a fixed backtest that changes only the storage adapter.

The backtest uses identical RSI(14) 30/70, SMA20/60 and 60-bar momentum strategies, next-open fills and carried monthly state. All five stores deliver the same readonly int64 OHLCV layout. The annual BTC/ETH experiment has 180 isolated application runs; every equity curve, trade digest, fee and final position matches. Relative to Arrow, monthly total medians improve by 2.61%, 8.80% and 0.79%; the last is effectively tied within observed variation.

A separate Q1 cohort rebuilds public commit 814c566 unchanged and compares its actual CLI/JSON path against native delivery: 30 complete backtests with identical outcomes. These are public-delivery/application ratios, not Rust-only algorithm speedups. The repository has no formal 1.0 tag; the initial commit is version 0.1.0-rc.1.

This branch consolidates the previously local native work, bounded positional reads, lock/recovery and snapshot contracts, lifecycle/cache controls, and their immutable evidence. It retains historical negative results and the initial Arrow import-boundary mistake, which was corrected before all five formal rounds were rerun. The adaptive read channel remains a design proposal.

Validation on Windows GNU:

  • 142 Rust tests and one doc test passed on the current source.
  • Seven backtest correctness tests passed, covering causal fills, costs, batching, gaps, failure cleanup and no replay.
  • Rustfmt and Python Ruff checks passed. CI now runs the backtest correctness tests in the native matrix.
  • Annual 130-query preflight and Q1 16-query preflight match canonical packed bytes; all 210 formal application outcomes agree within their own cohorts.
  • Evidence/source/archive hashes verified; isolated version-study data and metadata remain unchanged.

Native Linux/MSVC execution is not claimed by these local measurements. OS caches are uncontrolled and warmed by preflight. Data preparation, process imports and resident-control loading boundaries are documented. Raw measured files are kept byte-for-byte under docs/evidence/.

Start with docs/BACKTEST_RESULTS.md, docs/VERSION_COMPARISON.md and external-tests/backtest/README.md.

@HayronHgh
HayronHgh marked this pull request as ready for review October 22, 2026 17:36
@HayronHgh
HayronHgh merged commit 7645033 into main Oct 22, 2026
12 checks passed
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.

1 participant