Bootstrap net R through the process pipeline #259
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
std::monte_carloconsumes the gross realized-R series even when the campaign carries a cost model, so a costed campaign cannot produce a net pooled-OOS distribution — the natural headline for any gross-to-net question.Evidence (external data-only research project, 2026-07-13, engine
84e1075): the same 18-point H1-breakout matrix ran twice on EURUSD 2018-2026 (seed 0, regime vol{3, k2.0}) — once with no cost block, once withcost: [{"constant":{"cost_per_trade":0.00012}},{"vol_slippage":{"slip_vol_mult":0.1}}]. The two runs'pooled_oosstage records are identical to every printed digit (mean −0.1498 / −0.2040, prob_le_zero 0.884 / 0.988 for the two strategy cells), while the same members' full-windownet_expectancy_rmoves by −0.61 to −0.67 R/trade against gross. The cost model is applied and stamped (cost[k].<knob>manifest params) but the walk-forward → monte-carlo evidence chain never sees it.net_expectancy_ris already rankable/gate/generalize-able; the bootstrap stage has no analogous net path. A net-R series throughstd::walk_forwardOOS pooling (or anet: trueknob onstd::monte_carlo) would close the gap.Design reconciliation (specify)
Spec: net-r-bootstrap. The issue body leaves the mechanism open ("a net-R series through std::walk_forward OOS pooling, or a net: true knob on std::monte_carlo"); this records the resolution of the three load-bearing forks. All three are derived orchestrator decisions (recorded 2026-07-13), not user picks.
RMetrics.trade_rsbecomesRMetrics.net_trade_rs, carrying the cost-netted realised R per trade (r − cost_in_r, trade order), still#[serde(skip)]and excluded fromPartialEq.Basis: derived — the conduit exists solely to feed the OOS R-series bootstrap (its own doc comment,
crates/aura-analysis/src/lib.rs:103), and the issue is precisely the demand that this feed be net; with an empty cost stream every trade's cost is exactly0.0(summarize_r's documented gross-R baseline,lib.rs:188), sor − 0.0is bit-identical to the gross series and uncosted campaigns are byte-unchanged; the design ledger already anticipates the per-trade net-R sequence as the durable artifact (docs/design/INDEX.md:585-588: the cost model is "a feed-forward subtraction on the R stream", compounding derives from "the per-trade net-R sequence"). The rename (rather than a silent meaning change under the old name) makes every consumer compiler-enumerated.summarize_rexposes the series without disturbing its scalar contract → the net series is materialized as a new, separate expression; every existing pinned-float expression (net_sum, the SQN pair, the lockstep-coupled copies inr_metrics_from_rs) keeps its tokens verbatim.Basis: derived — the file's own byte-pin discipline (
lib.rs:266"kept bit-identical to the pre-0067 expression";lib.rs:318-329lockstep-coupling doc) forbids refactoring pinned float arithmetic; a sibling materialization adds the series without shifting any existing metric by a ULP. The wire shape is untouched (serde(skip)).std::monte_carloselects gross vs net → no knob. Both bootstrap arms (pooled-OOS and per-survivor) read the single net conduit; net-when-costed is automatic and uncosted campaigns degenerate to today's gross bootstrap bit-exactly.Basis: derived — an explicit
net: trueknob would let a costed campaign silently produce a gross headline again, which is the exact misreading the issue documents; the uncosted bit-equality makes the automatic choice free of behaviour change; and no vocabulary/schema change means preflight,StageBlock, andStageRealization/StageBootstrapback-compat are untouched.Consequence recorded for the same reason: the pooled walk-forward OOS reduction (
pooled_trade_rs→r_metrics_from_rs) thereby reduces the net series, so a costed campaign's pooled-OOS stage record (mean, prob_le_zero, deflation inputs) becomes net-based — the issue's requested headline — while every per-member gross metric (expectancy_retc.) stays gross.Design reconciliation, addendum (specify)
Spec: net-r-bootstrap. The grounding gate rejected the first draft for an incomplete consumer enumeration: the bootstrap conduit has two further production consumer families beyond the two monte-carlo arms recorded in
issues/259#issuecomment-3526. Both are now scoped in; the fork decisions (derived, recorded 2026-07-13):member_trade_rs→ the centrednull_best_of_kbehindoverfit_probability) follows the conduit and becomes net-based for costed campaigns.Basis: derived — today a costed campaign that selects on
net_expectancy_rcompares a net observed statistic against a gross-resampled null, because the null's metric recomputation mapsNetExpectancyRonto the plain mean of whatever series it is fed (aura-registry/src/lib.rs:513-524); a single net conduit puts observed and null on one basis, removing that inconsistency, and uncosted campaigns stay bit-identical (cost 0.0). Keeping the null gross would require a second, gross conduit whose only purpose is preserving an apples-to-oranges comparison.oos_rrecord basis → the standalone walk-forward summary's pooled OOS reduction (pooled_oos_trade_rs,aura-cli/src/main.rs:878-891, plus the reports-pooling sibling atmain.rs:955-957) follows the conduit and becomes net-based for costed runs.Basis: derived — this is the issue's literal ask ("a net-R series through std::walk_forward OOS pooling"), and the helper's own doc declares it "the single home of the pooling-in-roll-order semantics — both the walk-forward
oos_rsummary and themcR-bootstrap reduce this": summary and bootstrap must stay on one basis or the single-home invariant is broken.Boundary restated precisely: per-member
RMetricsscalar fields stay gross (net_expectancy_rkeeps its meaning); every conduit-derived artifact — pooled-OOS bootstrap, per-survivor bootstrap, walk-forwardoos_r, deflation null — is net-when-costed. No consumer reads the conduit and stays gross.Spec auto-signed (specify Step 6, autonomous run)
Spec: net-r-bootstrap (net-of-cost R through the walk-forward → monte-carlo evidence chain: one net conduit feeding the pooled-OOS / per-survivor bootstraps, the walk-forward
oos_rrecord, and the deflation null; uncosted runs bit-identical).The signature is the Step-5 grounding-check
PASS— an independent fresh-context agent's verdict; eight load-bearing assumption clusters each ratified against currently-green tests (report in the session transcript). No human signed; the fork decisions live atissues/259#issuecomment-3526andissues/259#issuecomment-3528. Status: design settled, spec signed — proceeding to implementation planning.Design reconciliation, planning-stage addendum (specify/planner)
Spec: net-r-bootstrap. Two decisions derived while decomposing the plan (recorded 2026-07-13); both are testing-channel calls, not semantic changes to the forks in
issues/259#issuecomment-3526/issues/259#issuecomment-3528.Basis: derived — an evidence-chain guard that skips on data-less hosts protects nothing exactly where the suite runs most; the synthetic archive's ~8 contiguous months support the existing 14d/7d/7d walk-forward roller arithmetic (verified during recon), and hostless synthetic fixtures are the direction the suite-wallclock work already ratified.
oos_robservation channel → none exists today, deliberately: the dissolved walkforward/mc sugar binds an empty cost list unconditionally, so no cost-bearing walk-forward summary can be invoked. Theoos_r/deflation sites' net basis is therefore covered by the compile-forced single-conduit construction plus their uncosted exact-float pins staying green (bit-exact degeneracy), and the spec's testing section states this instead of prescribing an unimplementable assertion. Making the sugar cost-bearing is recorded as a non-goal (verbs stay cost-less sugar; costed research goes through campaign documents).Re-attestation: the testing-channel amendments recorded in
issues/259#issuecomment-3530were re-run through the grounding gate on the final spec bytes — PASS (9 ratified assumption clusters, incl. the three new ones: sugar binds an empty cost list; the synthetic archive supports the 14d/7d/7d roller hostlessly; the uncosted exact-float oos_r pins exist and are green). The signature ofissues/259#issuecomment-3529stands on the amended spec.