Unified Cross-Mode Block-EOF Predictive Control
Spatio-temporal Block-EOF with ZOH ridge, extended/regime Grams, wind prior & FX-DM.
Overview & Role
Learns coupled cross-mode spatio-temporal predictors (B modes x P lags) inside cacaopc-mkEOFPF and applies them with zero changes to applyEOFPF. Unpriored high-order blocks automatically stay on diagonal AR bootstrap until avail_samples >= eof_req, preventing underdetermined (N < D) cross-mode overfitting.
Combines five composable extensions: EOF/ZOH (ZOH-centered ridge, recommended ON for Stage 1 and OFF for Stage-2 high-pass residuals), EOF/MEM (exponentially forgotten chunk Gram beyond NBtrain), EOF/REG (multi-anchor regime-weighted Gram library), EOF/WIND (windlayers Fourier-space physics-Gram Bayesian prior + automatic wind-switch rescue), and EOF/FX (Pass-2 Filtered-X DM plant for unshaped ringing DMs).
Compute Units / Entry Points: cacao-fpsexec-cacaopc-mkEOFPFcacao-fpsexec-cacaopc-applyEOFPFeoflin_phys.c
Verified Highlights:
- Real AO3k cold start -3,070% -> +69.9% VR; live +60 deg wind switch: 6.16x lower Stg1 WFE (8.3x post-switch); FX cuts ringing Q_vw 26.4x
- Faint-star m=10 live GPU WFS rate reduction (1000 -> 250 Hz): Stage-1 H-band Strehl climbs 68.2% -> 80.2% (80.4% with Multi-Rate DM) vs best integrator 50.7% @ 500 Hz
- Operates strictly in the fixed outer modal basis; serves as the mandatory linear anchor for Cascaded Online Self-Learning (SELFLEARN) and Multi-Rate DM Pacing (MRDM)
Option Variants (CODE/OPT)
| Option Code | Behavior & Usage | Main Flags |
|---|---|---|
EOF/BASE | Standard sliding-window Block-EOF (`--pf-mode eof --pf-blocksize 64`). | --predictive --pf-mode --pf-blocksize --pf-order --pf-reg |
EOF/ZOH | ZOH-centered ridge toward `[I; 0; ...]` preventing DC-gain collapse (Stg1 ON, Stg2 OFF). | --pf-zoh-ridge --pf-zoh-ridge2 |
EOF/MEM | Extended-memory chunk-Gram accumulator remembering beyond rolling `NBtrain`. | --pf-gram-halflife |
EOF/REG | Multi-anchor (`K <= 16`) regime-weighted Gram library with similarity floor kappa. | --pf-regime-kmax |
EOF/WIND | `windlayers` Fourier physics-Gram prior + instant wind-switch empirical Gram decay. | --windlayers1 --pf-dmmodes1 --pf-n-prior --pf-wl-switch-decay |
EOF/FX | Pass-2 Filtered-X regressor convolution through `H_eff` for unshaped ringing DMs. | --pf-fx1 --pf-fx2 |
Dependencies & Calibration Chain
CLI Flags, Environment Variables & FPS Parameters
| Layer | Option (Links to Reference) | Default | Description |
|---|---|---|---|
| CLI Flag | --predictive | OFF | Enable PSOL predictive control on Stage 1 (AO3k) and Stage 2 (SCExAO) |
| CLI Flag | --pf-mode | ar | Predictive filter architecture: ar (diagonal) or eof (block cross-mode) |
| CLI Flag | --pf-blocksize | 128 | Cross-mode Block-EOF coupled mode block size B |
| CLI Flag | --pf-order | 8 | Predictive filter temporal lookback tap order P |
| CLI Flag | --pf-reg | 0.005 | Stage-1 / default Tikhonov ridge regularization parameter lambda |
| CLI Flag | --pf-reg2 | matches --pf-reg | Optional Stage-2 SCExAO Tikhonov regularization lambda override |
| CLI Flag | --pf-maxnorm2 | — | Optional per-row ||F_m||_2^2 noise amplification cap override |
| CLI Flag | --pf-zoh-ridge | — | Stage-1 mkEOFPF ZOH-centered ridge regularization toggle (ON/OFF) |
| CLI Flag | --pf-zoh-ridge2 | — | Stage-2 mkEOFPF ZOH-centered ridge regularization toggle (ON/OFF) |
| CLI Flag | --pf-gram-halflife | 0 | Stage-1 extended-memory chunk-Gram exponential half-life [frames] (0=sliding; 60000 in DEFAULT) |
| CLI Flag | --pf-regime-kmax | 0 | Regime-weighted Gram library max cluster anchor count K (0=off, <=16; 8 in DEFAULT) |
| CLI Flag | --pf-fx1 | — | Stage-1 Pass-2 Filtered-X EOF DM impulse kernel FITS |
| CLI Flag | --pf-fx2 | — | Stage-2 Pass-2 Filtered-X EOF DM impulse kernel FITS |
| CLI Flag | --pf-dmmodes1 | — | Stage-1 DM modal basis FITS cube for windlayers Fourier physics Gram |
| CLI Flag | --pf-n-prior | 1024 | Equivalent sample weight N_prior for Stage-1 windlayers physics Gram |
| CLI Flag | --pf-wl-switch-decay | 0.20 | Empirical Gram decay multiplier applied upon windlayers switch trigger |
| CACAO_* Env | CACAO_PF_BLOCKSIZE | 128 | Block-EOF coupled modal block size B |
| CACAO_* Env | CACAO_PF_ZOH_RIDGE | (unset) | mkEOFPF ZOH-centered ridge regularization toggle (ON/OFF) |
| CACAO_* Env | CACAO_PF_GRAM_HALFLIFE | 0 | Extended-memory chunk-Gram exponential half-life [frames] (0=sliding) |
| CACAO_* Env | CACAO_PF_DM_KERNEL | (unset) | Pass-2 Filtered-X EOF DM impulse kernel FITS (H_diag / H_mimo) |
| CACAO_* Env | CACAO_PF_WL_LAYERS | (unset) | Live mlt-windlayers layer SHM stream consumed by mkEOFPF physics Gram |
| CACAO_* Env | CACAO_PF_DMMODES | (unset) | DM modal basis cube FITS for mkEOFPF Fourier-space physics Gram |
| CACAO_* Env | CACAO_PF_N_PRIOR | 1024.0 | Equivalent sample weight N_prior for windlayers physics-Gram prior |
| CACAO_* Env | CACAO_PF_WL_SWITCH_DECAY | 0.20 | Empirical Gram decay multiplier upon windlayers switch trigger |
| CACAO_* Env | CACAO_PF_REGIME_KMAX | 0 | Regime-weighted Gram library max anchor count K (0=off, <=16) |
| CACAO_* Env | CACAO_PF_REGIME_KAPPA | 0.10 | Regime-weighted Gram similarity blending floor kappa |
| CACAO_* Env | CACAO_PF_REGIME_BW | 3.0 | Regime-weighted Gram Gaussian kernel bandwidth |
| CACAO_* Env | CACAO_PF_REGIME_RLIM | 4.0 | Regime-weighted Gram leader-clustering new-anchor radius threshold |
| CACAO_* Env | CACAO_PF_DIFF_NMODE | 0 | Leading modes solved in temporal-difference EOF space (0=off) |
| CACAO_* Env | CACAO_PF_DIFF_ORDER | 0 | Difference-space EOF lookback tap order (0=diagorder, 2..64) |
| CACAO_* Env | CACAO_PF_DIFF_REG | 0.05 | Difference-space EOF relative Tikhonov lambda |
| CACAO_* Env | CACAO_PF_DIFF_MAXDCGAIN | 0.9995 | Difference-space EOF exact self-DC gain (0.9..0.99995) |
| FPS (cacao) | mkEOFPF.PForder | 8 | EOF lookback tap order (1..64) |
| FPS (cacao) | mkEOFPF.diagorder | 16 | bootstrap diag AR order (1..64) |
| FPS (cacao) | mkEOFPF.blocksize | 128 | coupled mode block size B (1..512) |
| FPS (cacao) | mkEOFPF.PFlatency | 2.4 | prediction horizon [frames] |
| FPS (cacao) | mkEOFPF.NBtrain | 16384 | sliding PSOL training window [frames] |
| FPS (cacao) | mkEOFPF.minsamples | 12000 | min frames for cross-mode EOF |
| FPS (cacao) | mkEOFPF.reglambda | 1.0e-4 | EOF relative Tikhonov lambda |
| FPS (cacao) | mkEOFPF.zoh_ridge | ON | center ridge toward ZOH identity map (vs zero) |
| FPS (cacao) | mkEOFPF.gram_halflife | 0.0 | extended-memory Gram half-life [frames] (0=sliding NBtrain) |
| FPS (cacao) | mkEOFPF.n_prior | 1024.0 | windlayers physics-Gram prior sample weight (0=off) |
| FPS (cacao) | mkEOFPF.wl_switch_decay | 0.25 | empirical Gram discount on wind switch (0..1) |
| FPS (cacao) | mkEOFPF.regime_kmax | 0 | max regime Gram library anchors (0=off, 2..16=on) |
| FPS (cacao) | mkEOFPF.dm_kernel | — | optional Pass-2 H_diag/H_mimo FITS for Filtered-X EOF |
| FPS (cacao) | mkEOFPF.diff_nmode | 0 | leading modes solved in temporal-difference space (0=off) |
| FPS (cacao) | mkEOFPF.out.var_red_oos_pct | 0.0 | out-of-sample variance reduction vs ZOH [%] |
| FPS (cacao) | mkEOFPF.out.overfit_ratio | 0.0 | OOS/in-sample predicted RMS ratio |
| FPS (cacao) | applyEOFPF.nthreads | 4 | OpenMP threads across blocks |
Implementation, Tests & Related Reports
Source Files
- cacao:
AOloopControl_PredictiveControl/AOloopControl_PredictiveControl_mkEOFPF.c - cacao:
AOloopControl_PredictiveControl/eoflin_phys.c - cacao:
AOloopControl_PredictiveControl/AOloopControl_PredictiveControl_applyEOFPF.c
Verification Tests
test_15_unified_eof_windlayers.pytest_18_multirate_dm.pyao3k_phases1to5_bench.py
Related Staged Technical Reports
- Unified AO Real-Time Control Architecture: Taxonomy, Decoupled Synthesis, White-Noise Safety & Faint-Star Multi-Rate DM Control
- Implementation Plan: Unified AO Real-Time Control Architecture (milk, cacao, milk-mltools)
- Predictive Control Report: Per-Mode Diagonal AR(4..64) & Full Cross-Mode Block-EOF (VAR) Study