Reamer stress benchmark
Data dir: tests/stress/data

benchmark                                                elapsed       items unit         throughput
----------------------------------------------------------------------------------------------------

-- B1  CSV PARSE -------------------------------------------------------
  csv_parse deep_1m  ~1.2M rows                           0.103s      235768 bars           2289180/s  +15 MB
  csv_parse deep_4m  ~4.7M rows                           0.398s      884130 bars           2223465/s  +54 MB
  csv_parse scrambled 311k OOO                            0.025s       58942 bars           2370488/s  +7 MB
  csv_parse sparse    ~39k rows                           0.003s        7368 bars           2501829/s

-- B2  TIMELINE + ALIGNED BUILD ----------------------------------------
  timeline_union wide_10  10 tickers  589420 bars         0.005s       58942 steps         10891987/s  +6 MB
  aligned_union  wide_10  10 tickers                      0.021s       58942 steps          2777694/s  +24 MB
  timeline_union wide_20  20 tickers  1178840 bars        0.016s      153942 steps          9912569/s  +13 MB
  aligned_union  wide_20  20 tickers                      0.048s      153942 steps          3221694/s  +98 MB

-- B3  PORTFOLIO ENGINE — SINGLE-TICKER DEPTH ------------------------
  replay_depth no_brackets  235768 bars  1179 trades      0.014s      235768 bars          16262231/s  +0 MB
  replay_depth brackets     235768 bars  206 trades       0.014s      235768 bars          16959168/s

-- B4  PORTFOLIO ENGINE — MULTI-ASSET BREADTH ------------------------
  replay_breadth wide_10  10 tickers  no_brackets         0.016s       58942 steps          3614466/s
  replay_breadth wide_10  10 tickers  brackets            0.018s       58942 steps          3276027/s
  replay_breadth wide_20  20 tickers  no_brackets         0.390s      153942 steps           394825/s

-- B5  REPLAY ENGINE ---------------------------------------------------
  replay_sparse_with_position  ~93M ticks                 0.304s    17683200 ticks         58109546/s
  replay_snapshot_baseline      second_half               0.102s       29471 bars            289014/s
  replay_snapshot_after_restore second_half               0.102s       29471 bars            288759/s

-- B6  MONTE CARLO -----------------------------------------------------
  montecarlo   1000 trades ×   1000 sims                 0.005s     1000000 ops          184207826/s  +8 MB
  montecarlo  10000 trades ×  10000 sims                 0.042s   100000000 ops         2403097959/s  +756 MB
  montecarlo_streaming  10000 trades × 100000 sims       0.094s  1000000000 ops        10613432519/s  +61 MB

-- B7  END-TO-END  (COMBO: 5 tickers × ~1.2M bars) --------------------
  load:    5 tickers  1178840 total bars  0.475s
  timeline build: 235768 steps  0.020s
  backtest: 1163 trades  0.040s
  monte_carlo: 10000 curves × 5 steps  0.023s
  e2e_combo  5×1.2M bars  backtest+MC                    0.562s     1178840 bars           2098466/s  +35 MB

-- B8  SCALE — N×T PORTFOLIO BACKTEST (synthetic daily bars) --------
  scale_build   n= 50  t= 5yr  63K bars                   0.000s        1260 steps          3676782/s
  scale_backtest n= 50  t= 5yr  1250 trades               0.004s        1260 steps           303979/s
  scale_build   n= 50  t=10yr  126K bars                  0.000s        2520 steps          5301123/s
  scale_backtest n= 50  t=10yr  2500 trades               0.008s        2520 steps           309153/s
  scale_build   n= 50  t=20yr  252K bars                  0.001s        5040 steps          4853705/s
  scale_backtest n= 50  t=20yr  5050 trades               0.018s        5040 steps           276669/s
  scale_build   n= 50  t=40yr  504K bars                  0.005s       10080 steps          2200811/s
  scale_backtest n= 50  t=40yr  10100 trades              0.045s       10080 steps           223657/s
  scale_build   n=100  t= 5yr  126K bars                  0.001s        1260 steps          2252611/s
  scale_backtest n=100  t= 5yr  2500 trades               0.009s        1260 steps           134813/s
  scale_build   n=100  t=10yr  252K bars                  0.001s        2520 steps          2703132/s
  scale_backtest n=100  t=10yr  5000 trades               0.020s        2520 steps           126768/s
  scale_build   n=100  t=20yr  504K bars                  0.005s        5040 steps          1070153/s
  scale_backtest n=100  t=20yr  10100 trades              0.047s        5040 steps           106210/s
  scale_build   n=100  t=40yr  1008K bars                 0.011s       10080 steps           904163/s
  scale_backtest n=100  t=40yr  20200 trades              0.111s       10080 steps            90732/s  +71 MB
  scale_build   n=200  t= 5yr  252K bars                  0.002s        1260 steps           609263/s  +0 MB
  scale_backtest n=200  t= 5yr  5000 trades               0.023s        1260 steps            54176/s
  scale_build   n=200  t=10yr  504K bars                  0.004s        2520 steps           688410/s
  scale_backtest n=200  t=10yr  10000 trades              0.052s        2520 steps            48159/s  +0 MB
  scale_build   n=200  t=20yr  1008K bars                 0.011s        5040 steps           479921/s
  scale_backtest n=200  t=20yr  20200 trades              0.116s        5040 steps            43363/s  +43 MB
  scale_build   n=200  t=40yr  2016K bars                 0.021s       10080 steps           478883/s  +8 MB
  scale_backtest n=200  t=40yr  40400 trades              0.238s       10080 steps            42391/s  +128 MB
  scale_build   n=500  t= 5yr  630K bars                  0.005s        1260 steps           260653/s  +0 MB
  scale_backtest n=500  t= 5yr  12500 trades              0.084s        1260 steps            14968/s
  scale_build   n=500  t=10yr  1260K bars                 0.010s        2520 steps           254356/s
  scale_backtest n=500  t=10yr  25000 trades              0.173s        2520 steps            14558/s  +28 MB
  scale_build   n=500  t=20yr  2520K bars                 0.024s        5040 steps           209821/s  +0 MB
  scale_backtest n=500  t=20yr  50500 trades              0.373s        5040 steps            13518/s  +152 MB
  scale_build   n=500  t=40yr  5040K bars                 0.049s       10080 steps           206319/s  +25 MB
  scale_backtest n=500  t=40yr  101000 trades             0.744s       10080 steps            13548/s  +305 MB

-- B9  EXTREME CAPACITY — 10k tickers × 20yr (50M bars, no threshold) 
  Generating 10000 tickers × 5040 bars = 50400000 total bars...
  gen:      2.351s  +2636 MB  (50400000 bars)
  build:    0.462s  +401 MB  (5040 steps  10905 steps/s)
  orders:   0.102s  500000 orders across 50 steps
  backtest: 16.647s  +937 MB  (5040 steps  303 steps/s  250000 trades)
  extreme_capacity  n=10k  t=20yr  50M bars              16.647s        5040 steps              303/s  +937 MB

-- B10  REALISTIC PORTFOLIO BREADTH + TP/SL BRACKETS  (no thresholds) --

  ┌─  10k × 5yr   US equity universe ─────────────────────────────────────
  │  10000 tickers × 1260 bars = 12M bars  (~0.6 GB bar data)
  │  gen:        0.533s  +76 MB
  │  build:      0.106s  +5 MB  (1260 steps  11896 steps/s)
  │  orders:     0.044s  240000 orders  (TP/SL brackets)
  │  backtest:   7.188s  +107 MB  (175 steps/s  240000 trades)
  └────────────────────────────────────────────────────────────
  b10_ 10k × 5yr   US equity universe                    7.188s        1260 steps              175/s

  ┌─  10k × 20yr  US equity universe, full depth ─────────────────────────────────────
  │  10000 tickers × 5040 bars = 50M bars  (~2.3 GB bar data)
  │  gen:        2.084s  +52 MB
  │  build:      0.393s  +0 MB  (5040 steps  12823 steps/s)
  │  orders:     0.208s  990000 orders  (TP/SL brackets)
  │  backtest:  29.111s  +1049 MB  (173 steps/s  990000 trades)
  └────────────────────────────────────────────────────────────
  b10_ 10k × 20yr  US equity universe, full depth       29.111s        5040 steps              173/s

-- BOTTLENECK SUMMARY --------------------------------------------------
  All metrics above threshold — no bottlenecks detected.

