# 02 — Technique proposals, round 2 (target: AASD Acc +9)

Author: technique-designer, 2026-11-07. No training run. Only label-statistics and frozen-evidence diagnostics
(CPU, reading existing pickles/checkpoints) were computed. No file outside `experiments/multi_agent_opt/` was changed.
Machine-readable copy: `02_technique_proposals_r2.json`.

Inputs read: `00_inventory.json` (79 forbidden), `BOARD.md`, `FINAL_REPORT.md`, `01_technique_proposals.*`,
AASD converter, frozen SW2 evidence `results/research/ext_clf_{AASD,Carta2026}_w10b3sw2P_evidence_s{0..3}.pkl`,
`R/results/research/adapt_within_trial.csv`, SW2 checkpoints.

Closed before this round: T1 lag-bank (peak 0 ms), T2 ESR-stem (LODO 0.749/71.9, AASD 50.7, Carta 50.3),
T3 CF-Null (LODO 0.788/71.7, AASD 52.4, Carta 58.6), V-REx variants (AASD ~51, Carta ~48).
Honest reference: LODO 0.7981/73.30. Tip: AASD Acc 54.05, Carta Acc 60.60.

---

## 0. TL;DR

1. **AASD is a fast-switching set.** Trials are 58 s long. Real key-press switches give a median dwell of **8.9 s**
   (p10 3.8 s, 19 % of segments < 5 s). Carta's median dwell is 25 s. Training LODO schedules use 30–90 s.
2. **The two levers, measured on frozen SW2 evidence:**
   - *Latency.* Even with an oracle 3-s latency cut at today's evidence quality, AASD only reaches ~56 % (+2). Latency
     alone cannot deliver +9.
   - *Evidence quality (d′).* Steady-state 10-s accuracy on AASD is **0.59–0.60** (≥ 8 s after a switch). Carta is
     0.63–0.64 and in-domain held-out datasets are 0.69–0.78 (acc10).
3. **Requirement.** A label-driven simulation, calibrated on today's AASD (it predicts 54.8 vs the observed 54.05), says
   AASD Acc > 63 needs a **steady 10-s-equivalent accuracy ≈ 0.78 on AASD**, read out with ~2-s integration and a
   fast HMM. That is the DTU in-domain level, and about 3× today's AASD d′.
4. **Assessment.** No single technique below is projected to reach +9. Realistic combined range: **+2…+5 Acc on AASD**.
   I put the chance of hitting AASD > 63 this round at < 10 %. The proposals attack d′ first (subject/presentation
   shift) and add a fast read-out only as a multiplier.
5. **Top-3 implementable now:** **R2-1 MM-TTA** (label-free match–mismatch test-time adapter), **R2-2 SAA**
   (stimulus-anchored spatial alignment), **R2-3 PAD** (presentation-aware dominance input). All three share one cheap,
   label-free gate (**D0**) that decides whether AASD's deficit is a recording/subject shift, which can be fixed, or a
   task-level attention ceiling, which cannot.

---

## 1. Evidence behind the ranking (new this round)

### 1.1 AASD switch statistics (labels only, no model)

| | AASD | Carta2026 |
|---|---:|---:|
| trial length (median) | 58 s | 173 s |
| dwell median / mean / p10 / p90 | 8.9 / 9.7 / 3.8 / 16.4 s | 25.0 / 24.7 / 13.0 / 37.0 s |
| segments shorter than 5 s | 19 % | 0 % |

Oracle detector (true labels delayed by d seconds), Acc %:

| d (s) | 0 | 1 | 2 | 3 | 4 | 5 | 7 | 10 |
|---|---:|---:|---:|---:|---:|---:|---:|---:|
| AASD | 100 | 91.5 | 83.1 | 75.1 | 67.6 | **61.1** | 51.8 | 45.4 |
| Carta | 100 | 96.5 | 93.1 | 89.6 | 86.1 | 82.7 | 75.7 | 65.4 |

So on AASD, **any system with an effective latency ≥ 5 s cannot exceed ~61 % even with perfect evidence.**

### 1.2 Frozen SW2 4-seed evidence, AASD (sign of mean r0−r1, 4 Hz frames)

| time since last switch | 0–1 | 1–2 | 2–3 | 3–4 | 4–5 | 5–6 | 6–8 | 8–10 | 10–15 s |
|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| AASD acc | 0.44 | 0.46 | 0.49 | 0.51 | 0.52 | 0.53 | 0.57 | 0.59 | 0.60 |
| Carta acc | 0.38 | 0.41 | 0.45 | 0.46 | 0.51 | 0.55 | 0.58 | 0.63 | 0.64 |

- Evidence crosses chance about 3.5 s after a switch. The learned pooling `tw` is almost flat: its centroid sits
  4.4–4.7 s before the window end, mass in the last 2 s is 0.25 (all 4 all5 seeds).
- Position in trial is not the problem. AASD accuracy is flat at 0.52–0.58 across 0–60 s, so warm-up and EA are fine.
- No subject is label-inverted. Steady accuracy per subject ranges 0.49 (S14) to 0.68 (S11); S03–S05 and S14 are at
  chance. This is low SNR spread across subjects, not a key-mapping bug.
- Envelopes are clean and dichotic (L/R envelope correlation 0.000). The reverse-engineered envelope matches the
  organiser envelope at r 0.988. Envelope extraction is ruled out.

### 1.3 Latency-cut oracle (evidence read L s ahead, today's quality)

| L (s) | 0 | 1 | 2 | 3 | 4 |
|---|---:|---:|---:|---:|---:|
| AASD raw / HMM Acc | 53.8 / 53.0 | 54.9 / 54.1 | 55.7 / 55.1 | 55.9 / 55.7 | 55.8 / 55.9 |
| Carta raw / HMM Acc | 59.8 / 59.2 | 60.7 / 60.2 | 61.3 / 61.2 | 61.8 / 61.8 | 62.1 / 62.3 |

### 1.4 Required evidence quality (simulation on the real AASD label sequences)

Linear evidence model: per-frame mean μ, unit noise, causal window W, 2-state HMM, best (W, p_stay) per row. This is
an optimistic upper bound because it picks the read-out using AASD labels; it is a feasibility map, not a method.

| steady 10-s acc on AASD | 0.60 (today) | 0.65 | 0.70 | 0.75 | 0.80 | 0.85 |
|---|---:|---:|---:|---:|---:|---:|
| 10-s raw sign Acc | 53.2 | 55.1 | 56.1 | 56.8 | 60.0 | 61.5 |
| best fast read-out Acc (W, p_stay) | 54.8 (3 s, 0.90) | 57.3 (2 s) | 59.5 (2 s) | 62.0 (2 s) | **64.5** (2 s) | 66.9 (2 s) |

### 1.5 Within-trial linear adaptation is data-starved (existing result, `R/results/research/adapt_within_trial.csv`)

Even with **oracle attention labels**, a within-trial linear backward decoder reaches only 0.59–0.62 accuracy after
≥ 3 min of a trial and adds at most +0.009 H in LODO. AASD trials are 58 s. This kills any per-trial *linear* decoder
(label-free mixture decoder, forward-TRF likelihood ratio). Those ideas are listed in §4 as rejected. A useful per-trial
adaptation must (a) use a label-free signal much stronger than attention, and (b) adapt very few parameters of a strong
nonlinear model. R2-1 and R2-2 are designed that way.

### 1.6 Hard constraints carried into every proposal

- Organiser train/test format is **1–9 Hz, 32 Hz** (PRE-01). Alpha/gamma views are impossible on the test set.
- **No raw audio** exists for the 5 training corpora (only envelopes in `data/cnd`), so speech-model (wav2vec/Whisper)
  stimulus features cannot be trained.
- No real switches exist in any training corpus. Real-switch data in training was already tried (TRN-12).
- Rules: label at t uses EEG ≤ t+1 s; nothing carried across trials; no dataset/subject/trial ID, column order,
  position in trial or switch schedule. Causal within-trial parameter updates are allowed (Terms 6.3, precedent in
  `R/adapt_within_trial.py`).

---

## 2. Shared gate D0 — label-free "where is the AASD deficit?" (run first, ~20 min GPU, no attention labels)

Use the frozen nets (all5 for AASD/Carta, fold checkpoints for LODO-held datasets). For each trial and both streams
s ∈ {A, B}, compute the **match–mismatch logit** `m_s = f(E, s, s̃)`, where s̃ is the same stream taken from ≥ 8 s
earlier in the same trial (past only). This is exactly the SparrKULee pretraining task. Report the M/M accuracy
P(m_s > 0) for 10-s windows, per dataset and per subject, for A and B pooled. **No attention label is read.**

| D0 outcome | Interpretation | Consequence |
|---|---|---|
| AASD M/M acc ≥ 0.05 below the in-domain mean | EEG tracks stimuli worse on AASD → subject/recording shift | R2-1 / R2-2 have signal to work with → run them |
| AASD M/M acc ≈ in-domain, while attention acc is 0.60 vs 0.75 | Both talkers are tracked but the attention contrast is weak → task-level ceiling (spontaneous switching, split attention) | Front-end fixes cannot reach +9. Run only R2-3 (presentation) and report that the AASD target is infeasible |

Also report the per-subject correlation between M/M accuracy and steady attention accuracy (attention labels read only
as a diagnostic, as T1 did). A high correlation supports the adaptation route.

---

## 3. Candidates (ranked)

| Rank | ID | Technique | Lever | Track | Effort | Expected AASD Acc |
|---:|---|---|---|---|---|---|
| 1 | R2-1 | **MM-TTA**: per-trial, label-free match–mismatch test-time training of a zero-init low-rank EEG spatial adapter on the frozen SW2 nets | d′ (subject shift) | inference + per-trial updates | medium (1 d code, ~2 GPU h) | +0…+3 |
| 2 | R2-2 | **SAA**: stimulus-anchored alignment, a causal per-trial rotation that maps the subject's label-free auditory-response spatial pattern onto the population pattern | d′ (spatial shift of the auditory subspace) | new prep; frozen screen, then retrain | medium-high (screen 0.5 d; retrain ~12 GPU h) | +0…+2 |
| 3 | R2-3 | **PAD**: presentation-aware dominance, so the net is not reliant on masking-based `dom` cues that do not exist under dichotic presentation | d′ (stimulus-view shift) | diag (frozen), then retrain | low diag / medium retrain | +0…+2 |
| 4 | R2-4 | **MC-mask TTA**: test-time ensemble over in-distribution channel/cluster masks (×16) per seed | variance part of d′ | inference-only | low | +0…+0.7 |
| 5 | R2-5 | **SR-Pool + LODO-fast**: training-free short re-pooling of per-position logits plus a fast-dwell LODO scoring track | latency (multiplier) | inference-only | low | +0.5…+1.5 alone; ×1.5–2 on top of a d′ gain |

Acceptance (all candidates): all integrity gates pass, and paired by seed **AASD Acc ≥ +1.0 and AASD H ≥ +0.005,
Carta Acc ≥ −0.3, honest LODO H drop ≤ 0.01**. AASD/Carta attention labels never select hyperparameters.
Selection uses LODO (and LODO-fast for R2-5) only. The user decides keep or drop.

Integrity gates (unchanged from round 1, plus one): column swap `|f(x)+f(−x)| < 1e-5`; position invariance
(prepend 60 s → ≥ 99 % same decisions after 60 s); `leakage_test.py` ≤ 0.969 s; **new**: every per-trial state is
reset at trial start and depends only on a bounded past buffer.

### R2-1 — MM-TTA: match–mismatch test-time adapter (rank 1)

**Hypothesis.** AASD's low plateau (0.60) is partly a subject/recording spatial shift that EA (second-order,
total-covariance) does not fix. The attention label is too weak to adapt on within 58 s (§1.5). The match–mismatch
signal is much stronger, because *both* talkers are tracked. It is label-free and swap-symmetric. The SW2 backbone
was initialised from SparrKULee match–mismatch pretraining, so the objective fits the representation it already has.

**Method.**
- Insert before the backbone, on the EEG only: `E' = E + (E·U)·Vᵀ`, with U, V ∈ ℝ^{58×r} and V zero-init (identity at
  start). Optionally add a diagonal gain `E'·diag(1+g)` with g zero-init. The streams are untouched, so
  `f(E', A, B) = −f(E', B, A)` still holds exactly.
- Every 2 s within a trial, re-fit the adapter **from zero** on a bounded buffer of the last 30 s, with K Adam steps.
  Use only windows whose last sample is ≤ the current decision time + FUT. The state therefore depends only on the
  bounded past, which satisfies the position gate.
- Loss, symmetric in A↔B so it cannot learn the attention label:
  `L = Σ_{s∈{A,B}} softplus(−f(E', s, s̃)) + λ‖UVᵀ‖²_F + λ_g‖g‖²`, with s̃ = s from 8–30 s earlier (past only).
- The attention logit is `f(E', A, B)` with the adapter state from the *previous* update block, so there is no
  in-sample use. One adapter per seed. Reset at every trial.

**Not a repeat of:** TRN-13 (pseudo-label self-training; its objective uses the attention decision), DEC-10
(logit/emission adaptation), TRN-06 (SSL pretraining on training windows), PRE-02/PRE-16 (EA = second-order
alignment), EXT-02 (offline SparrKULee pretraining), r1-T5 (past-envelope references at inference, no parameter
updates).

**Hyperparameters (select on LODO folds only):** r ∈ {0 (diag only), 2, 4}; K ∈ {5, 10}; lr ∈ {3e-3, 1e-2};
λ ∈ {1e-2, 1e-1}; buffer 30 s; first update after 15 s.

**Gates.** D0 must show an AASD M/M deficit. LODO-held acc1 must rise by ≥ +0.5 pt in ≥ 4/5 folds (fold
checkpoints, seed 0 first). Abort if the M/M loss falls but attention acc1 drops (the adapter is learning
stream-generic features only).

**Risk.** 58-s trials give at most ~20 updates. The adapter may improve both-stream tracking without improving the
attended–unattended contrast. GPU cost at inference is about 1.5–2 h for LODO + external.

### R2-2 — SAA: stimulus-anchored alignment (rank 2)

**Hypothesis.** EA whitens the *total* covariance, which non-auditory activity dominates. Across subjects and caps,
the auditory-response spatial pattern rotates (head size, cap placement, NeuroScan vs BioSemi). A causal, label-free
estimate of this pattern is available: the cross-covariance of EEG with the **mixture** envelope A+B, which is
swap-invariant. Aligning that pattern to the population pattern puts the auditory subspace where the classifier
expects it.

**Method.**
- After `eaP_n5_t60`, estimate a causal exponentially-forgotten cross-covariance (τ = 30 s) over lags
  0–375 ms (0–12 samples):
  `P_t = Σ_τ λ^{t−τ} x_τ · [ (A+B)_{τ−ℓ} ]_ℓ` → 58×13. Shrink it toward the population pattern P₀ (fit on training
  corpora with the same estimator, no labels): `P̂ = (n_eff·P_t + κ·P₀)/(n_eff+κ)`.
- Compute the orthogonal Procrustes rotation R_t = argmin ‖R·P̂ − P₀‖ (SVD of P̂·P₀ᵀ). Apply x'_t = R_{t−hop}·x_t,
  i.e. the rotation estimated strictly before the sample.
- R is an orthogonal map on EEG channels only, so oddness in streams is preserved. The state is bounded by τ and
  reset per trial.
- Screen (no training): apply SAA at test time only, to LODO-held trials (fold checkpoints) and to AASD/Carta (all5).
  Training subjects sit near P₀ on average, so this is roughly consistent with the frozen nets.
- If the screen gives LODO acc1 ≥ +0 and the population-pattern similarity rises, build prep `saa_eaP` for all
  corpora and retrain 4 SW2 seeds × (5 folds + all5).

**Not a repeat of:** PRE-02/PRE-16 (EA grid, total covariance), PRE-17 (cross-trial EA, illegal), PTA-02 (DSS/SSD
filter feeding a linear TRF), ARC-09 (learned channel FiLM/graph/SE inside the net), PTA-01 CCA-spatial
(population-fit linear decoder).

**Hyperparameters (LODO only):** τ ∈ {20, 40} s; κ ∈ {10, 30} s-equivalent; lags 0–375 ms; rotation
damping (geodesic step) α ∈ {0.5, 1}.

**Gates.** Label-free first: mean cosine between subject patterns and P₀ must rise on AASD and on LODO-held data.
Then LODO acc1 must not fall in more than 1/5 folds. AASD is read once at the end.

**Risk.** In 58 s the pattern estimate is noisy; κ shrinkage controls this, but the gain may vanish. If D0 shows no
tracking deficit, drop R2-2.

### R2-3 — PAD: presentation-aware dominance (rank 3)

**Hypothesis.** The classifier input `dom` (normalised envelope dominance from `build_glimpse.py`, glimpse theory) is
a model of **energetic masking**, which exists when talkers mix at each ear (loudspeakers, HRTF). AASD is dichotic: one
talker per ear, no masking at the periphery. The `dom` → EEG relation the net learned is then off-distribution.
KUL2016 contains both dichotic ("dry") and HRTF trials, so this can be tested in-domain with training labels.

**Step 0 (frozen, ~30 min).**
- (a) Using the KUL-held fold checkpoints, split KUL2016 acc1 by presentation condition (locate the condition field
  in `data/cnd/KUL2016` CND stim metadata).
- (b) Repeat with the `dom` channel neutralised (`dom := 0`, other targets unchanged) on all LODO folds and on
  AASD/Carta.
- Proceed only if `dom` ablation hurts HRTF / free-field trials but is neutral or helpful on dichotic trials, or if
  dichotic trials are ≥ 2 pt below HRTF trials.

**Step 1 (retrain).** Use presentation dropout. For each training window, with p = 0.5 replace `dom` with its
dichotic-consistent value, `dom := 0`, meaning no peripheral masking. Add a 1-bit **physical presentation flag**
(dichotic vs mixed) as an input only if it is test-time metadata. Otherwise do not add it, and rely on the dropout
so the net works without `dom`. Retrain 4 seeds × (5 folds + all5).

**Not a repeat of:** TRN-07 featdrop (random, condition-blind feature dropout; closed with no gain), PRE-23
(adding/removing glimpse features globally), TRN-09 C5 montage aug. PAD is conditional on a measured
presentation effect. If Step 0 shows none, PAD is closed without training.

**Risk.** The test set's presentation mode is unknown. If it is loudspeaker-based, PAD can only help AASD (a proxy)
and must not cost LODO more than 0.005 H.

### R2-4 — MC-mask TTA (rank 4)

The SW2 nets were trained with `p_chan_mask 0.5, p_chan 0.2, p_cluster 0.3`, so masked inputs are in-distribution.
At inference, average logits over M = 16 fixed pseudo-random channel/cluster masks per seed (same masks for every
trial; no state). This reduces model variance without new training, the same mechanism as a larger seed bank
(GAP-11: seed bank > 5 never run). The column swap gate holds trivially because the masks act on EEG only.
Selection uses LODO: M ∈ {8, 16, 32}, mask rate ∈ {0.1, 0.2}. Expected ceiling is small (+0…+0.7 Acc): the
4→5-seed step gave ≤ +0.003 H. Run it only as a cheap stack on top of R2-1/R2-2.
**Not a repeat of:** ENS-01/02 (seed averaging/stacking of logits), TRN-07 (training-time aug).

### R2-5 — SR-Pool + LODO-fast (rank 5, companion only)

DirectNet already computes per-position logits `h (B, W)` and pools them with the nearly flat learned softmax `tw`.
SR-Pool **re-pools the same per-position logits** with a causal short kernel over the last T_p ∈ {2, 3, 4} s of the
window (training-free). It then refits the HMM emissions on a new **LODO-fast** track: synthetic schedules with
dwell ~ LogU(3, 20) s, a generic dwell prior like the T2 ESR resynthesis, not fitted on AASD labels.
§1.4 shows the fast read-out converts a d′ gain into AASD Acc (at steady 0.80: 64.5 vs 60.0 for the 10-s read-out).
§1.3 bounds the latency-only gain at about +2.

**Overlap warning.** This is readout-family (BOARD NEXT_ACTION discourages readout tuning) and partly overlaps
ARC-01 (3/5-s windows) and DEC-02 (multi-rate). Run it **only** after R2-1, R2-2 or R2-3 passes its gate, as the
multiplier. Never run it as a standalone claim.

---

## 4. Considered and rejected (do not propose again)

| Idea | Reason |
|---|---|
| Label-free per-trial mixture-envelope (A+B) backward decoder; forward-TRF attended/unattended likelihood ratio | A within-trial linear decoder with **oracle** labels reaches only 0.59–0.62 after 3 min and +0.009 H (`adapt_within_trial.csv`). AASD trials are 58 s. Linear Path-A was already at chance on AASD (PTA-01) |
| Alpha-lateralisation / FBCSP spatial attention | The test format is 1–9 Hz (PRE-01); spatial decoding is closed (ARC-03, PTA-03) |
| wav2vec/HuBERT/Whisper stimulus features | No raw audio exists for the 5 training corpora |
| Key-press motor / LRP cues near switches | AASD-specific confound (decodes the response, not attention); absent from the test set; integrity violation |
| More real-switch data in training | TRN-12 evidence (worse); nothing else on disk |
| Stimulus-conditioned switch hazard (e.g. switches at pauses) | Decision layer; it cannot be learned without real switches; its latency-only bound is about +2 |
| Envelope re-extraction for AASD | Envelope fidelity r 0.988; dichotic L/R correlation 0.000 |
| Raw vs processed AASD EEG, per-dataset prep choice | Selection on eval labels; does not transfer to the test format |

---

## 5. Patch plans for the top 3

Paths: W = `/root/disk_3tb/eeg-thao`, R = `/root/disk_3tb/EEG-sAAD-Grand-Challenge-Training-Dataset/experiments/decoder_lodo`.
Python via `W/run.sh`. Take a GPU `flock W/multi_agent_opt/gpu.lock`. Claim one ID at a time in
`W/multi_agent_opt/CLAIMS.md`. Do not edit `R/direct_classifier.py`; import it as `DC`. Reuse `configure()`,
`load_nets()`, `external_targets()` and `ensemble_logits()` from `W/lagbank_sel.py`.

Checkpoints (verified present): all5 `R/models/all5_direct_clf_w10b3sw2P_s{0..3}.pt`; folds
`R/models/fold_direct_clf__eaP_n5_t60_w10b3_ptSPK[_s{1,2,3}]_aug-sw2_wts__{AVGC,DTU,KUL,UHD,USTC}.pt`;
SparrKULee M/M init `R/models/pretrain_spk_direct_clf_w10_b3_s{0..3}.pt`.

### 5.0 D0 — `W/mm_diag.py` (new)

```python
# for each trial: stim S (T,2,F) from lagbank_sel.external_targets / fold trials; EEG x (T,58)
def past_copy(S, s, lo=8*FS, hi=30*FS, rng):      # same stream, shifted from the past only; zero before available
    d = rng.integers(lo, hi); out = np.zeros_like(S[:, s]); out[d:] = S[:-d, s]; return out
for s in (0, 1):
    Sm = np.stack([S[:, s], past_copy(S, s, ...)], 1)   # (T, 2, F): stream A = true, B = mismatched
    m, starts = DC.logits(net, x, Sm, step=4)           # >0 = true stream matches EEG
# metrics: P(m>0) per dataset / subject (only frames with a full past copy, t >= 8 s);
# Spearman(subject M/M acc, subject steady attention acc) as a diagnostic only
```

Output `W/results/research/mm_diag.json` and `W/experiments/multi_agent_opt/runs/r2_d0_mmdiag_<date>/metrics.json`.

### 5.1 R2-1 MM-TTA — `W/mm_tta.py` (new)

```python
class SpatialAdapter(torch.nn.Module):               # E' = E (1+g) + (E U) V^T ; V, g zero-init -> identity at start
    def __init__(s, C=58, r=2):
        super().__init__(); s.U = nn.Parameter(torch.randn(C, r) * C**-0.5); s.V = nn.Parameter(torch.zeros(C, r))
        s.g = nn.Parameter(torch.zeros(C))
    def forward(s, E): return E * (1 + s.g) + (E @ s.U) @ s.V.T

class Adapted(torch.nn.Module):                      # wraps a frozen DirectNet; acts on EEG only -> oddness preserved
    def __init__(s, net, ad): super().__init__(); s.net, s.ad = net, ad
    def forward(s, E, S): return s.net(s.ad(E), S)

def run_trial(net, x, S, cfg):
    blocks = range(int(cfg.first_s*FS), len(x), int(cfg.every_s*FS))
    logits = DC.logits(net, x, S, step=4)            # until first update: unadapted
    for b0, b1 in zip(blocks, list(blocks[1:]) + [len(x)]):
        ad = SpatialAdapter(r=cfg.r).to(DEV)         # re-fit FROM ZERO on the bounded buffer -> position-invariant
        buf = (max(0, b0 + DC.FUT - cfg.buf_s*FS), b0 + DC.FUT)   # windows ending <= decision time + FUT
        fit_mm(net, ad, x, S, buf, cfg)              # K Adam steps on L = sum_s softplus(-f(E', s, s~)) + reg
        logits[hops in [b0, b1)] = DC.logits(Adapted(net, ad), x, S, step=4)[same hops]
    return logits
```

- `--mode lodo`: fold checkpoints, held dataset, same synthetic schedule replay as `lagbank_sel` / `direct_classifier.run_fold`;
  grid over (r, K, lr, λ) picked by mean LODO acc1 (inner: pick on the 4 non-held datasets).
- `--mode external`: all5, frozen grid choice, AASD/Carta scored once via `fuse_external`/`eval_external.score` with LODO emissions.
- Gates in-script: `|f(E',A,B)+f(E',B,A)|` max over a batch; prepend-60 s agreement; a `leakage_test.py` wrapper
  that perturbs EEG after t+0.75 s and asserts identical logits.
- Outputs `W/results/research/mm_tta.json`, run dir `runs/r2_mmtta_<date>/`.

### 5.2 R2-2 SAA — `W/saa_align.py` (new; screen) and `W/build_saa_prep.py` (retrain stage)

```python
def saa_stream(x, mix, P0, tau_s=30, kappa_s=20, lags=13, alpha=1.0):
    lam = np.exp(-1/(tau_s*FS)); C = np.zeros((58, lags)); n = 0.0; R = np.eye(58); out = np.empty_like(x)
    for t in range(len(x)):
        out[t] = R @ x[t]                                       # rotation from strictly earlier samples
        if t >= lags:
            C = lam*C + np.outer(x[t], mix[t-lags+1:t+1][::-1]); n = lam*n + 1
        if t % HOP == 0 and n > 0:
            P = (C + kappa_s*FS*P0) / (n + kappa_s*FS)          # shrink to the population pattern
            u, _, vt = np.linalg.svd(P @ P0.T); Rn = (u @ vt).T # Procrustes: R P ~ P0
            R = geodesic(R, Rn, alpha)
    return out
# P0: the same estimator on all training trials of the 4 training datasets of each fold (no labels; mix = A+B)
```

The screen runs fold checkpoints on held trials and all5 on AASD/Carta, with SAA at test time only, and reports
label-free cosine(P_subject, P0) before and after. `build_saa_prep.py` writes `cache/saa_eaP/*.npz` (same keys as
`eaP_n5_t60`) for the retrain stage (4 seeds × 6 checkpoints, `--prep saa_eaP`).

### 5.3 R2-3 PAD — `W/pad_diag.py` (new; Step 0) and an `aug-set` key for Step 1

- Step 0: KUL condition per trial from CND stim metadata. With fold checkpoints, compute acc1 for {dichotic, HRTF} ×
  {dom as is, dom := 0} on KUL, and dom-ablation on the other folds and on AASD/Carta (all5).
  Output `W/results/research/pad_diag.json`.
- Step 1 (only if Step 0 passes): add augmentation key `clf_p_dom_null` to the workspace copy of `windows()`:
  `S[..., idx_dom] = 0` with probability p per window. Retrain via
  `direct_classifier.py ... --aug-set clf_p_switch2=0.5 clf_p_dom_null=0.5 --tag _w10b3_ptSPK_sS_aug-sw2_pad`.

---

## 6. Recommended order

1. **D0** (label-free, ~20 min GPU). It decides between "shift" and "ceiling".
2. If shift: **R2-1 MM-TTA**, seed 0, LODO first, then external. In parallel on CPU: **R2-2 SAA screen**.
   If ceiling: **R2-3 PAD Step 0**, then report to the user that AASD > 63 is infeasible under the rules.
3. Any passing d′ candidate → stack **R2-4** and **R2-5** as multipliers. Confirm on seeds 1–3 before claiming.

Feasibility statement for the user: honest LODO ≥ 0.85/78 still needs about +5–6 pt frame accuracy, and none of these
targets the long-dwell regime strongly. The AASD > 63 target needs AASD steady evidence at the DTU in-domain level
plus a 2-s read-out. This round can at best show which of the two blockers (shift or ceiling) is real.
