Replicate Experiment 2 on new realizations; test sigma_a at -5 dB

Exploratory analyses declared and hashed before computing
(docs/research/r6-replication.md, sha256 13b8b943...), outside every lock:
- Replication on realizations 16-23: the SMC-mean gain over the best
  deterministic tie is 7-19% (8-22% before); the per-regime verdicts are
  unchanged; the SMC mode beats the best tie in 10/10 cells; the bank passes
  2/3 wide cells; a Gaussian bank is within 2%.
- Misspecified anchor uncertainty at -5 dB: 0/2 cells at both 3.5 and 14 ms.
- Mechanism at sigma_a = 3.5 ms: the refitted drift prior becomes rougher
  (length scale 10-15 vs 80-90 ms); with fixed hyperparameters the
  posterior does not narrow.
- Calibrated sign test, F-11 T2 under four references, coverage at equal
  training length.

Paper: Sec. 6.3 and tab:sigmaa, abstract, introduction, conclusions,
Sec. 3.3, 4.1, tab:lessons, limitations, App. B and C. Docs synced; the
user dropped all date deadlines on 11/11/2026. No verdict, threshold or
protocol changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 04:49:53 +00:00
parent 760dbfea4f
commit d0d2cd3c82
24 changed files with 1091 additions and 64 deletions

66
scripts/run_r6.sh Executable file
View File

@@ -0,0 +1,66 @@
#!/usr/bin/env bash
# R6 (declared in docs/research/r6-replication.md, hashed before the first run; outside every lock).
# scripts/run_r6.sh fingerprints # B1: fingerprints of realizations 16-23 (before any training)
# scripts/run_r6.sh b3 # B3: sigma_a = 3.5 ms with fixed drift hyperparameters (scripts/47)
# scripts/run_r6.sh c1 R10 R0 Rm5 # B1: c = 1 posteriors + the seven registered methods, realizations 16-23
# scripts/run_r6.sh c0 R10 R0 Rm5 # B1: c = 0 (zero-drift guard of H2a)
# scripts/run_r6.sh sa # B2: Rm5, sigma_a,reg 3.5 and 14 ms, realizations 8-15
# scripts/run_r6.sh arms # B1: SMC-MAP, Anchor-LS, Ctl-GP (scripts/46)
# scripts/run_r6.sh summary # scripts/46 summary -> outputs/replication/summary/
# Posteriors and training use the locked scripts 14 and 15 with the arguments of scripts/run_p2r_main.sh (no
# --save-preds); both skip jobs that already have a CSV, so any stage can be restarted with the same command.
set -euo pipefail
cd "$(dirname "$0")/.."
PY="${PY:-.venv/bin/python}"
DEVICE="${DEVICE:-cuda:0}"
WORKERS="${WORKERS:-2}"
THREADS="${THREADS:-2}"
export OMP_NUM_THREADS=$THREADS MKL_NUM_THREADS=$THREADS OPENBLAS_NUM_THREADS=$THREADS NUMEXPR_NUM_THREADS=$THREADS \
NUMBA_NUM_THREADS=$THREADS VECLIB_MAXIMUM_THREADS=$THREADS
OUT=outputs/replication
BUDGETS=outputs/p2/diag/train/budgets.json
post() { # rids snr dens c-list out [extra]
local rids="$1" snr="$2" dens="$3" cs="$4" out="$5"; shift 5
"$PY" scripts/14_diag_posterior.py --rids $rids --n 4 16 --seeds 0 --particles 1024 --wavelets estR \
--device "$DEVICE" --workers "$WORKERS" --gpu-mem-gb 1.5 --c $cs --snr "$snr" --anchor-density "$dens" \
--out-dir "$OUT/posterior/$out" "$@"
}
train() {
local rids="$1" snr="$2" dens="$3" cs="$4" out="$5"; shift 5
"$PY" scripts/15_diag_train.py --rids $rids --n 4 16 --seeds 0 1 2 3 4 --reg-seed 0 --device "$DEVICE" \
--workers "$WORKERS" --variants a --methods Oracle B3b B3c B3c-R B3d B3d-Sa M2-Sa --budgets-from "$BUDGETS" \
--c $cs --snr "$snr" --anchor-density "$dens" --post-dir "$OUT/posterior/$out" --out-dir "$OUT/train/$out" "$@"
}
regime() {
"$PY" -c "import sys, yaml; r = yaml.safe_load(open('configs/d2_synth_p2r.yaml'))['regimes'][sys.argv[1]]; \
print(r['snr_db'], r['anchor_density'])" "$1"
}
NEW="16 17 18 19 20 21 22 23"
OLD="8 9 10 11 12 13 14 15"
stage="$1"; shift
echo "== r6 $stage $* ($(date -u +%FT%TZ))"
case "$stage" in
fingerprints) CUDA_VISIBLE_DEVICES= "$PY" scripts/46_r6_replication.py --stage fingerprints ;;
b3)
CUDA_VISIBLE_DEVICES= "$PY" scripts/47_r6_fixed_hyper.py --stage hyper
"$PY" scripts/47_r6_fixed_hyper.py --stage post --device "$DEVICE" --gpu-mem-gb 1.5
CUDA_VISIBLE_DEVICES= "$PY" scripts/47_r6_fixed_hyper.py --stage summary ;;
c1|c0)
[[ -f "$OUT/fingerprints.json" ]] || { echo "run the fingerprints stage first" >&2; exit 1; }
c=${stage#c}
for r in "$@"; do
read -r snr dens <<< "$(regime "$r")"
post "$NEW" "$snr" "$dens" "$c" "$r"
train "$NEW" "$snr" "$dens" "$c" "$r"
done ;;
sa)
read -r snr dens <<< "$(regime Rm5)"
for sa in 3.5 14; do
post "$OLD" "$snr" "$dens" 1 "Rm5_sa$sa" --sigma-a-reg "$sa"
train "$OLD" "$snr" "$dens" 1 "Rm5_sa$sa" --sigma-a-reg "$sa"
done ;;
arms) "$PY" scripts/46_r6_replication.py --stage arms --device "$DEVICE" --workers "$WORKERS" ;;
summary) CUDA_VISIBLE_DEVICES= "$PY" scripts/46_r6_replication.py --stage summary ;;
*) echo "unknown stage: $stage" >&2; exit 2 ;;
esac
echo "== r6 $stage $* done ($(date -u +%FT%TZ))"