Complete P3 F3 evaluation and Windows execution
Implement the frozen F3 protocol, nested LOWO, posterior label banks, ablations, diagnostics, checkpoint validation and full-volume inference. Record the negative G-C result: improvement at 1/4 wells, coverage80 52.38% and coverage90 60.91%, with unchanged thresholds and historical P2 results. Add native Windows logging, the RTX 3060 environment lock, detached runs, and an audited dashboard-lock recovery that preserves frozen scientific code. Update report.html, the plan and agent guidance with completed P3 status. Archive thesis sources under code_thesis with identical Git blobs and record the original-output audit without committing large data or model artifacts. Validation: 129 tests passed, 13 skipped; CUDA end-to-end smoke passed; completion audit verified 1,320 checkpoint/prediction pairs, 28 registration bundles and all 649 interior volume inlines. Scripts 04 and 09 were not rerun. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
47
docs/plan.md
47
docs/plan.md
@@ -3,7 +3,7 @@
|
||||
Ngày lập: **25/10/2026**. Mục tiêu: phát triển luận văn CNN–GRU trên F3 thành một **bài phương pháp đạt chuẩn tạp chí Q2** (hoặc hội nghị CORE B). Bài phải đánh vào một research gap mà các công trình hiện có chưa chạm tới.
|
||||
|
||||
Đầu vào của kế hoạch:
|
||||
- toàn bộ 8 script trong [`test 2/`](<test 2/>);
|
||||
- toàn bộ 8 script trong [`code_thesis/`](<../code_thesis/>);
|
||||
- báo cáo [LeVietHoangLam_22BI13235.pdf](docs/LeVietHoangLam_22BI13235.pdf) (47 trang);
|
||||
- survey [porosity-research-gap-survey.md](docs/research/porosity-research-gap-survey.md) (mã P01–P15 dưới đây là mã trong survey);
|
||||
- **kiểm tra trực tiếp dữ liệu F3** trong `F3_Demo_2023/`: LAS, marker TD, các mô hình TD của OpendTect và `.survey`;
|
||||
@@ -37,22 +37,24 @@ Quy ước nhãn:
|
||||
|
||||
| # | Vấn đề | Vị trí | Hệ quả |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | **Tọa độ giếng sai 5–11 km** [KT] | [prepare_data.py:17–21](<test 2/prepare_data.py>) | Mọi kết quả train/test đều lấy từ trace *không nằm tại giếng*; chi tiết ở mục 1.2a. |
|
||||
| 2 | TWT tích phân từ DT với t = 0 tại mẫu LAS đầu tiên, không hiệu chỉnh drift [KT] | [prepare_data.py:110](<test 2/prepare_data.py>) | Lệch so với marker TD trong cửa sổ tới 14–66 ms tùy giếng, và biến thiên theo độ sâu (mục 1.2b). |
|
||||
| 3 | Lag ước lượng bằng tương quan giữa seismic amplitude và PHIE, cho phép đảo cực, trong ±64 ms | [train_open_patch_v2.py:74–108, 294–299](<test 2/train_open_patch_v2.py>) | Seismic tỷ lệ với reflectivity, không với porosity, nên lag chọn được có thể chỉ là tương quan ngẫu nhiên. |
|
||||
| 4 | Giếng validation (F02-1) cũng là giếng train | [train_open_patch_v2.py:306–309](<test 2/train_open_patch_v2.py>) | Checkpoint "best" thực chất được chọn trên dữ liệu train. |
|
||||
| 1 | **Tọa độ giếng sai 5–11 km** [KT] | [prepare_data.py:17–21](<../code_thesis/prepare_data.py>) | Mọi kết quả train/test đều lấy từ trace *không nằm tại giếng*; chi tiết ở mục 1.2a. |
|
||||
| 2 | TWT tích phân từ DT với t = 0 tại mẫu LAS đầu tiên, không hiệu chỉnh drift [KT] | [prepare_data.py:110](<../code_thesis/prepare_data.py>) | Lệch so với marker TD trong cửa sổ tới 14–66 ms tùy giếng, và biến thiên theo độ sâu (mục 1.2b). |
|
||||
| 3 | Lag ước lượng bằng tương quan giữa seismic amplitude và PHIE, cho phép đảo cực, trong ±64 ms | [train_open_patch_v2.py:74–108, 294–299](<../code_thesis/train_open_patch_v2.py>) | Seismic tỷ lệ với reflectivity, không với porosity, nên lag chọn được có thể chỉ là tương quan ngẫu nhiên. |
|
||||
| 4 | Giếng validation (F02-1) cũng là giếng train | [train_open_patch_v2.py:306–309](<../code_thesis/train_open_patch_v2.py>) | Checkpoint "best" thực chất được chọn trên dữ liệu train. |
|
||||
| 5 | Chỉ có **2 chuỗi huấn luyện** (`X_train` có shape (2, 9, 126)); PDF mục 3.2.3 ghi "252 samples" | như trên; PDF tr. 23 | Mô tả trong bài không đúng; số "mẫu" độc lập thực tế là 2. |
|
||||
| 6 | Volume được giải chuẩn theo min–max [0, 1] trong khi train dùng Z-score | [predict_porosity_volume.py:75–89, 139](<test 2/predict_porosity_volume.py>), [plot_pred.py:33](<test 2/plot_pred.py>), [plot_porosity_maps.py:13](<test 2/plot_porosity_maps.py>) | Bản đồ porosity trong luận văn sai thang đo. |
|
||||
| 7 | L_shape ≈ 2·L_PCC − 2/L | [train_open_patch_v2.py:200–217](<test 2/train_open_patch_v2.py>) | Gọi là "6 loss" nhưng chỉ có 5 ràng buộc độc lập (survey mục 4.2). |
|
||||
| 8 | Log bước 0.15 m bị lấy mẫu xuống 4 ms bằng nội suy điểm, không lọc chống alias | [prepare_data.py:203–204, 318](<test 2/prepare_data.py>) | Nhãn bị alias. |
|
||||
| 9 | Clip [0, 0.4] che đi dữ liệu bất thường của F02-1 (PHIE lên tới 0.709) | [train_open_patch_v2.py:278–280](<test 2/train_open_patch_v2.py>) | Che một vấn đề định nghĩa nhãn (mục 1.2d). |
|
||||
| 6 | Volume được giải chuẩn theo min–max [0, 1] trong khi train dùng Z-score | [predict_porosity_volume.py:75–89, 139](<../code_thesis/predict_porosity_volume.py>), [plot_pred.py:33](<../code_thesis/plot_pred.py>), [plot_porosity_maps.py:13](<../code_thesis/plot_porosity_maps.py>) | Bản đồ porosity trong luận văn sai thang đo. |
|
||||
| 7 | L_shape ≈ 2·L_PCC − 2/L | [train_open_patch_v2.py:200–217](<../code_thesis/train_open_patch_v2.py>) | Gọi là "6 loss" nhưng chỉ có 5 ràng buộc độc lập (survey mục 4.2). |
|
||||
| 8 | Log bước 0.15 m bị lấy mẫu xuống 4 ms bằng nội suy điểm, không lọc chống alias | [prepare_data.py:203–204, 318](<../code_thesis/prepare_data.py>) | Nhãn bị alias. |
|
||||
| 9 | Clip [0, 0.4] che đi dữ liệu bất thường của F02-1 (PHIE lên tới 0.709) | [train_open_patch_v2.py:278–280](<../code_thesis/train_open_patch_v2.py>) | Che một vấn đề định nghĩa nhãn (mục 1.2d). |
|
||||
| 10 | **MSE = 0.015 (thang thật) tương ứng R² ≈ −9.8 trên F06-1** [KT] | PDF tr. 30, 35 | Nhãn dựng theo đúng cách của code có var(PHIE) trong cửa sổ = 0.00139 (std 0.037), nên MSE 0.015 *tệ hơn dự đoán bằng hằng số khoảng 10 lần*. Phát biểu "low MSE" là sai. |
|
||||
| 11 | So sánh với Prabowo dùng MSE 0.020 trong khi bảng gốc ghi 1.020 | PDF tr. 3, 35 | Survey mục 4.1. |
|
||||
| 12 | Trục thời gian của hình bị ngược (`origin="lower"`); `read_npz_output.py` đọc key `times_ms` không tồn tại; gọi `plt.show()` trước `savefig` | [plot_pred.py:75–76](<test 2/plot_pred.py>), [read_npz_output.py:16, 34–36](<test 2/read_npz_output.py>) | Hình trong luận văn cần vẽ lại. |
|
||||
| 13 | Đường dẫn Windows tuyệt đối, chỉ 1 seed, không có git; checkpoint `outputs/open_loop_patch_best.pt` không khớp tên `_v2.pt` mà script suy luận đọc | toàn bộ | Không tái lập được. |
|
||||
| 12 | Trục thời gian của hình bị ngược (`origin="lower"`); `read_npz_output.py` đọc key `times_ms` không tồn tại; gọi `plt.show()` trước `savefig` | [plot_pred.py:75–76](<../code_thesis/plot_pred.py>), [read_npz_output.py:16, 34–36](<../code_thesis/read_npz_output.py>) | Hình trong luận văn cần vẽ lại. |
|
||||
| 13 | Đường dẫn Windows tuyệt đối, chỉ 1 seed; bộ `outputs_thesis/` hiện đã có checkpoint `_v2.pt` (27/10/2026) | toàn bộ; [audit output](research/thesis-output-audit.md) | Cần điều chỉnh đường dẫn để chạy lại; chưa kiểm chứng checkpoint bằng suy luận. |
|
||||
|
||||
**Kết luận:** PCC 0.34 và MSE 0.015 *không phải* mốc so sánh hợp lệ. Phải dựng lại baseline (pha P1).
|
||||
|
||||
**Cập nhật output ngày 27/10/2026 [KT]:** `outputs_thesis/` có 7 artifact, gồm checkpoint và dự đoán v2 cùng volume `(651, 951, 126)` đọc được (278756708 byte). Metric tính trực tiếp trên 126 cặp dự đoán F06-1, không dịch thời gian: MSE = 0.0018714971, PCC = 0.02947452, R² = −0.3460; best-shift +16 mẫu chỉ cho PCC = 0.1068. Bộ này thay thế nhận định trước về thiếu v2 và volume rỗng. Dataset giữ nguyên SHA-256 nên audit geometry/TWT vẫn áp dụng. Chưa chạy lại checkpoint do môi trường hiện chưa có Python/PyTorch. Chi tiết: [audit output](research/thesis-output-audit.md), [manifest](../data_manifest/thesis_outputs.json).
|
||||
|
||||
### 1.2 Năm sự thật về dữ liệu định hình bài báo
|
||||
|
||||
**(a) Geometry [KT].** Vị trí thật tính từ phép biến đổi bin → XY trong `.survey`. Phép biến đổi đã được kiểm lại khớp với Set Point.1 (99/104 → 600938.13, 6073394.5). Tọa độ XY lấy từ header LAS và file track. Cả bốn giếng đều thẳng đứng.
|
||||
@@ -126,7 +128,7 @@ Hệ quả:
|
||||
**Tài nguyên khác [KT]:**
|
||||
- 7 horizon (Shallow, FS8, FS7, Truncation, Top-Foresets, FS6, MFS4) và FaultA. Đã tải đủ bản dataset đầy đủ ngày 26/10/2026, không còn placeholder.
|
||||
- Log GR, AI, AI_rel ở cả 4 giếng.
|
||||
- `F3_entire.segy` (1.29 GB) đã có trên đĩa (tải lại toàn bộ F3 Demo 2023, 9.43 GB, ngày 26/10/2026 [KT]: IL 100–750, XL 300–1250, 462 mẫu 4 ms, float32 IEEE). Thư mục `outputs/` vẫn chưa có.
|
||||
- `F3_entire.segy` (1.29 GB) đã có trên đĩa (tải lại toàn bộ F3 Demo 2023, 9.43 GB, ngày 26/10/2026 [KT]: IL 100–750, XL 300–1250, 462 mẫu 4 ms, float32 IEEE). Bộ output luận văn đã có trong `outputs_thesis/` (kiểm tra ngày 27/10/2026); `outputs/` dành cho kết quả pipeline nghiên cứu.
|
||||
|
||||
### 1.3 Ba hệ quả cho bài báo
|
||||
|
||||
@@ -440,7 +442,7 @@ scripts/ 01_build_wells.py, 02_tie.py, 03_train.py, 04_eval.py, 05_predi
|
||||
tests/ test_geometry.py (Set Point), test_tdr.py (monotone, honor anchors), test_losses.py (special cases ở 4.5)
|
||||
```
|
||||
|
||||
Giữ nguyên `test 2/` làm bản lưu trữ của luận văn; không sửa tại chỗ.
|
||||
Giữ nguyên [`code_thesis/`](../code_thesis/) làm bản lưu trữ của luận văn (đã đổi tên từ thư mục cũ ngày 27/10/2026); không sửa tại chỗ. Lưu output gốc trong [`outputs_thesis/`](../outputs_thesis/), theo dõi SHA-256 bằng `data_manifest/thesis_outputs.json`; `outputs/` dành cho pipeline nghiên cứu. Code lưu trữ vẫn chứa đường dẫn máy cũ, nên cần bản sao đã điều chỉnh đường dẫn nếu muốn chạy lại.
|
||||
|
||||
---
|
||||
|
||||
@@ -550,7 +552,7 @@ Trạng thái ngày 26/10/2026. "Có" nghĩa là toàn văn nằm trong [`refs/`
|
||||
## 12. Việc làm ngay (26/10–31/10/2026)
|
||||
|
||||
1. `git init` kèm `.gitignore` loại trừ dữ liệu và `outputs/`. Ghi lại hash của dữ liệu theo `cleanup-manifest.json`.
|
||||
2. ~~Tải về máy `F3_entire.segy` và các horizon.~~ **Đã xong ngày 26/10/2026** (tải F3 Demo 2023 đầy đủ qua gdown; 104 file đã lọc trước đó khớp byte-by-byte với bản mới). Còn thiếu `outputs/`.
|
||||
2. ~~Tải về máy `F3_entire.segy` và các horizon.~~ **Đã xong ngày 26/10/2026** (tải F3 Demo 2023 đầy đủ qua gdown; 104 file đã lọc trước đó khớp byte-by-byte với bản mới). Ngày 27/10/2026 đã bổ sung `outputs_thesis/`: 7 artifact, có checkpoint/dự đoán v2 và volume hợp lệ; xem [audit](research/thesis-output-audit.md).
|
||||
3. Viết `geometry.py` và test bằng Set Point; tạo lại bảng IL/XL ở mục 1.2a từ code.
|
||||
4. Viết `tdr.py` (marker-calibrated sonic) và vẽ hình drift 4 giếng (bản nháp F2).
|
||||
5. ~~Đo phổ seismic quanh 4 giếng.~~ **Đã xong ngày 26/10/2026** (mục 2.3): tần số trội khoảng 50–60 Hz, băng 4–83 Hz, f_c đề xuất 6 Hz.
|
||||
@@ -604,3 +606,20 @@ Trạng thái ngày 26/10/2026. "Có" nghĩa là toàn văn nằm trong [`refs/`
|
||||
- **Diễn giải bắt buộc:** B3d-Sa đã hơn point tie ở c = 0 (≈ 0.81), nên phần lớn lợi của H2a không do drift; phần gắn với drift là B3d-Sa gần Oracle và không đổi khi c tăng (R10, N = 16: 0.457 → 0.455) trong khi B3d xấu đi (0.484 → 0.675). Ở phần lớn ô rộng c = 1, lợi của H2b vượt cận 1/B(σ_post), nên không quy hết cho khử nhoè. c = 2 có cờ "unstable posterior", không là bằng chứng chính.
|
||||
- **H3 (mô tả):** mọi ensemble, kể cả Oracle, under-cover (coverage 90% từ 0.31 đến 0.79, trung vị 0.47); không claim calibration.
|
||||
- **Vận hành:** lưới bị ngắt lúc 09:44 khi phiên Claude kết thúc; chạy tiếp từ các CSV đã ghi (scripts 14/15 bỏ qua job đã xong; mọi file đã kiểm tra đọc được). Seed của mỗi job cố định nên kết quả không phụ thuộc lịch chạy.
|
||||
15. **Triển khai P3 trên máy Windows / RTX 3060 (đêm 27–28/10/2026, trước kết quả P3):**
|
||||
- Đã pull Gitea `main` từ `5a6fb2f` lên `a22f9d9`, đọc `AGENTS.md` và rà code theo bốn skill: scientific-critical-thinking, scikit-learn, statistical-analysis, scientific-visualization. Chi tiết lỗi, cách sửa và giới hạn ở [p3-code-review.md](research/p3-code-review.md). Bộ test: 129 đạt, 13 bỏ qua do nền tảng/dữ liệu tùy chọn; không coi test phần mềm là bằng chứng đạt G-C.
|
||||
- Protocol F3 dùng tên `configs/protocol_f3.yaml`; khóa trước registration/train bằng script 19. Khóa gồm code, môi trường và dữ liệu; giữ nguyên ngưỡng G-C. F3 đã được xem trong P1 nên đây là follow-up mô tả trên cùng bốn giếng, không phải tập field hoàn toàn chưa quan sát.
|
||||
- Nested LOWO 4 vòng ngoài × 3 vòng trong, 5 seed; dùng lại trajectory có cùng hai giếng train. Vòng trong chọn một budget chung theo MSE validation trung bình, hòa chọn sớm nhất; ensemble 3 mô hình vòng trong × 5 seed khi chấm giếng ngoài. Không refit trên nhãn giếng ngoài. Đối thủ point tie cho G-C cũng chọn bằng validation, không chọn theo test.
|
||||
- Lưới gồm 1.320 trajectory tối đa 2.000 bước, hai nhãn PHIE_DT/PHIE, 12 ablation trên nhãn chính và hai nhánh σ_a = 3.5/14 ms. σ_a chính 7 ms kế thừa P2r, không được xem là giá trị đúng trên F3. Leave-one-anchor-out dùng xấp xỉ GP tuyến tính chỉ có anchor và phải ghi rõ không kiểm định calibration của SMC.
|
||||
- Volume đầy đủ dùng ensemble triển khai 20 mô hình (4 tập ba giếng × 5 seed), chỉ có tính mô tả. Viền thiếu patch 3×3 để NaN. Chỉ giảm phạm vi sang section khi có yêu cầu rõ ràng, không tự hạ yêu cầu vì chậm.
|
||||
- Môi trường Windows: Python 3.12.16, torch 2.11.0+cu128, driver 577.00; giữ riêng `requirements-windows-rtx3060.txt`, không thay lock Linux. Cube và bảy horizon phục hồi từ bản Thesis khớp SHA-256 gốc. Chỉ script 01 được chạy để dựng dữ liệu; **không chạy lại script 04 và 09** theo yêu cầu người dùng, hai artifact cũ được kiểm tra hash trong khóa P3.
|
||||
- Benchmark so sánh 1/2/3/4/6 tiến trình: 4 nhanh nhất (khoảng 319 bước/s), riêng train 1,6–3,3 giờ. Pilot registration chỉ dùng cặp giếng train, không chọn thiết kế bằng điểm test; tổng dự toán sau pilot ở `outputs/p3/progress.json`. Khoảng thời gian là ngoại suy vận hành, không phải khoảng tin cậy.
|
||||
- Người dùng đã cho phép chủ động chạy full qua đêm. Driver `scripts/run_p3.ps1 -Stage all -Device cuda:0 -Workers 4 -Detach` chạy nền ẩn, giữ máy thức khi process còn sống, lưu log và resume có checksum. [report.html](../report.html) đọc sidecar cập nhật mỗi 10 giây; trạng thái chuẩn và kết quả G-C nằm trong `outputs/p3/`. Không thay đổi kết luận P2/P2r.
|
||||
- **Đã khóa và khởi chạy:** SHA-256 protocol `0c756d2825d9b6aa1520be6484f501a538f2ec14e5c8fe98a323cf3b6e1bc50c`, khóa 00:14 ngày 28/10. Smoke CUDA toàn tuyến (6 registration, 18 train job, diagnostics và summary) hoàn tất, G-C cố ý không chấm. Full P3 chạy nền từ 00:15:47 ngày 28/10, dự kiến 2,57–6,35 giờ (khoảng 02:49–06:37 giờ máy). Trạng thái thực tế tiếp tục ghi tự động; giờ dự kiến không phải cam kết kết quả khoa học.
|
||||
16. **Kết quả P3 F3 và sự cố vận hành (28/10/2026):**
|
||||
- Đã hoàn tất 1.320 trajectory LOWO, 12 ablation, hai nhánh σ_a, diagnostics/LOAO, summary và 20 mô hình triển khai volume. Kết quả ở `outputs/p3/summary/`.
|
||||
- **G-C KHÔNG ĐẠT cả hai điều kiện.** M2-Sa chỉ cải thiện band RMSE tại F03-4 (1/4 giếng), cần ≥ 3/4. Đối thủ được vòng validation chọn là B3c-R ở cả bốn giếng. Tỷ số M2-Sa/B3c-R lần lượt F02-1: 1,00769; F03-2: 1,00023; F03-4: 0,98105; F06-1: 1,07028. Không thay đối thủ sau khi xem test.
|
||||
- Coverage macro 80% là 52,38% (cần 75–85%); coverage 90% là 60,91% (cần 85–95%). Band RMSE macro M2-Sa 1,27229 p.u., B3c-R 1,25591 p.u. Không claim calibration, không mở rộng khoảng sau khi xem test. Kết quả F3 không ủng hộ ưu thế field của M2-Sa theo protocol này; không thay kết luận P2/P2r.
|
||||
- Lượt chạy nền đầu dừng lúc 03:57:33 sau 3 giờ 41 phút 46 giây: Windows từ chối thay file `progress.js` khi volume đã ghi 132/649 inline. Log lỗi giữ nguyên ở `logs/runs/20261028-001548_p3_all/`. Đây là lỗi cập nhật dashboard, không phải huấn luyện hoặc gate.
|
||||
- Phục hồi bằng `operations/resume_f3_volume.py`: chỉ thêm retry cho hai file dashboard khi bị khóa, gọi nguyên hàm suy luận đã khóa, không chạy lại registration/train hoặc script 04/09. Mã khoa học, protocol, checkpoint và G-C không đổi; kiểm tra SHA-256 khóa và byte của 132 inline cũ trước/sau. Lưu provenance ở `outputs/p3/volume_recovery.json`; trạng thái hoàn tất volume thực tế đọc trong [report.html](../report.html).
|
||||
- **P3 hoàn tất lúc 06:50:44 ngày 28/10.** Volume đủ 649 inline trong, shape 651×951×126 gồm viền NaN, mean và sigma, kèm 8 hình section. Adapter gặp lại đúng lỗi khóa dashboard một lần và retry thành công. Không đổi byte của 132 inline cũ; khóa code/dữ liệu/môi trường và G-C vẫn khớp. Kiểm tra artifact cuối ở `outputs/p3/completion_checks.json`; nhiệm vụ P3 hoàn thành, cổng khoa học G-C trượt.
|
||||
|
||||
139
docs/research/p3-code-review.md
Normal file
139
docs/research/p3-code-review.md
Normal file
@@ -0,0 +1,139 @@
|
||||
# P3 implementation review before the main experiment
|
||||
|
||||
Date: 27 October 2026. Repository pulled from Gitea `main`, fast-forward from
|
||||
`5a6fb2f` to `a22f9d9`. The incoming commits add `AGENTS.md` and ten agent skills;
|
||||
they do not change the scientific pipeline. Existing local work was preserved.
|
||||
|
||||
This review concerns the new, uncommitted P3 implementation. The original P2
|
||||
G-B failure and the registered P2r results remain unchanged. No P3 main grid
|
||||
has been run and no field outcome was used to select the fixes below.
|
||||
|
||||
## Findings and changes
|
||||
|
||||
| Finding | Consequence | Resolution |
|
||||
| --- | --- | --- |
|
||||
| Training workers loaded held-out labels and markers even though the optimizer did not use them. | The software boundary did not enforce the blind-well rule. | Training data views now expose only training logs/markers and seismic-only targets. Access to held-out labels or logs raises an error. A perturbation test verifies that changing the current outer well's labels cannot change its checkpoint or prediction. |
|
||||
| A completed prediction cache could be accepted without its checkpoint. | A resumed job could later fail at deployment or mix artifacts. | Prediction and checkpoint checksums, fingerprints, atomic checkpoint writes, and matching-pair validation are required. |
|
||||
| Missing porosity logs were extended by interpolation without a support check. | Warped labels could include values outside the measured interval. | Keep measured-support masks, exclude invalid warp particles, assign zero mass to invalid anchor samples, record retained counts, and fail if too few particles remain. AI's constant edge extension is a separate forward-model assumption. |
|
||||
| The SMC class required anchors, so the new no-anchor ablation could not run. | The ablation failed before sampling. | Add an explicit opt-in prior-only initialization with empty anchor operators; the existing P2 default still requires anchors. Exercise both paths on synthetic wells. |
|
||||
| P3 depended on scripts and P1 settings outside its initial code fingerprint. | Editing a classical-baseline dependency could escape resume validation. | The P3 lock covers all project Python modules/scripts, the Windows driver, baseline settings, prepared data, raw well inputs, and package versions. |
|
||||
| The original run logger imported POSIX-only modules. | Logging and detached execution failed on native Windows. | Add Windows process groups and CSV locking; retain POSIX behavior. Unavailable resource/VRAM measurements remain null. Test nested child logging on both platforms; POSIX signal semantics are explicitly skipped on Windows. |
|
||||
| The `all` command stopped before volume fitting/prediction. | A command named `all` did not complete the P3 deliverables. | Connect deployment fitting and streamed volume prediction; reduced scope requires explicit flags. |
|
||||
| Volume uncertainty used subtraction of large second moments. | Rounding could erase a small predictive variance. | Use a stable online variance calculation and test a small variance around a large mean. |
|
||||
| A resume state could outlive a missing volume file. | Completed rows could be skipped even though their predictions were gone. | Refuse that inconsistent resume state. |
|
||||
| Smoke and intermediate stages could mark full ablation/protocol tasks complete. | `report.html` could overstate progress. | Separate smoke, protocol, training, diagnostics and volume states; mark the combined ablation task complete only after its required outputs exist. |
|
||||
| Plot lines relied on color, and intervals lacked a precise definition. | Visual comparisons and uncertainty could be misread. | Add distinct line styles, shared scales, PNG/PDF outputs and a source/interval manifest. Intervals are nominal, moment-matched Gaussian predictive intervals, with calibration evaluated separately. |
|
||||
|
||||
## Scientific boundaries retained
|
||||
|
||||
- The sampling unit is the well: four outer folds, each with three inner
|
||||
validation folds. Network seeds and 126 time samples do not increase the
|
||||
number of independent field wells.
|
||||
- Registration, normalization, wavelet estimation, label banks, and LFM inputs
|
||||
use the exact inner training wells. The outer well supplies seismic input;
|
||||
logs and markers enter only the separate scoring/sensitivity stage.
|
||||
- Checkpoints use inner validation total MSE. The point baseline for G-C is
|
||||
selected from inner validation, never by outer-test performance.
|
||||
- G-C retains improvement at at least three of four wells and the original
|
||||
coverage tolerances. Failure is reported; no post-hoc interval widening or
|
||||
replacement by a better-looking ablation is allowed.
|
||||
- F3 was already observed in P1. P3 is a descriptive follow-up on the same four
|
||||
wells, not an untouched independent field replication.
|
||||
- `B3d-Sa` averages forward maps `t(tau)` before inversion, matching P2r; it is
|
||||
not the mean inverse map or mean porosity label.
|
||||
- LOAO uses an explicitly identified linearized, anchor-only GP approximation.
|
||||
It is not evidence that the SMC posterior is calibrated.
|
||||
- The no-anchor ablation retains the common sonic datum. It is an information
|
||||
removal diagnostic, not a new proof of absolute-time identifiability.
|
||||
- The LFM ablation appends a training-only time trend. It is not the
|
||||
horizon-guided classical inversion baseline.
|
||||
- Maps report sonic-derived porosity and predictive dispersion. They do not
|
||||
establish geological validity or calibrated uncertainty.
|
||||
|
||||
## Validation status
|
||||
|
||||
- Whole existing and P3 unit suite: **129 passed, 13 skipped** (Windows/POSIX
|
||||
differences and unavailable optional datasets), recorded by `runlog`.
|
||||
- Included synthetic-well integration: **2 passed**. It exercises the complete
|
||||
registration/label-bank paths with and without anchors, without using real
|
||||
held-out F3 outcomes.
|
||||
- Final command-line, dashboard syntax and production-device checks are
|
||||
recorded in `outputs/p3/review_checks.json` when completed.
|
||||
- The streamed volume patch order was checked against `SeismicCube.patch` on
|
||||
the real F3 cube. The cube and all seven restored horizons match the original
|
||||
manifest's SHA-256 values.
|
||||
- The real-data CUDA registration pilot used only `F02-1` and `F03-2`, with
|
||||
P = 1024. The anchor-conditioned path took 122.3 seconds; removing anchors
|
||||
took 256.7 seconds. Both completed. Outputs remain in the benchmark namespace,
|
||||
separate from the registered experiment.
|
||||
- A classical-baseline compatibility check produced finite 126-sample
|
||||
predictions for B0a, B0b ridge/RF/GBM, and B1. It did not calculate held-out
|
||||
performance or change settings from such performance.
|
||||
- The protocol was frozen before any P3 smoke or production run. Its SHA-256
|
||||
is `0c756d2825d9b6aa1520be6484f501a538f2ec14e5c8fe98a323cf3b6e1bc50c`.
|
||||
The lock additionally checks the two protected historical artifacts; volume
|
||||
prediction verifies the cube again. The scheduler emits a heartbeat every
|
||||
30 seconds while waiting, and its Windows process prevents automatic sleep
|
||||
only for its own lifetime.
|
||||
- The full-runtime extrapolation is **2.57–6.35 hours** on the measured RTX
|
||||
3060 setup with four workers. It includes registration, training, deployment,
|
||||
scoring allowance and full-volume prediction; it is not a confidence interval.
|
||||
- A full P3 experiment is separate from these correctness/timing checks;
|
||||
passing tests and completing a smoke run are not scientific G-C verdicts.
|
||||
|
||||
The locked CUDA smoke completed on 28 October (6 registration jobs, 18 training
|
||||
jobs, scoring diagnostics and summary, exit 0). Its gate file explicitly says
|
||||
`evaluated: false`. The complete production command was then launched detached
|
||||
at **00:15:47 +07:00 on 28 October**, with four workers on `cuda:0`. Its progress
|
||||
and eventual verdict are published automatically to `report.html` through
|
||||
`outputs/p3/progress.js`; this review does not pre-judge that verdict.
|
||||
|
||||
## Post-run operational interruption and recovery (28 October)
|
||||
|
||||
The full run completed registration, all 1,320 LOWO training trajectories,
|
||||
diagnostics, scoring, and the 20 deployment models. It then stopped at 132/649
|
||||
volume inlines at 03:57:33 +07:00: Windows denied atomic replacement of the
|
||||
dashboard sidecar `outputs/p3/progress.js`. The exception handler encountered
|
||||
the same lock. This was a publication failure, after model fitting and scoring;
|
||||
the original failed log is retained at `logs/runs/20261028-001548_p3_all/`.
|
||||
|
||||
`operations/resume_f3_volume.py` is an explicitly post-run operational adapter.
|
||||
It retries permission errors only for the two dashboard files, and defers a
|
||||
persistently locked sidecar to the next update instead of aborting inference.
|
||||
It calls the original frozen volume function, never registration or fitting.
|
||||
The registered Python source, protocol, checkpoints, inference formula and
|
||||
G-C remain unchanged. The adapter records its own hash and verifies the bytes
|
||||
of the 132 previously completed rows before/after recovery. Its audit record
|
||||
is `outputs/p3/volume_recovery.json`; the original protocol lock remains valid.
|
||||
|
||||
The completed LOWO result is **G-C failed**: M2-Sa improved band RMSE at one of
|
||||
four wells, and macro coverage was 52.38% (nominal 80%) and 60.91% (nominal 90%).
|
||||
Neither gate condition passes. Volume completion cannot change this verdict.
|
||||
|
||||
Recovery completed at **06:50:44 +07:00 on 28 October**, exit 0. The same dashboard
|
||||
lock recurred once during inference and the retry succeeded. All 649 interior
|
||||
inlines and eight section previews were produced; the previously completed rows
|
||||
and G-C file were preserved byte-for-byte. The frozen code/data/environment
|
||||
check still passes. The independent artifact audit is recorded in
|
||||
`outputs/p3/completion_checks.json`.
|
||||
|
||||
## Protected artifacts and execution constraints
|
||||
|
||||
Do not run `04_wavelet_tie.py` or `09_fit_warp_prior_f3.py`. Do not overwrite
|
||||
`outputs/wavelets.npz` or `outputs/p2/warp_prior_f3.json`. P3 estimates its own
|
||||
fold-local quantities in its own output namespace. The frozen P1/P2/P2r YAML
|
||||
content is preserved; LF checkout rules retain the original locked bytes on
|
||||
Windows. No other user's GPU processes are stopped.
|
||||
|
||||
## Procedural assistance and provenance
|
||||
|
||||
Applied the local `scientific-critical-thinking`, `scikit-learn`,
|
||||
`statistical-analysis`, and `scientific-visualization` skills for review guidance.
|
||||
Their use does not constitute independent empirical validation of this code.
|
||||
|
||||
Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026).
|
||||
*Scientific Agent Skills: A Library of Procedural Knowledge for Research Agents.*
|
||||
[arXiv:2609.00065](https://arxiv.org/abs/2609.00065).
|
||||
[DOI: 10.48550/arXiv.2609.00065](https://doi.org/10.48550/arXiv.2609.00065).
|
||||
Metadata verified against the current arXiv record (v2) on 27 October 2026;
|
||||
no journal reference is listed there.
|
||||
@@ -12,7 +12,7 @@ Ngày chốt tìm kiếm: **23/10/2026**. Mục tiêu: bài phương pháp có
|
||||
- Research gap dưới đây là **gap ứng viên trong nhóm tài liệu đã rà soát**, không phải chứng nhận rằng chưa ai từng làm trên toàn bộ literature.
|
||||
- Không lập bảng xếp hạng MSE/R² giữa các paper khác dataset, đơn vị, preprocessing, lượng giếng và kiểu ground truth.
|
||||
|
||||
Tài liệu dự án đối chiếu: [báo cáo hiện tại](../../outputs/LeVietHoangLam_22BI13235.pdf), [code huấn luyện v2](</Users/hola/Downloads/test 2/train_open_patch_v2.py>), [chuẩn bị dữ liệu](</Users/hola/Downloads/test 2/prepare_data.py>) và [suy luận volume](</Users/hola/Downloads/test 2/predict_porosity_volume.py>).
|
||||
Tài liệu dự án đối chiếu: [báo cáo hiện tại](../LeVietHoangLam_22BI13235.pdf), [code huấn luyện v2](<../../code_thesis/train_open_patch_v2.py>), [chuẩn bị dữ liệu](<../../code_thesis/prepare_data.py>) và [suy luận volume](<../../code_thesis/predict_porosity_volume.py>).
|
||||
|
||||
## 2. Những công trình cần đặt cạnh bài của bạn
|
||||
|
||||
|
||||
46
docs/research/thesis-output-audit.md
Normal file
46
docs/research/thesis-output-audit.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Kiểm tra output luận văn
|
||||
|
||||
Ngày kiểm tra: **27/10/2026**. Code nằm ở [`code_thesis/`](../../code_thesis/); output gốc ở [`outputs_thesis/`](../../outputs_thesis/); kích thước và SHA-256 của cả 7 file nằm trong [manifest](../../data_manifest/thesis_outputs.json).
|
||||
|
||||
## Bộ artifact hiện có
|
||||
|
||||
| File | Kích thước (byte) | Kết quả kiểm tra |
|
||||
| --- | ---: | --- |
|
||||
| `f3_wells_dataset.npz` | 439189 | Có 3 giếng F03-4, F02-1, F06-1; SHA-256 trùng dataset đã audit ngày 26/10 |
|
||||
| `open_loop_patch_best_v2.pt` | 680434 | Đọc được cấu trúc ZIP của PyTorch; metadata có GRU tầng 2, `head_skip` và `bias`, phù hợp kiến trúc v2 |
|
||||
| `open_loop_patch_preds_F06-1_v2.npz` | 5316 | 126 mẫu; có `time`, `y_true`, `y_pred`, bản Z-score và thống kê chuẩn hóa |
|
||||
| `porosity_volume_600_1100ms.npz` | 278756708 | `vol` float32, shape `(651, 951, 126)`; 78006726 giá trị hữu hạn, không còn rỗng |
|
||||
| `porosity_comparison_F06-1.png` | 87965 | Đã ghi SHA-256 |
|
||||
| `plots/F06-1_overlay.png` | 94437 | Đã ghi SHA-256 |
|
||||
| `plots/F06-1_overlay_scatter.png` | 48344 | Đã ghi SHA-256 |
|
||||
|
||||
Kiểm tra được thực hiện bằng cách đọc ZIP/NPY, tính SHA-256 và tính lại metric trực tiếp từ các mảng dự đoán đã lưu. Máy hiện chưa có Python/PyTorch, nên **chưa chạy suy luận lại checkpoint** và chưa giải tuần tự các object giếng trong dataset. Nhận định về kiến trúc checkpoint dựa trên metadata, chưa phải kiểm chứng đầu ra của mô hình.
|
||||
|
||||
## Kết quả F06-1 từ file v2
|
||||
|
||||
Tính trên 126 cặp `y_true`/`y_pred` đã lưu, không dịch thời gian:
|
||||
|
||||
| Metric | Giá trị |
|
||||
| --- | ---: |
|
||||
| MSE, thang porosity | 0.0018714971 |
|
||||
| RMSE | 0.04326080 (4.326 p.u.) |
|
||||
| PCC | 0.02947452 |
|
||||
| R² | -0.34600558 |
|
||||
| std(pred) / std(true) | 0.48645224 |
|
||||
| MSE, thang Z-score | 1.48250972 |
|
||||
|
||||
`y_mu = 0.2904474239`, `y_std = 0.0355300465`, `C = 9`. Dự đoán porosity nằm trong `[0.25163853, 0.34457749]`. File lưu `lags = (3, 0, -13)` theo thứ tự F03-4, F02-1, F06-1. Trong code v2 hiện có, nhãn test được giữ nguyên; lag test chỉ được in để chẩn đoán.
|
||||
|
||||
Thử best-shift theo đúng quy ước của `best_shift_metrics` trong khoảng ±16 mẫu cho lag +16 (64 ms), còn 110 cặp: PCC 0.10677496, MSE 0.0015107914. Kết quả này khớp `best_shift_real = 16` đã lưu. Đây là chẩn đoán dùng nhãn test, không phải metric blind test. Cả hai cách tính đều chưa khớp PCC 0.34 / MSE 0.015 được trích từ luận văn.
|
||||
|
||||
## Thang đo volume và các ghi chú cần thay thế
|
||||
|
||||
Volume lưu giá trị trong `[-3.84333062, 3.74447894]`, cùng `y_lo = 0.2319448653`, `y_hi = 0.4878670500`. Trong code suy luận, `vol` là đầu ra thô của mạng; các script vẽ giải chuẩn bằng min–max `y_lo`/`y_hi`, trong khi code train v2 dùng Z-score `y_mu`/`y_std`. Vấn đề thang đo đã nêu trong plan vẫn còn; không diễn giải trực tiếp `vol` như porosity vật lý.
|
||||
|
||||
Nhận định ngày 26/10 về checkpoint v1, PCC 0.18 và volume 0 byte thuộc bộ file cũ. Bộ hiện tại đã có v2 và volume đọc được. Dataset giữ nguyên SHA-256, nên các phát hiện trước về tọa độ giếng và TWT vẫn áp dụng. Nội dung 8 script trong `code_thesis/` khớp bản trước khi đổi tên sau khi chuẩn hóa xuống dòng.
|
||||
|
||||
Giữ code và output gốc để đối chiếu. Pipeline nghiên cứu tiếp tục dùng `ml_porosity/`, `scripts/` và ghi vào `outputs/`. Khi đã có môi trường Python của dự án, kiểm tra lại manifest bằng:
|
||||
|
||||
```bash
|
||||
python scripts/00_data_manifest.py --dataset thesis --check
|
||||
```
|
||||
@@ -68,7 +68,7 @@ Với phổ seismic thật của F3 (tâm khoảng 50 Hz):
|
||||
|
||||
Chỉ cần σ_δ = 8 ms là gần như toàn bộ chi tiết mà seismic có thể cung cấp bị xoá khỏi mục tiêu học. Trên F3, sai số thực tế còn lớn hơn thế.
|
||||
|
||||
Phép tính này giải thích các "triệu chứng" của mô hình trong luận văn gốc (code trong `test 2/`):
|
||||
Phép tính này giải thích các "triệu chứng" của mô hình trong luận văn gốc (code trong `code_thesis/`):
|
||||
- dự đoán bị trơn (smoothing);
|
||||
- phải thêm loss khớp phương sai (L_Var) vì dự đoán co biên độ;
|
||||
- phải thêm bước tìm best-shift ±64 ms.
|
||||
|
||||
Reference in New Issue
Block a user