Complete P4 Volve; pivot the manuscript to theory + benchmark

P4 (Volve field case). Add the deviated-well and Volve well builders
(ml_porosity/data/deviated.py, volve_wells.py), the ml_porosity/volve/
pipeline, scripts 23-25, the run_p4 drivers and tests. The protocol
configs/protocol_volve.yaml was locked at 2026-10-29T01:17:42Z before the
run (.sha256, .lock.json) and is committed here after the run. Gate G-D
failed: M2-Sa beats the selected B3 at 2/6 wells (lowo) and 3/6 (slot),
coverage90 is about 0.47, and no method has blind-well skill (R2 < 0).
A post hoc constant at the training-well mean beats every network, so
G-D had no power. The dropped P4x exploratory run is kept as a record
only (exploratory/, docs/research/p4-exploratory.md).

Applicability and Teapot Dome (exploratory, pre-declared). Scripts 26-29
and docs/research/applicability-*.md: F3 and Volve fail C1 and pass C2;
T3 power needs 5-18 blind wells with an exact reference; Teapot T0 and
pilot P-a failed, so Teapot is stopped. Raw Teapot data stay gitignored.

Manuscript (Pivot 1, level A). Reframe paper/ as a theory and synthetic
benchmark paper: Propositions 3-6, Corollaries 3-4, T4 coverage
(script 30) and the post hoc H2b bound check (script 31), with F3/Volve
moved to Appendix B. Correct two earlier claims: the Berkson and
classical bounds differ by 1.5-4.6x at the f^4-weighted band, and the
bank gain exceeds the registered classical bound (7/8 wide cells at
N = 16) but only 3/8 under the post hoc Berkson bound.

Docs. Sync plan, AGENTS.md, README, report.html, theory and technical
overview. The length pass for the venue is dropped by the user
(plan section 12 item 25); the length risk stays recorded as R9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 12:18:22 +00:00
parent 7da6b077b6
commit 0cfe202a8b
61 changed files with 7162 additions and 881 deletions

View File

@@ -60,6 +60,9 @@ scripts/run_p0.sh # toàn bộ pipeline P0 và test
scripts/run_p1.sh # P1: tie QC, LOWO baseline (khoảng 16 phút với GPU)
scripts/run_p2.sh # P2: prior warp F3, QC D2, test, lưới D2, H1, tổng hợp (GPU cuda:1; đổi bằng DEVICE=...)
scripts/run_p2r_dev.sh # chuẩn bị P2r (chạy lại P2) trên dev 900/901: screen, train, stability, sigma_a, f3, h3 (+ stability_m5, b3d_old, train_sa)
scripts/run_p2r_main.sh # lưới chính P2r trên realization 8–15
scripts/run_p4.sh # P4 Volve: register, train, summarize nhánh σ_a chính (DEVICE mặc định cuda:1)
ARMS=sensitivity scripts/run_p4.sh register train # nhánh σ_a = 3,5 / 14 ms; sau đó ARMS=all scripts/run_p4.sh summarize
```
Log và runtime: mỗi lần chạy `run_p*.sh` tạo `logs/runs/<YYYYmmdd-HHMMSS>_p*/`, mỗi bước là một thư mục con có `log.txt` (stdout + stderr, cả của worker, đầu dòng có thời gian đã trôi) và `meta.json` (lệnh, git commit + hash mã nguồn, biến luồng, thiết bị, wall/CPU time, RSS và VRAM đỉnh, mã thoát). Mỗi bước thêm một dòng vào `logs/index.csv`. Chạy lẻ một script thì bọc bằng `scripts/runlog.sh`:
@@ -96,5 +99,19 @@ Biến môi trường máy đặt sẵn `OMP_NUM_THREADS=40` (cả MKL, OpenBLAS
| `scripts/15_diag_train.py [--post-dir] [--methods] [--budgets-from] [--save-preds]` | Huấn luyện trên dev với nhãn từ posterior SMC (B3d-Sa, M2-Sa…) và các baseline, cổng kiểu G-B, ensemble kiểu H3 → `outputs/p2/diag/train*/` |
| `scripts/16_f3_posterior.py [--device cuda:1]` | Đặt F3 lên trục σ_post (chỉ mô tả): posterior SMC trên 4 giếng F3 → `outputs/p2/diag/f3_posterior/` |
| `scripts/17_summarize_p2r_dev.py [--only …]` | Tổng hợp dev cho P2r: screen, train/dose-response H2b, B(σ), stability, σ_a, F3 → `outputs/p2/diag/p2rdev/summary.md` |
| `scripts/18_summarize_p2r.py [--root DIR]` | Phán quyết của `protocol_p2r` trên lưới chính (realization 8–15): H2a, H2b, σ_a, H3, H4 → `outputs/p2r/summary/` (`verdict.json`, `summary.md`) |
| `scripts/19_run_f3.py <stage> [--device] [--workers]` | P3 F3: prepare → benchmark → lock → register → train → diagnostics → summarize theo `configs/protocol_f3.yaml` → `outputs/p3/` |
| `scripts/20_summarize_f3.py` | Tổng hợp lượt P3 đã khóa, cổng G-C → `outputs/p3/summary/` |
| `scripts/21_predict_f3.py` | Mô hình triển khai và volume F3 mô tả (649 inline) sau LOWO của P3 → `outputs/p3/volume/` |
| `scripts/22_paper_figures.py [--only …]` | Hình cho bài báo (`paper/figures/*.pdf`), chỉ đọc các summary đã khóa |
| `scripts/23_build_volve_wells.py [--config configs/d3_volve.yaml]` | Dữ liệu 6 giếng nghiêng Volve trên miền thời gian (survey, TDR calibrated và blind, patch 3×3 dọc đường giếng, nhãn PHIF) → `outputs/volve/volve_wells.npz`, `volve_wells_summary.json` |
| `scripts/24_run_volve.py <stage> [--arms primary\|sensitivity\|all] [--device] [--workers]` | P4 Volve: benchmark → lock → register → train → summarize theo `configs/protocol_volve.yaml`, cổng G-D → `outputs/p4/` |
| `scripts/25_p4_posthoc.py` | Post hoc P4, ngoài khóa, không đổi G-D: hằng số bằng trung bình giếng train và tách RMSE thành bias + SD → `outputs/p4/posthoc/` |
| `scripts/26_applicability.py` | Điều kiện áp dụng C1, C2 (khai báo ở `docs/research/applicability-teapot.md`), hồi cứu trên F3 và Volve; chỉ đọc output đã khóa và nhãn giếng train của từng fold, không train → `outputs/applicability/` |
| `scripts/27_t3_power.py` | T3 exploratory: chấm lại dự đoán P2r đã lưu với tham chiếu lệch σ_ref, power của luật k-of-n và sign test theo số giếng blind (beta-binomial) → `outputs/t3/` |
| `python -P scripts/28_teapot_inventory.py --root data/Teapot/raw/rmotc --out outputs/teapot/inventory` | T0 kiểm kê Teapot Dome (chỉ header và độ phủ đường cong; không đọc quan hệ porosity–seismic). Dữ liệu là archive tải về, chạy bằng `python -P` từ gốc repo → `outputs/teapot/inventory/` |
| `python -P scripts/29_teapot_pilot.py` | Pilot P-a Teapot (Deviation 2): hình học, độ phủ horizon, σ̂_knot trên giếng dev (inline ≤ 200), không đọc porosity → `outputs/teapot/pilot_pa/` |
| `scripts/30_t4_coverage.py` | T4 post hoc, mô tả: tỉ số phân tán ξ (cột `kappa`), coverage90 và phần do số vòng lặp của các ensemble 5 seed, từ `outputs/p2r/train/*/cells/*.npz` và dev P2 → `outputs/t4/` |
| `scripts/31_p2r_posthoc.py` | Post hoc H2b, đọc `outputs/p2r/summary/` và dự đoán Oracle trong `outputs/p2r/train/<regime>/cells/*.npz` (khoảng 6 phút): tỉ số Oracle / B3d-Sa / M2-Sa, phần khoảng cách đã đóng; cận 1/B cho cấu trúc (a) classical (đã đăng ký) và (b) Berkson (thêm biến thể giữ hệ số ở 60 Hz và biến thể phổ chéo), tại σ_post và tại sai số warp; cờ vượt mép lưới B → `outputs/p2r/posthoc/{bound.csv, blur_ab.csv, meta.json}` |
`code_thesis/` là bản lưu trữ code luận văn. Giữ nguyên nội dung để đối chiếu: các script này còn đường dẫn máy cũ và ghi vào `outputs/`, nên cần một bản sao đã điều chỉnh đường dẫn nếu muốn chạy lại. Kiểm tra bộ artifact hiện có bằng `python scripts/00_data_manifest.py --dataset thesis --check`.