Rename protocol_p3 to protocol_p2r; close P2

protocol_p3 (cee2ff0) was the rerun of P2 on new realizations, not the
plan's phase P3 (F3 field). Renamed to P2r before any of realizations 8-15
was generated: protocol, D2 config, dev runner and summary script, output
dir outputs/p2/diag/p2rdev, tag protocol-p3 -> protocol-p2r. Protocol
content changes only names plus two notes in p2_outcome: the deviation from
protocol_p2's if_fail rule (pivot) and what the diagnosis did not test
(sigma_b, rock-physics stress). Re-locked: sha256 eb887311...

Docs: plan §12 item 12 and report section closing P2 (locked verdict kept,
diagnosis, decision, deviation, untested items, link to phase P3 / G-C).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 06:48:52 +00:00
parent cee2ff0859
commit f95123174f
16 changed files with 96 additions and 64 deletions

View File

@@ -18,7 +18,7 @@ Dữ liệu F3 Demo 2023 đặt ở `data/F3_Demo_2023/F3_Demo_2023/`, dữ li
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_p3_dev.sh # chuẩn bị P3 trên dev 900/901: screen, train, stability, sigma_a, f3, h3 (+ stability_m5, b3d_old, train_sa)
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)
```
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`:
@@ -31,7 +31,7 @@ scripts/runlog.sh ls # c
`logs/runs/` không đẩy lên git; `logs/index.csv` thì có thể commit. Các dòng có `source=backfill` là lần chạy trước ngày 27/10/2026, dựng lại từ log còn lại và transcript (trường nào không đo được thì để trống). Chạy lại sau khi bị ngắt: `11_run_d2.py`, `14_diag_posterior.py`, `15_diag_train.py` bỏ qua các ô đã có CSV kết quả; `05_lowo.py` và `12_h1_blur.py` chạy lại từ đầu.
P2 theo `configs/protocol_p2.yaml` (khoá bằng `configs/protocol_p2.sha256`) và bộ sinh `configs/d2_synth.yaml`. P3 (sau khi cổng G-B của P2 trượt) theo `configs/protocol_p3.yaml` (khoá bằng `configs/protocol_p3.sha256` và tag git `protocol-p3`) và `configs/d2_synth_p3.yaml` (cùng bộ sinh, thêm các chế độ SNR × mật độ anchor); mọi lựa chọn của P3 dựa trên dev 900/901, tổng hợp ở `outputs/p2/diag/p3dev/summary.md`; lưới chính dùng realization 8–15.
P2 theo `configs/protocol_p2.yaml` (khoá bằng `configs/protocol_p2.sha256`) và bộ sinh `configs/d2_synth.yaml`. P2r, tức chạy lại P2 trên realization mới sau khi cổng G-B trượt (không phải pha P3 F3 của plan), theo `configs/protocol_p2r.yaml` (khoá bằng `configs/protocol_p2r.sha256` và tag git `protocol-p2r`) và `configs/d2_synth_p2r.yaml` (cùng bộ sinh, thêm các chế độ SNR × mật độ anchor); mọi lựa chọn của P3 dựa trên dev 900/901, tổng hợp ở `outputs/p2/diag/p2rdev/summary.md`; lưới chính dùng realization 8–15.
Biến môi trường máy đặt sẵn `OMP_NUM_THREADS=40` (cả MKL, OpenBLAS): các script nhiều worker tự giới hạn luồng, còn khi chạy tay thì đặt rõ `OMP_NUM_THREADS`, `MKL_NUM_THREADS`, `OPENBLAS_NUM_THREADS` (và `CUDA_VISIBLE_DEVICES=` cho việc chỉ dùng CPU). Lý thuyết (Mệnh đề 1–2, chọn λ, các baseline là trường hợp riêng của RML): [docs/theory.md](docs/theory.md).
@@ -54,6 +54,6 @@ Biến môi trường máy đặt sẵn `OMP_NUM_THREADS=40` (cả MKL, OpenBLAS
| `scripts/14_diag_posterior.py [--snr] [--anchor-density] [--sigma-a-reg] [--particles] [--smc-seeds] [--device cuda:1]` | Chẩn đoán posterior warp trên dev: SMC tôi luyện có điều kiện seismic (γ = 1/κ, pha phase_R ước lượng qua log Z), sai số warp, độ phủ, σ_post → `outputs/p2/diag/…` |
| `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_p3_dev.py [--only …]` | Tổng hợp dev cho P3: screen, train/dose-response H2b, B(σ), stability, σ_a, F3 → `outputs/p2/diag/p3dev/summary.md` |
| `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` |
`test 2/` là bản lưu trữ code luận văn, không sửa.