bench: add a cost workload and a multi-asset one, and go to three repetitions (#10)

Two gaps a reader could name without running anything: costs appeared on one
workload out of four, and nothing in the suite was a portfolio.

Costs could not simply be switched on across the board, and the reason is
measured. On FractionOfEquity sizing a 5 bps fee puts the engines 1.3e-4 of
capital apart and 2 bps of slippage 2.1e-5, against a 1e-9 tolerance, while the
round-trip counts stay identical: the trading agrees, the cost arithmetic does
not, because one charges the fee on top of the notional and the other reserves
it out of cash first. In fixed units both land exactly, to 1e-15. So
`sma_cross_costs` carries a fee and slippage on the headline signal, sized in
units, and the price of that is visible rather than hidden: x48.0 against x50.6
at 100k bars.

`multi_asset` runs five independent series in one shared book. It is the
workload manifoldbt does worst on, and it is here for that reason: going from
one asset to five costs it 6.1x and vectorbt 1.4x, so the ratio falls from x36.7
to x8.8 at a million bars. Broadcasting a column per asset is close to free;
walking five books is not. A portfolio is also what people actually run, and a
suite that only measures where it wins is not evidence.

Both are capped where a materialised five-column simulation would stop measuring
the engine and start measuring the swap file, and `ema_rsi_fees` keeps the
ceiling it got for going bankrupt.

Repetitions go from two to three: the floor at which a median is a median rather
than the mean of two.
This commit is contained in:
Exocet92
2026-08-20 18:45:05 +02:00
committed by GitHub
parent 9ddefc64df
commit 6cae686283
6 changed files with 203 additions and 25 deletions
+8 -8
View File
@@ -19,14 +19,14 @@ on:
reps:
description: "Interleaved repetitions per point"
required: false
# 2, not 7. The budget went into a longer series instead: at 10M bars
# one vectorbt call costs 99 s, so seven of them would put the job past
# its timeout on Windows. Two repetitions still bracket the number (min,
# median and max are all published, and the median of two is their mean)
# but the noise flag gets cruder, since an interquartile range wants at
# least four samples to mean anything. A point that looks surprising is
# worth re-running at a higher `reps` before it is quoted anywhere.
default: "2"
# 3, not 7. The budget went into a longer series and two more
# workloads instead: at 10M bars one vectorbt call costs 99 s, so seven
# of them would put the job past its timeout. Three is the floor at
# which a median is a median rather than the mean of two, though an
# interquartile range still wants four samples to mean anything, so the
# noise flag stays coarse. A point that looks surprising is worth
# re-running at a higher `reps` before it is quoted anywhere.
default: "3"
release:
types: [published]
schedule: