Files
ML-Porosity/docs/research/gp-review-experiments.md
lamlvh eff975cc96 Address simulated GP referee reports: E1-E6 and A1-A9 (exploratory), theory scope, per-well field and anchor-error tables, scorer v1.1, paper_gp and response letter
Experiments declared and hashed before computing (docs/research/gp-review-*.md). The SMC-mean gain holds against a practitioner tie, all budgets and a same-target point tie, but is lost at anchor errors of 2 ms or less and reverses with per-well bulk error. No locked protocol, verdict or threshold changed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 11:20:54 +00:00

196 lines
15 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# GP review, Phase 3: new experiments (E1, E2, E4, E5, E6; E3 conditional)
Declared on 17/11/2026, before any of these experiments was run and before realizations 24–31 were generated. The
SHA-256 of this file is recorded in `gp-review-experiments.sha256`, and `scripts/52_gp_experiments.py` refuses to run
if the hash differs. Everything here is **exploratory**. It lies outside every locked protocol: no locked protocol,
script, input or output is edited, and the locked scripts 14 and 15 are called unchanged, with in-process
replacements of single functions where stated (the pattern of `scripts/47_r6_fixed_hyper.py`). No threshold of a
locked protocol changes. Every design choice is fixed here or tuned on development realizations 900–905; no choice
uses test labels. Source: `gp-referee/review-and-revision-plan.md` (Phase 3), approved by the user on 17/11/2026
(E1, E2, E4, E5 mandatory; E3 only if A3 of `gp-review-analyses.md` is not sufficient). E6 is added because A2
cannot be done from saved outputs.
Outputs go to `outputs/gp_review/e{1..6}/`; results are written to `gp-review-results.md`. Driver:
`scripts/run_gp_review.sh`. Long runs use the user's tmux server.
## Common definitions
As in `gp-review-analyses.md`: cells, per-realization error, ratio, intervals (primary: percentile bootstrap over
realizations; BCa and t as sensitivity; "CI below 1" = upper limit < 1, "CI above 1" = lower limit > 1), best
deterministic tie ({B3b, B3c, B3c-R}; "with anchor mean" adds B3d), registered budgets. The **locked H2a cell rule**
is `h2a_cells` of `scripts/18_summarize_p2r.py` (the `gate_gb` rule of `scripts/13`), applied without change.
Training uses `train_predict` with the protocol model and optimizer, NLL, seeds 0–4, unless stated otherwise.
## E4. Point tie optimizing the SMC target
Question: does the gain over deterministic ties come from the tie model (its target) or from SMC sampling?
- **Target** per training well: F(z) = log p(u | anchors) + γ ℓ(u) as `TiePosterior.parts`, γ from the scripts/14
posterior CSV (`SMC_g_acf`, `estR`), the same objects as `scripts/44_point_tie_arm.py`.
- **Optimizer**: from each of the 4 saved particles with the highest F, `scipy.optimize.minimize` (L-BFGS-B) on −F
with a forward-difference gradient (step 10⁻³ in z, one batched `parts` call; a component whose forward point is
infeasible uses the backward difference, and is 0 if both are infeasible), `maxiter` 200, `ftol` 10⁻⁹,
`gtol` 10⁻⁶; infeasible points (|g| > g_max or not covering the main window) have −F = 10¹². The arm **SMC-opt**
uses the point with the highest F among the 4 optima and the 4 starts, so F(SMC-opt) ≥ F(SMC-MAP).
- **Training**: one label per well at the SMC-opt warp, NLL, budget 250 (as SMC-MAP and B3d-Sa).
- **Cells**: R10, R0, Rm5 × c ∈ {0, 1} × N ∈ {4, 16}, realizations 8–15 (12 cells; the cells of
`outputs/point_tie/`).
- **Recorded per well**: F at SMC-MAP and SMC-opt, both parts of F, number of starts improved, ‖z_opt − z_MAP‖,
warp RMSE (ms).
- **Ratios per cell**: (E4-1) SMC-opt / best deterministic tie; (E4-2) B3d-Sa / SMC-opt; (E4-3) SMC-opt / SMC-MAP;
(E4-4) SMC-opt / Anchor-LS.
- **Readings** (12 cells): (R4a) "the target, not the sampler, carries the gain over deterministic ties" if E4-1 is
CI below 1 in ≥ 10 of 12 cells; (R4b) "posterior averaging improves on the optimized point" if E4-2 is CI below 1
in ≥ 6 of 12, "the optimized point is better than averaging" if CI above 1 in ≥ 6 of 12, otherwise "no consistent
difference"; (R4c) "optimizing beyond the best particle changes little" if the E4-3 ratio lies in [0.98, 1.02] in
≥ 10 of 12 cells.
## E5. Posterior-mean labels trained with the Gaussian likelihood
Question (GP-C): Proposition A4(a) concerns the posterior mean of the labels, E[y | D], whereas "SMC mean" uses the
label at the posterior-mean warp. Separate the label from the loss.
- **Arms**: **Mean-NLL**, one label per well equal to the π-weighted mean of the 64 bank labels of M2-Sa (the
label of `Mean-MSE` in `scripts/41`), trained with NLL (S = 1); **Mean-NLL-1024**, the mean label over all valid
labels of the 1024 saved particles, NLL; **B3d-Sa** retrained as a reproduction check (rows must equal the
registered rows at budget 250; otherwise the mismatch is reported and the E5 ratios are not read).
- **Reused rows** (same cells, seeds and budgets): M2-Sa, Bank-lam0 (λ = 10⁻³) and Mean-MSE from
`outputs/lambda_limit/`.
- **Cells**: the 11 T2 cells at N = 16 (8 wide: (R0,1), (R0h,1), (R10tb,1), (Rm5,1), (R0,2), (Rm5,2), (R0h,2),
(R10tb,2); 3 narrow: (R10,0), (R0,0), (Rm5,0)), realizations 8–15, budgets 125, 250 and 500 (one run, snapshots);
primary budget 250.
- **Readings** over the 8 wide cells at budget 250: (R5a, label) Mean-NLL / B3d-Sa: "the mean of labels is better"
if CI below 1 in ≥ 5 of 8, "the label at the mean warp is better" if CI above 1 in ≥ 5 of 8, otherwise "no
consistent difference"; (R5b, loss) Mean-NLL / Mean-MSE with the same rule ("NLL better" / "MSE better" / none);
(R5c, bank) M2-Sa / Mean-NLL with the same rule ("bank better" / "mean label better" / none). Descriptive:
Bank-lam0 / Mean-NLL (the λ → 0 bank and the mean label have the same mean-square minimizer for μ at fixed σ),
Mean-NLL-1024 / Mean-NLL, coverage90 and mean σ of every arm.
## E6. Equal-budget table
Question: does the registered budget asymmetry (B3b 125, B3c 250, B3c-R 500, Oracle 500, posterior methods 250)
drive Table 2?
- **Methods**: Oracle, B3b, B3c, B3c-R, B3d, B3d-Sa, M2-Sa with the labels of `scripts/15` `run_cell` (variant a),
each trained once to 500 iterations with predictions at 125, 250 and 500 (the budget list passed to `train_predict`
is replaced in the worker process; locked code unchanged). Predictions are saved.
- **Cells**: R10, R0, Rm5 × c ∈ {0, 1} × N ∈ {4, 16}, realizations 8–15 (96 cell-realizations).
- **Reproduction check**: the rows of every method at its registered budget must equal the P2r rows (all metrics,
tolerance 10⁻⁹). Otherwise the mismatch is reported and E6 is not read.
- **Analysis**: at each budget b, every method at b; the locked H2a cell rule for B3d-Sa and M2-Sa against {B3b, B3c,
B3c-R} and against the set with B3d, at c ∈ {0, 1}, with the zero-drift macro ratio.
- **Reading**: k_b = number of the 6 c = 1 cells (3 regimes × 2 N) in which B3d-Sa passes the cell rule against
{B3b, B3c, B3c-R} at budget b. "Budget-robust" if k_b ≥ 5 for every b ∈ {125, 250, 500}; "budget-dependent" if
k_b ≤ 3 for some b; otherwise "partly robust". The set with B3d and M2-Sa are reported with the same counts,
without a reading.
## E2. A practitioner-grade deterministic tie
Question (GP-A): do the "best deterministic tie" numbers depend on the authors' simple ties? E2 adds a tie built
the way an interpreter would build it, tuned on development data, as a fourth deterministic competitor **B3p**.
**Tie.** Synthetic sonic time is τ itself.
1. *Anchor calibration* of the drift d(τ) = t − τ: `exact` = B3b (piecewise linear through the anchors, bulk shift
outside); `smooth` = cubic smoothing spline of d_k against τ_k with the smoothing chosen by generalized
cross-validation (`scipy.interpolate.make_smoothing_spline`) when there are ≥ 5 anchors, the least-squares line
with 3–4 anchors, B3b with ≤ 2; constant extrapolation outside the anchor range; dt/dτ ≥ 0.05 enforced.
2. *Wavelet* from the N training wells of the cell only: `stat` = statistical zero-phase wavelet
(`statistical_wavelet`, length as registration); `stat+phase` = the same with one constant phase per cell chosen
on a 15° grid in [−90°, 90°] to maximize the mean seismic–synthetic correlation over the training wells at the
current tie; `LS` = deterministic multi-well least-squares (Wiener) wavelet from the reflectivity at the current
tie and the seismic in the main window ± 50 ms, same length, 1% prewhitening, Hann taper.
3. *Bulk shift*: the 1-ms lag in [−B, B] that maximizes the seismic–synthetic correlation, B ∈ {0, 12} ms.
4. *Dynamic warping*: traces on a 1-ms grid (seismic by cubic interpolation of the 4-ms trace, synthetic from the
fine forward model), both scaled to unit RMS, window = extended window ∩ synthetic support; error
e(t, l) = (syn(t) − seis(t + l))², lags l ∈ {−L, …, L} ms, L ∈ {4, 8, 16, 24}; strain limit ε ∈ {0.02, 0.05, 0.10}
imposed as lag knots every h = round(1/ε) ms that differ by at most 1 ms between neighbours, linear between
knots (a simplified form of smooth dynamic warping, Hale 2013); minimum total error by dynamic programming;
constant lag outside the window.
5. *Update* t₁(τ) = t(τ) + l(t(τ)) (positive lag = synthetic must be later, the B3c convention); monotone because
the strain is below 1.
6. *Iterations* n ∈ {1, 2}: in the second, the wavelet (`stat+phase`, `LS`) is re-estimated at the first-pass ties
and steps 3–5 are redone from the step-1 tie.
Grid: 2 × 3 × 2 × 4 × 3 × 2 = 288 configurations.
**Tuning (development only).** Per regime (R10, R0, Rm5, R0h, R10tb), the configuration with the smallest mean warp
RMSE (ms, main window) over realizations 900–905, c ∈ {0, 1, 2}, N ∈ {4, 16} (first N pool wells), all training
wells. Ties go to the simpler configuration (n = 1, B = 0, smaller L, larger ε, `exact`, `stat` before
`stat+phase` before `LS`). Reported: the dev warp RMSE of B3p, B3b, B3c and B3c-R on the same wells. **Budget**:
with the R10 configuration, development realizations 900/901, c = 1, N ∈ {4, 16}, seeds 0/1, candidates
{125, 250, 500, 1000, 2000}, smallest mean total RMSE (`select_budgets`, the rule of protocol_p2); one budget for all
regimes, as for the registered methods.
**Evaluation.** B3p is trained on (a) the P2r cells, 5 regimes × c ∈ {0, 1, 2} × N ∈ {4, 16}, realizations 8–15;
(b) the replication cells R10, R0, Rm5 × c ∈ {0, 1} × N ∈ {4, 16}, realizations 16–23; (c) the E1 cells. Warp RMSE
is recorded for every training well. Analyses: warp RMSE of B3p against the other ties; the locked H2a cell rule for
B3d-Sa and M2-Sa against {B3b, B3c, B3c-R, B3p} and {B3b, B3c, B3c-R, B3d, B3p} at c ∈ {0, 1} with the zero-drift
ratio, on 8–15 and on 16–23; B3d-Sa / B3p with intervals.
**Reading** (realizations 8–15, B3d-Sa against {B3b, B3c, B3c-R, B3p}, the 6 c = 1 cells of R10, R0, Rm5):
"the headline survives a practitioner tie" if ≥ 5 of 6 cells pass; "narrowed" if 3–4 of 6; "does not survive" if
≤ 2 of 6. The same count on 16–23 is reported as a replication.
## E1. True anchor error varies; per-well bulk anchor error
Question (all three referees): the benchmark draws independent 7 ms anchor errors and gives the registration the true
σ_a. Does the SMC gain hold when anchors are more accurate than assumed, when σ_a is stated correctly at other
values, and when the anchor error has a per-well bulk component, as the F3 marker–horizon evidence suggests?
- **Realizations 24–31**, never used before (checked: no outputs exist). Their fingerprints (as `scripts/46`
`stage_fingerprints`) are written to `outputs/gp_review/e1/fingerprints.json` before any posterior is run.
- **Regime** R10 (10 dB, full anchors), c = 1, N ∈ {4, 16}, registration seed 0, training seeds 0–4.
- **Anchor data model**: t_k = boundary time + σ_true ε_k + β_w, with ε_k the realization's own standard normal
draws (`eps_a`; the same draws in every condition) and β_w = σ_B · z_w, z_w standard normal from
`numpy.random.default_rng([rid, crc32(well name), 2417])` (the same draws in every bulk condition). Implemented by
replacing `D2Realization.observe` in the worker process (only the anchor-time line changes).
- **Conditions** (σ_true, σ_B; σ_reg; drift hyperparameters):
| Condition | σ_true (ms) | σ_B (ms) | σ_reg (ms) | hyperparameters |
|---|---|---|---|---|
| iid7-reg7 (nominal) | 7 | 0 | 7 | refit |
| iid4-reg4 | 4 | 0 | 4 | refit |
| iid4-reg7 | 4 | 0 | 7 | refit |
| iid2-reg2 | 2 | 0 | 2 | refit |
| iid2-reg7 | 2 | 0 | 7 | refit |
| iid1-reg1 | 1 | 0 | 1 | refit |
| iid1-reg7 | 1 | 0 | 7 | refit |
| bulk-reg2 | 2 | 5 | 2 | refit |
| bulk-reg5.4 | 2 | 5 | 5.39 (√29, the marginal SD) | refit |
| bulk-reg7 | 2 | 5 | 7 | refit |
| iid2-reg2-fix | 2 | 0 | 2 | fitted at σ_a = 7, then σ_a set to σ_reg (as `scripts/47`) |
| bulk-reg2-fix | 2 | 5 | 2 | as above |
- **Methods**: the seven registered methods (Oracle, B3b, B3c, B3c-R, B3d, B3d-Sa, M2-Sa) at their registered
budgets through the locked scripts/14 `run_job` and scripts/15 `run_cell` (posterior 1024 particles, `estR`), plus
SMC-MAP (budget 250) and B3p (E2 budget) when E2 is done.
- **Comparisons** per condition and N: (P1) B3d-Sa / best deterministic tie (and with B3p when available);
(P2) B3d-Sa / B3d; (P3) M2-Sa / B3d-Sa; (P4) warp RMSE, warp coverage90 and width of the SMC posterior;
(P5) the paired effect of a misstated σ_reg on the same realizations: B3d-Sa(σ_reg = 7) / B3d-Sa(σ_reg = σ_true)
for σ_true ∈ {1, 2, 4} and bulk-reg7 / bulk-reg5.4.
- **Reading of P1** per condition: "gain holds" if CI below 1 at both N; "gain lost" if the CI contains 1 at both N;
"reversed" if CI above 1 at either N; "partial" otherwise. Declared statements, each read separately and never
pooled into a count: (S1) "the SMC-mean gain persists when anchors are more accurate than assumed" if iid4-reg7,
iid2-reg7 and iid1-reg7 all read "gain holds"; (S2) "… when σ_a is stated correctly" if iid4-reg4, iid2-reg2 and
iid1-reg1 all read "gain holds"; (S3) for each σ_reg ∈ {2, 5.39, 7}, "… under per-well bulk anchor error" if the
bulk condition reads "gain holds".
## E3 (conditional on A3)
Run only if A3 of `gp-review-analyses.md` is not sufficient by its declared rule. Arm: Oracle labels shifted by one
constant per well, δ_w = s · z_w with z_w from `default_rng([rid, crc32(well name), 3301])`, s ∈ {2, 4, 8} ms;
R10, c = 0, N ∈ {4, 16}, realizations 8–15, NLL, budget 500, seeds 0–4. Measured transfer against
H_pred(f) = mean_w cos(2π f δ_w) with the A3 statistic g. Reading: "the blur prediction holds for constant shifts"
if g ∈ [0.9, 1.1] in ≥ two thirds of the powered combinations (A3 definition).
## Resources and order
E5, E6 and E4 first (GPU training and CPU optimization, about 10 workers with 2 threads), then E2 (CPU tuning, then
training), then E1 (192 posterior jobs at 1.5 GB each, then training). cuda:0, a shared machine: other users' jobs
are never touched. Every stage resumes by skipping cells whose CSV exists.
## Reporting
Results, the declared readings and every deviation from this declaration (with its reason) go to
`gp-review-results.md`. Numbers enter the paper only with their status (exploratory) and these readings.