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:
69
scripts/24_run_volve.py
Normal file
69
scripts/24_run_volve.py
Normal file
@@ -0,0 +1,69 @@
|
||||
"""P4 Volve: lock -> register -> train -> summarize (configs/protocol_volve.yaml).
|
||||
|
||||
Full run on the run machine: python scripts/24_run_volve.py all --device cuda:0 --workers 4
|
||||
Then the σ_a arms: python scripts/24_run_volve.py all --arms sensitivity, then summarize --arms all
|
||||
Smoke (CPU, reduced settings, outputs/p4/smoke): register/train only until the protocol is locked; never a result.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import traceback
|
||||
|
||||
os.environ.setdefault("OMP_NUM_THREADS", "2")
|
||||
os.environ.setdefault("MKL_NUM_THREADS", "2")
|
||||
os.environ.setdefault("OPENBLAS_NUM_THREADS", "2")
|
||||
os.environ.setdefault("NUMBA_NUM_THREADS", "2")
|
||||
os.environ.setdefault("PYTHONHASHSEED", "0")
|
||||
os.environ.setdefault("PYTHONUTF8", "1")
|
||||
os.environ.setdefault("CUBLAS_WORKSPACE_CONFIG", ":4096:8")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
from ml_porosity.paths import outputs_dir
|
||||
from ml_porosity.volve.protocol import freeze, load_protocol
|
||||
from ml_porosity.volve.runner import benchmark, progress, run
|
||||
|
||||
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
ap.add_argument("stage", choices=["status", "benchmark", "lock", "register", "train", "summarize", "all"])
|
||||
ap.add_argument("--device", default="cuda:0")
|
||||
ap.add_argument("--workers", type=int, default=4)
|
||||
ap.add_argument("--arms", choices=["primary", "sensitivity", "all"], default="primary")
|
||||
ap.add_argument("--smoke", action="store_true")
|
||||
ap.add_argument("--benchmark-steps", type=int, default=100)
|
||||
args = ap.parse_args()
|
||||
if args.workers < 1:
|
||||
ap.error("--workers must be positive")
|
||||
p = load_protocol()
|
||||
root = outputs_dir() / "p4" / ("smoke" if args.smoke else "")
|
||||
if os.name == "nt":
|
||||
import ctypes
|
||||
# Prevent automatic system sleep only while this process is alive.
|
||||
ctypes.windll.kernel32.SetThreadExecutionState(0x80000001)
|
||||
try:
|
||||
if args.stage == "status":
|
||||
path = root / "progress.json"
|
||||
print(path.read_text(encoding="utf-8") if path.exists() else "P4 has not started.")
|
||||
elif args.stage == "benchmark":
|
||||
print(benchmark(p, args.device, args.benchmark_steps))
|
||||
elif args.stage == "lock":
|
||||
print(freeze())
|
||||
else:
|
||||
stages = ["register", "train", "summarize"] if args.stage == "all" else [args.stage]
|
||||
if args.smoke and args.stage == "all":
|
||||
stages = ["register", "train"] # summarize needs the lock, see runner.run
|
||||
for stage in stages:
|
||||
run(stage, p, args.device, args.workers, args.smoke, args.arms)
|
||||
except Exception as exc:
|
||||
if args.stage not in ("status", "lock", "benchmark"):
|
||||
progress(root, status=f"error in {args.stage}; completed jobs can resume", error=str(exc))
|
||||
traceback.print_exc()
|
||||
raise SystemExit(1)
|
||||
finally:
|
||||
if os.name == "nt":
|
||||
ctypes.windll.kernel32.SetThreadExecutionState(0x80000000)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user