ORB Python-To-Rust Speedup Record
Scope And Limitations
Executive Summary
Base data loading 25.192x | #####
Higher-timeframe resample 33.297x | #######
Range discovery 92.306x | ##################
Chunk analytics build 2.128x | #
Dense prepared reconstruction 68.817x | ##############
Finalize event batch build 152.802x | ###############################
Evidence Inventory
| Field | Value |
|---|---|
| family | within_session_day_high |
| report date | 2026-05-01 |
| rustc version | 1.95.0 |
| cargo version | 1.95.0 |
| accepted Python/runtime optimizations | 12 |
| accepted Rust stage ports | 6 |
| rejected DuckDB/Rust experiments | 7 |
| Label | Meaning |
|---|---|
| Direct measured | A saved benchmark gives Python time, Rust time, speedup, and parity status. |
| Current ORB profile | A saved ORB profile gives Rust timings and scheduler tuning, but not Python comparison. |
| Implementation verified | The current Rust implementation contains the named structure, function, or algorithm. |
| Inferred | Derived from implementation and known Python bottleneck shape; old Python implementation was not available. |
| Missing | Needed for complete historical proof but not available in the reviewed evidence. |
Visual Architecture Change
flowchart LR
A["Old inferred Python-style path"] --> B["Load DB rows and Python objects"]
B --> C["Rebuild or slice timeframes repeatedly"]
C --> D["Discover signal/range repeatedly"]
D --> E["Scan future bars per stop/RR row"]
E --> F["Materialize rows early"]
F --> G["Aggregate with dict/list/DataFrame overhead"]
H["Current Rust path"] --> I["Load typed OHLCV arrays or binary cache"]
I --> J["Build resident session-aware frames once"]
J --> K["Prepare entry per candidate/session"]
K --> L["Flatten SL/RR ComboSpec grid"]
L --> M["One batched future scan"]
M --> N["u64 masks, AVX2 compares, early exit"]
N --> O["Summaries first, trades only for selected rows"]
Current Rust ORB Pipeline
flowchart TD
DB["SQLite DB"] --> RO["Read-only loader"]
RO --> BC["Binary symbol cache"]
BC --> OHLCV["OhlcvFrame typed arrays"]
OHLCV --> RES["Session-aware resample cache"]
RES --> RSI["RSI planes, if requested"]
RSI --> BUNDLE["ResidentBundle"]
BUNDLE --> PREP["prepare_entries"]
PREP --> ENTRY["PreparedEntry per session"]
ENTRY --> GRID["Flattened ComboSpec SL/RR grid"]
GRID --> SCRATCH["WorkerScratch arrays"]
SCRATCH --> MASK["Pending masks"]
MASK --> SIMD["AVX2/scalar compare mask"]
SIMD --> ACC["SummaryAccumulator"]
ACC --> LB["Leaderboard rows"]
LB --> TRADES["Selected trade rows"]
Optimization Count Chart
Accepted Python/runtime optimizations 12 | ############
Accepted Rust stage ports 6 | ######
Rejected DuckDB/Rust experiments 7 | #######
Speedup Layer 1: Within Python Changes
Python Phase Visual
Timeframe-loading slice
Before Python cleanup 44.595s | ######################
After Python cleanup 20.849s | ##########
Speedup: 2.139x
RR/stop grid slice
Before Python batching 2.268s | ###########
After Python batching 0.950s | #####
Speedup: 2.388x
Finalize/OOS path
Early finalize state 1370.690s | #######################################################
After major cleanup 519.537s | #####################
Derived speedup: 2.638x
Later finalize cleanup chain
Before smaller cleanups 494.746s | ####################
After smaller cleanups 351.280s | ##############
Derived speedup: 1.408x
What Changed Inside Python
| # | Python-side change | What changed operationally | Why it was faster | Measurement / status |
|---|---|---|---|---|
| 1 | 1m base-loading contract plus in-memory resample | The pipeline standardized on loading canonical 1m bars and deriving higher timeframes in memory. | Avoided repeatedly loading or rebuilding equivalent timeframe data through slower row/object paths. | 44.595s -> 20.849s, 2.139x, kept |
| 2 | RR and stop grid batching | Stop-loss and risk/reward variants were grouped instead of being handled as fully separate small jobs. | Reduced repeated loop dispatch, repeated future scans, and repeated Python object setup around the same market slice. | 2.268s -> 0.950s, 2.388x, kept |
| 3 | Coordinator/finalize checkpoint plus OOS cleanup | Finalize work was made more checkpointable and the out-of-sample cleanup path was reduced. | Avoided redoing already-completed chunks and reduced repeated post-processing around validation output. | 1370.690s -> 519.537s, kept |
| 4 | Finalize input cache plus setup signal cache | Stable finalize inputs and setup/signal work were cached between repeated runs. | Saved repeated preparation of the same signal and validation inputs. | 494.746s -> 483.357s, kept |
| 5 | Dense reducer merge redesign | Reducer merging was reshaped toward dense intermediate structures. | Reduced overhead from nested Python containers during merge-heavy stages. | 483.357s -> 392.279s, kept |
| 6 | Prepared-outcome / OOS formatting cleanup | Prepared outcome and OOS formatting work was trimmed. | Pushed less formatting through hot paths and reduced conversion work before final output. | 392.279s -> 366.200s, kept |
| 7 | Finalize input cache v2 | The finalize input cache was refined. | Increased reuse of stable inputs and reduced remaining cache miss/rebuild work. | 366.660s -> 362.340s, kept |
| 8 | OOS probability map cleanup | OOS probability-map handling was simplified. | Reduced lookup/formatting overhead around validation probability data. | 362.340s -> 360.260s, kept |
| 9 | Dense-arrays to prepared cleanup | Dense-array to prepared-output conversion was cleaned up. | Reduced conversion overhead when moving from numeric arrays back into prepared Python output objects. | 360.260s -> 358.400s, kept |
| 10 | OOS rank tail-prune | Lower-value tail candidates were pruned before later ranking/finalize work. | Prevented the slowest downstream code from processing candidates that could not matter to the final ranking. | 358.400s -> 352.780s, kept |
| 11 | Split finalize cache | The finalize cache was split by more stable sub-inputs. | Allowed reuse of sub-results when only part of the finalize input changed. | 352.780s -> 351.280s, kept |
| 12 | Worker batch shaping | Worker batch shape was tuned. | Improved the target hotspot, but the saved report says end-to-end runtime stayed flat. | kept as a hotspot improvement, no material e2e gain |
Python Lessons That Carried Into Rust
Python Phase Takeaway
Accepted Python And Runtime Optimizations
| # | Optimization | Result | Kept |
|---|---|---|---|
| 1 | 1m base-loading contract plus in-memory resample | 44.595s -> 20.849s, 2.139x | yes |
| 2 | RR and stop grid batching | 2.268s -> 0.950s, 2.388x | yes |
| 3 | coordinator/finalize checkpoint plus OOS cleanup | finalize 1370.690s -> 519.537s | yes |
| 4 | finalize input cache plus setup signal cache | 494.746s -> 483.357s | yes |
| 5 | dense reducer merge redesign | 483.357s -> 392.279s | yes |
| 6 | prepared-outcome / OOS formatting cleanup | 392.279s -> 366.200s | yes |
| 7 | finalize input cache v2 | 366.660s -> 362.340s | yes |
| 8 | OOS probability map cleanup | 362.340s -> 360.260s | yes |
| 9 | dense-arrays to prepared cleanup | 360.260s -> 358.400s | yes |
| 10 | OOS rank tail-prune | 358.400s -> 352.780s | yes |
| 11 | split finalize cache | 352.780s -> 351.280s | yes |
| 12 | worker batch shaping | target hotspot improved, end-to-end flat | no material e2e gain |
Initial representative loading slice 44.595s
After 1m base/in-memory resample 20.849s
Finalize path early state 1370.690s
After checkpoint/OOS cleanup 519.537s
After dense reducer redesign 392.279s
After prepared/OOS cleanup 366.200s
After final smaller cleanups 351.280s
Accepted Rust Stage Ports
| # | Stage | Python | Rust | Speedup | Parity / decision |
|---|---|---|---|---|---|
| 1 | Base data loading | 36.899s | 1.465s | 25.192x | accepted, exact summary/signature match |
| 2 | Higher-timeframe resample | 60.053s | 1.804s | 33.297x | accepted, exact summary/signature match |
| 3 | Range discovery | 118.732s | 1.286s | 92.306x | accepted, exact summary/signature match |
| 4 | Chunk analytics build | 17.204s | 8.084s | 2.128x | accepted, exact ChunkAnalyticsSummary parity |
| 5 | Dense prepared reconstruction | 29.256s | 0.425s | 68.817x | accepted as hotspot upper-bound evidence, row-level summary/signature match |
| 6 | Finalize event batch build | 21.037s | 0.138s | 152.802x | accepted, main and supplement parity true |
Python Time vs Rust Time Chart
Base data loading
Python 36.899s | #######
Rust 1.465s | .
Higher-timeframe resample
Python 60.053s | ############
Rust 1.804s | .
Range discovery
Python 118.732s | ########################
Rust 1.286s | .
Chunk analytics build
Python 17.204s | ###
Rust 8.084s | ##
Dense prepared reconstruction
Python 29.256s | ######
Rust 0.425s | .
Finalize event batch build
Python 21.037s | ####
Rust 0.138s | .
Speedup Layer 2: Within Rust Changes
Rust Phase Visual
flowchart LR
A["Naive native port risk"] --> B["Still repeats work"]
B --> C["Still scans per combo"]
C --> D["Still allocates per job"]
D --> E["Still has scheduler imbalance"]
F["Optimized Rust path"] --> G["Resident typed arrays"]
G --> H["Prepared entries"]
H --> I["Flattened combo blocks"]
I --> J["Scratch reuse and pending masks"]
J --> K["AVX2 compare masks"]
K --> L["Persistent pools and tuned scheduler"]
Current ORB Rust Pass-To-Pass Tuning Evidence
| Metric | pass0_baseline | pass1_reprofile | Improvement |
|---|---|---|---|
| Scheduler | session_major | hybrid_blocked | changed work partitioning |
| Workers | 8 | 16 | more parallelism |
| Session block | 1 | 24 | larger session batches |
| Param block | 8 | 8 | unchanged |
| Load/prep | 3087us | 1233us | 2.504x faster |
| Signal eval | 499us | 472us | 1.057x faster |
| Combo eval | 2572us | 760us | 3.384x faster |
| Total wall | 3073us | 1233us | 2.492x faster |
Combo evaluation
pass0 baseline 2572us | ##########################
pass1 tuned 760us | ########
Total wall
pass0 baseline 3073us | ###############################
pass1 tuned 1233us | ############
What Changed Inside Rust
| # | Rust-side change | What changed operationally | Why it was faster | Evidence |
|---|---|---|---|---|
| 1 | Columnar OhlcvFrame layout | Market data is held as Vec<u32>, Vec<u16>, and Vec<f32> columns rather than row objects. | Hot loops walk compact contiguous arrays with better cache locality and less per-row overhead. | implementation verified; base loading 25.192x and resample 33.297x stage evidence |
| 2 | Binary OHLCV cache | Loaded symbols can be stored in RBCACHE1 binary cache format with typed arrays and session ranges. | Later runs avoid repeated SQLite row conversion and rebuild typed vectors directly. | implementation verified; base loading stage evidence |
| 3 | Read-only SQLite loader settings | Loader uses query_only, memory temp store, larger cache size, and mmap size. | Optimizes the DB path for read-heavy backtesting instead of generic SQLite behavior. | implementation verified |
| 4 | Session-aware resampling | Resampling happens inside session boundaries with session ranges preserved. | Higher timeframes are built once and reused without crossing sessions or rebuilding per candidate. | implementation verified; resample 33.297x |
| 5 | Resident frame and RSI caches | ResidentBundle, ResidentFrame, and RsiPlane keep timeframes/features resident. | Feature construction is reused across variants instead of recomputed through every candidate path. | implementation verified |
| 6 | Prepared ORB entries | prepare_entries builds one numeric entry record per candidate/session before combo evaluation. | Signal discovery is separated from stop/RR evaluation, avoiding candidate x combo repeated signal work. | implementation verified; ORB effect inferred |
| 7 | Flattened ComboSpec grids | Stop/RR combinations are flattened into blocks. | The evaluator can process many combinations together instead of dispatching one Python-like row at a time. | implementation verified |
| 8 | WorkerScratch reuse | Stop prices, target prices, risks, metrics, and masks reuse per-worker buffers. | Avoids repeated allocation and keeps combo arrays hot in memory. | implementation verified |
| 9 | u64 pending masks | Up to 64 unresolved combinations are tracked in one word. | Resolved combos stop consuming checks, and early exit ends the future-bar scan when all combos resolve. | implementation verified |
| 10 | AVX2 compare masks | Threshold checks compare 8 f32 values at a time when AVX2 is available. | Stop/target checks become vector operations that feed directly into the pending mask format. | implementation verified |
| 11 | Scalar fallback | Non-AVX2 machines use the same mask contract through scalar loops. | Keeps behavior portable without splitting the evaluation model. | implementation verified |
| 12 | Persistent worker pools | Worker threads live across jobs and receive work through channels. | Avoids repeated thread creation during benchmark/search workloads. | implementation verified |
| 13 | Scheduler modes | session_major, param_major, hybrid_blocked, and thread_per_param support different workload shapes. | Work can be split along the dominant dimension instead of forcing one scheduler on every grid. | implementation verified; ORB profile pass evidence |
| 14 | Cached selected tuning | Profile/baseline artifacts record selected scheduler and block settings. | Later runs can reuse known-good choices instead of rediscovering them from scratch. | current ORB profile evidence |
| 15 | Summary-first output | Rust accumulates compact summaries and materializes trade rows only for selected/inspection paths. | Avoids Python-style full row expansion across every intermediate candidate. | implementation verified; dense prepared and event batch stage evidence |
Rust Phase Takeaway
Benchmark Card 1: Base Data Loading
| Symbol | Match | Bars | Sessions | Timeframe | Signature |
|---|---|---|---|---|---|
| BANKNIFTY | True | 462814 | 1240 | 1 | 14979702488594476994 |
| FINNIFTY | True | 462815 | 1240 | 1 | 12830231235636915535 |
| NIFTY | True | 462862 | 1240 | 1 | 16746711586037283007 |
| SENSEX | True | 462854 | 1241 | 1 | 7164122480827181626 |
Benchmark Card 2: Higher-Timeframe Resample
| Symbol | TF | Match | Bars | Sessions | Signature |
|---|---|---|---|---|---|
| BANKNIFTY | 2 | True | 232021 | 1240 | 10623403372796047685 |
| BANKNIFTY | 3 | True | 154274 | 1240 | 11683861620331284709 |
| BANKNIFTY | 5 | True | 92565 | 1240 | 15572291281304323151 |
| BANKNIFTY | 7 | True | 66648 | 1240 | 13119536419317246893 |
| BANKNIFTY | 10 | True | 46899 | 1240 | 3451223347036751332 |
| BANKNIFTY | 15 | True | 30856 | 1240 | 10196389433094323293 |
| FINNIFTY | 2 | True | 232022 | 1240 | 6773245237344672967 |
| FINNIFTY | 3 | True | 154274 | 1240 | 5452828566907294839 |
| FINNIFTY | 5 | True | 92565 | 1240 | 14013925004150641618 |
| FINNIFTY | 7 | True | 66648 | 1240 | 6484163754068440467 |
| FINNIFTY | 10 | True | 46899 | 1240 | 5091172562065009978 |
| FINNIFTY | 15 | True | 30856 | 1240 | 8323565727100361650 |
| NIFTY | 2 | True | 232045 | 1240 | 6269823062222553913 |
| NIFTY | 3 | True | 154289 | 1240 | 91100024418122270 |
| NIFTY | 5 | True | 92575 | 1240 | 10165090913439292164 |
| NIFTY | 7 | True | 66655 | 1240 | 15451707410263674778 |
| NIFTY | 10 | True | 46904 | 1240 | 6016081311971001549 |
| NIFTY | 15 | True | 30859 | 1240 | 7726354906344598091 |
| SENSEX | 2 | True | 232041 | 1241 | 12073356468092182653 |
| SENSEX | 3 | True | 154288 | 1241 | 3249127358710964883 |
| SENSEX | 5 | True | 92574 | 1241 | 1796560672201851377 |
| SENSEX | 7 | True | 66654 | 1241 | 9945275399724493284 |
| SENSEX | 10 | True | 46904 | 1241 | 6752291735196555283 |
| SENSEX | 15 | True | 30859 | 1241 | 638337056868199258 |
Benchmark Card 3: Range Discovery
Benchmark Card 4: Chunk Analytics Build
Benchmark Card 5: Dense Prepared Reconstruction
| Row class | Rows |
|---|---|
| baseline | 1200 |
| baseline-by-year | 7200 |
| single | 77521 |
| single-by-year | 460965 |
| pair | 1700252 |
| pair-by-year | 9583646 |
| triple | 2492830 |
| triple-by-year | 12569630 |
Benchmark Card 6: Finalize Event Batch Build
Rejected Or Conditional Experiments
| Experiment | Python | Candidate | Outcome | Reason |
|---|---|---|---|---|
| DuckDB final consensus on large sweep | 1.558s | 0.467s | conditional keep | useful only on large consensus-shaped aggregation |
| DuckDB dense outcome aggregation | n/a | much slower | reject | 12x to 15x slower than Python reducer path |
| Dense reducer merge in Rust | 18.340s | 27.568s | reject | slower and failed reducer_signature parity |
| OOS candidate selection hybrid | 19.163s | 48.880s | reject | exact but Python-side flattening dominated |
| Grouped row scoring hybrid | 48.136s | 48.461s | reject | exact mode slightly slower than Python |
| Prediction-cell hybrid | 0.825s | 1.011s | reject | slower and not row-exact |
| Finalize strategy evaluation in Rust | 50.442s | 0.921s | reject | very fast but failed exact EvalSummarySet parity |
Accepted because fast and parity-safe:
base loading 25.192x parity True
resample 33.297x parity True
range discovery 92.306x parity True
chunk analytics 2.128x parity True
dense prepared 68.817x signature True, hotspot upper-bound
event batch build 152.802x parity True
Rejected or conditional:
dense reducer merge 0.665x parity False
OOS candidate hybrid 0.392x parity True but slower
grouped row scoring 0.993x exact but slower
prediction-cell hybrid 0.816x not row-exact
finalize strategy eval 54.792x parity False
attempt analysis 139.656x parity False
Current Runtime Chokepoints After Python Optimization
| Hotspot | Time |
|---|---|
_run_finalize_chunk_worker | 38.790s |
build_oos_validation | 38.464s |
_dense_arrays_to_prepared_outcomes | 28.974s |
build_event_batch_for_variant | 14.715s |
Current ORB Rust Profile Evidence
| Pass | Scheduler | Workers | Pinning | Session block | Param block | Load/prep | Feature build | Signal eval | Combo eval | Total wall |
|---|---|---|---|---|---|---|---|---|---|---|
pass0_baseline | session_major | 8 | none | 1 | 8 | 3087us | 1us | 499us | 2572us | 3073us |
pass1_reprofile | hybrid_blocked | 16 | none | 24 | 8 | 1233us | 0us | 472us | 760us | 1233us |
pass2_reprofile | session_major | 16 | none | 1 | 64 | 22453us | 0us | 488us | 21964us | 22453us |
pass0 combo eval 2572us | ##########
pass1 combo eval 760us | ###
pass2 combo eval 21964us | ########################################################################################
Implementation-Level Design Facts
Market Data Structure
OhlcvFrame
- symbol: String
- day_keys: Vec<u32>
- minute_of_day: Vec<u16>
- open: Vec<f32>
- high: Vec<f32>
- low: Vec<f32>
- close: Vec<f32>
- volume: Vec<f32>
- sessions: Vec<SessionRange>
SessionRange
- day_key: u32
- start: usize
- end: usize
RsiPlane
- period: usize
- values: Vec<f32>
ResidentFrame
- timeframe_minutes: usize
- frame: Arc<OhlcvFrame>
- day_to_session: Arc<HashMap<u32, usize>>
- rsi_planes: Vec<Arc<RsiPlane>>
ResidentBundle
- symbol: String
- years: usize
- frames: Vec<ResidentFrame>
Binary Cache Contract
SQLite Read Settings
PRAGMA query_only = ON;
PRAGMA temp_store = MEMORY;
PRAGMA cache_size = -200000;
PRAGMA mmap_size = 268435456;
ORB Entry Preparation
prepare_entries
-> prepare_orb_entry
-> prepare_orb_signal_entry
-> materialize_orb_prepared_entry
-> evaluate_entry_combo_block
Combo Evaluation Scratch Buffers
WorkerScratch
- stop_prices: Vec<f32>
- target_prices: Vec<f32>
- risk_points: Vec<f32>
- metrics: Vec<TradeMetric>
- pending_masks: Vec<u64>
Pending Mask Logic
For each combo block:
pending_mask = all bits set
For each future bar:
stop_mask = compare(bar stop-side price, stop_prices) & pending_mask
clear stopped bits
target_mask = compare(bar target-side price, target_prices) & pending_mask
clear target-hit bits
if all pending masks are zero:
break early
AVX2 Compare Path
if AVX2 detected:
compare 8 f32 thresholds at a time
convert comparison result to bitmask
else:
scalar loop over thresholds
Persistent Worker Pools
PersistentPools
- one pool per worker count for pinning=none
- one pool per worker count for pinning=physical
- jobs submitted through channels
- worker threads stay alive until pool drop
Scheduler Modes
| Scheduler | Shape | Use |
|---|---|---|
session_major | split sessions across jobs, evaluate combos inside each session | good when entries are many and combo block batching is useful |
param_major | split combo blocks, iterate entries inside combo block | useful for combo-heavy workloads |
hybrid_blocked | split both sessions and combo blocks | useful when both dimensions need balancing |
thread_per_param | distribute narrow combo work across workers | useful for certain ORB/MTF grids and defaults |
ORB Family Coverage In Rust
| Dimension | Current Rust support |
|---|---|
| Timeframes | single-timeframe and multi-timeframe |
| Opening range | opening range candle count, OR timeframe |
| Deadline | breakout deadline candles |
| Retest logic | direct, single retest, double retest |
| Signal pattern | first breakout only, opposite reversal allowed, opposite reversal required |
| Confirmation | close confirmation, confirm chain, higher timeframe confirmation |
| Execution | legacy same-bar, close-confirm next open, resting limit at level |
| Stop | scaled candle extreme, opposite range, fixed points |
| Target | touch, next close confirm, confirming bar close |
| Carry | session exit |
| Context | gap bucket, open vs previous range, ORB color, breakout side, breakout extension, reversal observed |
Code-Level Mapping From Bottleneck To Rust Mechanism
| Old bottleneck category | Current Rust mechanism | Evidence quality | Performance effect |
|---|---|---|---|
| DB row conversion per run | read-only loader plus binary cache | direct measured, implementation verified | base loading 25.192x |
| Repeated timeframe rebuilds | cached session-aware OhlcvFrame resampling | direct measured, implementation verified | resample 33.297x |
| Python range/event loops | typed Rust range discovery loops | direct measured | range discovery 92.306x |
| Repeated signal work per SL/RR | prepare_entries before combo eval | implementation verified, inferred ORB effect | removes candidate x combo signal repetition |
| Future scan per combo row | evaluate_entry_combo_block scans many combos together | implementation verified | fewer scans, better cache locality |
| Python dict/list reconstruction | summary-first Rust output and selected trade materialization | direct measured in dense prepared/event batch | dense/event stages 68.817x and 152.802x |
| Stop/target branch churn | pending masks and early exit | implementation verified | resolved combos are skipped |
| Scalar threshold checks | AVX2 compare mask with scalar fallback | implementation verified | 8 thresholds compared per vector on AVX2 machines |
| Repeated thread creation | PersistentPools | implementation verified | lower scheduling overhead for benchmark/search jobs |
| One fixed scheduler | tuned scheduler matrix and baselines | current ORB profile | selects better worker/scheduler/block settings by workload |
Claim Ledger
| Claim | Status | Evidence |
|---|---|---|
| Rust data loading is much faster than Python loading | proven for benchmark stage | 36.899s -> 1.465s, exact parity true |
| Rust resampling is much faster than Python resampling | proven for benchmark stage | 60.053s -> 1.804s, all symbol/timeframe parity true |
| Rust range discovery reached about 100x speedup | proven for benchmark stage | 118.732s -> 1.286s, 92.306x, parity true |
| Rust finalize event batch crossed 100x | proven for benchmark stage | 21.037s -> 0.138s, 152.802x, parity true |
| Dense prepared Rust path showed very large speedup | proven as hotspot upper-bound | 68.817x vs production prepared path, 310.187x reducer-summary |
| Current ORB combo eval has measurable hotspots | proven in ORB profile | pass0/pass1/pass2 timing table |
| Rust ORB uses typed resident arrays | implementation verified | OhlcvFrame field list |
| Rust ORB uses prepared entries and batched combos | implementation verified | flow and scratch buffer facts |
| Rust ORB uses AVX2 where available | implementation verified | AVX2 function family |
| Full ORB end-to-end old Python vs Rust is 100x | not proven | direct matching artifact not found |
| Every Rust attempt was accepted | false | rejected experiments table |
What Is Directly Measured, Inferred, And Missing
Why The 100x-Class Claim Is Still Technically Fair
Several heavy benchmarked stages that ORB-like backtesting depends on reached 100x-class Rust speedups, with accepted stage evidence up to
152.802x.
Every full ORB backtest is proven to be 100x faster end to end.
Historical Timeline From Available Evidence
2026-04-25
Chunk scheduling benchmark work was active.
2026-04-26
Finalize optimization improved end-to-end modestly and finalizer substantially.
2026-04-27
Python/runtime optimization phase:
- 1m base-loading contract plus in-memory resample
- RR/stop batching
- coordinator/finalize checkpoint and OOS cleanup
- dense reducer redesign
2026-04-28
Finalize/OOS cleanup continued:
- prepared outcome cleanup
- final input cache v2
- OOS probability map cleanup
- dense arrays to prepared cleanup
- OOS rank prune
- split finalize cache
- dense prepared Rust benchmark captured
2026-05-01
Rust stage-port benchmark suite captured:
- base data loading
- higher-timeframe resample
- range discovery
- chunk analytics
- finalize event batch
- rejected Rust/DuckDB attempts documented
2026-05-27
Current Rust backtester/ORB artifacts inspected.
2026-06-04
Benchmark record consolidated from available evidence.
Reproduction Notes
Gap Closure Plan
Final Takeaway
The Rust migration produced measured 100x-class speedups in several heavy backtesting stages, including
92.306xfor range discovery and152.802xfor finalized event batch building. The current Rust ORB engine uses the same core performance design: typed resident data, cached resampling, prepared entries, batched SL/RR evaluation, pending masks, AVX2 compares, persistent workers, and profiled scheduler tuning. A direct full old-Python-ORB versus current-Rust-ORB end-to-end benchmark is still missing, so the 100x claim should be stated as stage-level rather than universal full-run proof.
Comments