cascade-parallel-flow-v4
A cascade (SN91) data generator: parallel-prefetched, spectral, full-context.
Design
- Every series is exactly 4096 points (= 128 × 32-point patches): the
trainer's bucketed batching never fragments, no emitted point is billed to
the token budget and then truncated (
L mod 32is discarded byiter_training_batches), and GPU step overhead per point is minimal. - Any prefix is a fair sample.
stream_cpumode consumes only a prefix of the stream (the trainer stops at the token budget — a few percent of the series it asks for). Family is drawn per row inside each 2048-row chunk from a seeded categorical, so the consumed prefix always carries the full mixture. - Chunks are pure functions of their index. Each chunk seeds its own RNG
from
SeedSequence((seed, chunk_index)). That makes construction order-independent, so several worker threads ("workers"in config.json, default 3) build chunks concurrently — NumPy releases the GIL — while the consumer emits strictly in index order. Thread timing can change when a value is computed, never what it is. - A prefix curriculum ships disabled (
curriculum.enabled: false): an isolated A/B measured easy-to-hard scheduling ~4pp worse than serving the full prior from step 0. The machinery stays for future experiments; the schedule is budget-relative (reads the round budget out of the trainer'sn_seriesconvention), so it scales correctly from heat to final if re-enabled. - Eleven families, weighted toward the cadence-locked flow/demand shapes
that dominate daily-or-faster real feeds:
flow(asymmetric AM/PM peaks, near-zero night troughs, weekend factors, capacity saturation, count-like observation),seasonal(trend × multi-cadence × coloured residual, with slow amplitude/phase modulation), spectralgp/arma/longmem(stationary kernels, rational ARMA spectra, power-law memory — all one batchedirfft, no Cholesky, no per-row Python recursions),regime(piecewise level/slope/variance + shock recovery),volatility(stochastic vol, heavy tails),counts(overdispersed seasonal Poisson with decaying bursts),intermittent,shape,chaotic. - Measurement artifacts on a sparse minority of rows: reversal, censoring, quantization, zero-order hold — bridging clean priors to real pipelines.
Determinism
The corpus is a pure function of (seed, n_series). All randomness derives
from np.random.SeedSequence; no hash(), no clock, no global RNG, no torch.
Verified byte-identical across processes at differing PYTHONHASHSEED (the
failure mode in-process double-build checks cannot see).
Validate
cascade verify . --chain-toml <repo>/chain.toml
python -m pytest tests -q