06-reference/research

autoinv cpcv vs walk forward confirm stage

2026-07-05·research-brief·source: deep-research
cpcvwalk-forwarddeflated-sharpepbobacktest-validation

Two CV regimes, not one: the autoinv confirm stage carries both anchored walk-forward and CPCV

The question

Should the autoinv confirm stage run CPCV in addition to anchored walk-forward, or instead of it? (v0 wants both — walk-forward for the time-ordered view, CPCV for the distribution feeding DSR/PBO.) This resolves open-follow-up #3 from the 2026-06-26 discovery-loop-architecture brief: confirm the Phase-2 build carries two cross-validation regimes rather than collapsing to one.

What we already know (from the vault)

What the web says

Convergences and contradictions

Synthesis for RDCO

Recommendation: carry BOTH regimes in the confirm stage. This is not a hedge — each answers a question the other structurally cannot, and dropping either removes a distinct guarantee. v0's instinct is correct and should be locked. The 2026-06-01 build sketch already had it right: CPCV is added alongside walk-forward in validation.py, not in place of it.

What anchored walk-forward buys, and what is lost if you drop it. WF produces the single time-ordered equity path — the honest "what would actually have happened if we deployed this and retrained forward." Because it only ever trains on the past, it is the only regime that respects live-deployment causality, and it is the only one that preserves path-dependent metrics: max drawdown, drawdown duration, sequence-of-returns risk, realistic compounding, and (in the event-driven autoinv engine) realistic maker-limit fills, slippage, and after-tax/wash-sale net returns. A CPCV path is a reassembled chronology whose training used future blocks, so its drawdown sequence is a statistical artifact, not a deployable history. Drop WF and you lose deployment-realism and every path-dependent risk number — the exact realism the vectorbt→autoinv two-engine split exists to buy. WF also carries the inherited v2 discipline (leave-one-out by stress episode, bootstrap CIs, the future-leak mutation test) that must not regress.

What CPCV buys, and what is lost if you drop it. CPCV produces a distribution of OOS Sharpes across φ[N,k] reassembled paths (N=6,k=2 → 5 paths is the canonical default). That distribution is the only statistically valid input to the two multiple-testing gates: DSR needs V[SR_n] (the cross-sectional variance of trial Sharpes) and an effective-N, and PBO/CSCV needs many near-independent partitions to ask "does the in-sample winner fall below median OOS." A single walk-forward path is one number — it cannot furnish a variance, an effective-N, or a rank distribution, so it mathematically cannot feed DSR or PBO honestly. Drop CPCV and GATE-1/GATE-2 either become non-computable or fall back to the counted grid-cell N, which under-deflates because dense grid cells are correlated (v0's own red-team flag, and the canon's "effective N, not literal N"). CPCV is precisely the mitigation for that under-deflation: its near-independent path Sharpes are a cleaner V[SR_n] and effective-N than any grid-cell count.

Concrete build guidance for validation.py (Phase-2). Two coexisting functions, feeding different consumers. (1) The anchored walk-forward path (extend/keep the existing TimeSeriesSplit-based timeseries_cv into the anchored, cycle-aligned form the v2 harness specs) produces the single reported equity curve and all path-dependent metrics (drawdown, duration, sequence risk, after-cost/after-tax net return) plus the leave-one-out-by-episode table and bootstrap CIs. (2) combinatorial_purged_cv(n_obs, label_spans, n_groups=6, k_test=2, embargo_frac=0.01) produces the CPCV path matrix; deflated_sharpe(...) and probability_of_backtest_overfitting(...) consume the per-path Sharpe distribution off that matrix — this is what feeds GATE-1 (DSR) and GATE-2 (PBO). Pre-register that GATE-1's effective-N and V[SR_n] come from CPCV path Sharpes, not the cumulative grid-cell counter (open-follow-up #1 from the 2026-06-26 brief — resolve before coding). Both regimes run inside the event-driven autoinv confirm stage on candidates that already cleared the vectorbt sweep + GATE-0 economic prior; a candidate must pass the CPCV-fed DSR/PBO gates AND show an acceptable walk-forward equity path AND beat both buy-and-hold benchmarks before it earns its single sealed-holdout touch. Keep the capital-cycle book off this stack entirely — it stays on the v2 leave-one-out harness with integer-precision Sharpe.

Open follow-ups

Related

Sources

Vault:

Web: