|
22 | 22 | RESPONSES = ACTIVE_ROOT / "results/phase2/dense_responses_calibration.parquet" |
23 | 23 | PHASE1_PRIORS = ACTIVE_ROOT / "results/phase1/phase1_response_predictions.parquet" |
24 | 24 | OUT = ACTIVE_ROOT / "release/DENSE_SENTINEL_CALIBRATION_LOCK.json" |
| 25 | +OUT_MD = ACTIVE_ROOT / "release/DENSE_SENTINEL_CALIBRATION_LOCK.md" |
25 | 26 |
|
26 | 27 |
|
27 | 28 | def load_priors(names: list[str], grid: np.ndarray) -> dict[str, np.ndarray]: |
@@ -53,6 +54,13 @@ def nlpd(y: np.ndarray, mean: np.ndarray, variance: np.ndarray) -> float: |
53 | 54 |
|
54 | 55 |
|
55 | 56 | def main() -> None: |
| 57 | + prospective_energy = list( |
| 58 | + (ACTIVE_ROOT / "simulations/dense_pimd2/prospective").glob("**/output/*__SYSTEM.ene") |
| 59 | + ) |
| 60 | + if prospective_energy: |
| 61 | + raise AssertionError( |
| 62 | + "Prospective sentinel responses already exist; calibration lock must precede them" |
| 63 | + ) |
56 | 64 | config = json.loads(CONFIG.read_text()) |
57 | 65 | grid = np.asarray(config["lambda_grid"], dtype=float) |
58 | 66 | initial = np.array([2, 6, 12], dtype=int) |
@@ -150,10 +158,27 @@ def main() -> None: |
150 | 158 | "calibration_responses": {"path": str(RESPONSES), "sha256": sha256(RESPONSES)}, |
151 | 159 | "phase1_priors": {"path": str(PHASE1_PRIORS), "sha256": sha256(PHASE1_PRIORS)}, |
152 | 160 | "search_table": {"path": str(search_path), "sha256": sha256(search_path)}, |
| 161 | + "calibration_script": { |
| 162 | + "path": str(Path(__file__).resolve()), |
| 163 | + "sha256": sha256(Path(__file__).resolve()), |
| 164 | + }, |
153 | 165 | }, |
154 | 166 | "note": "No prospective sentinel dense response was generated or read before this lock.", |
155 | 167 | } |
156 | 168 | OUT.write_text(json.dumps(payload, indent=2) + "\n") |
| 169 | + OUT_MD.write_text( |
| 170 | + "# Dense sentinel calibration lock\n\n" |
| 171 | + "This file records the automatically selected Gaussian-process settings before any " |
| 172 | + "prospective-sentinel dense response was generated. Selection followed the committed " |
| 173 | + "protocol in `DENSE_SENTINEL_FREEZE.md`; no setting was selected using endpoint error.\n\n" |
| 174 | + f"- Calibration response SHA-256: `{payload['inputs']['calibration_responses']['sha256']}`\n" |
| 175 | + f"- Phase 1 prior SHA-256: `{payload['inputs']['phase1_priors']['sha256']}`\n" |
| 176 | + f"- Generic prior: length scale `{selected['generic']['lengthscale']}`, noise inflation " |
| 177 | + f"`{selected['generic']['noise_inflation']}`, amplitude `{selected['generic']['amplitude']:.8f}` kcal mol^-1.\n" |
| 178 | + f"- SolvAI-conditioned prior: length scale `{selected['solvai']['lengthscale']}`, noise inflation " |
| 179 | + f"`{selected['solvai']['noise_inflation']}`, amplitude `{selected['solvai']['amplitude']:.8f}` kcal mol^-1.\n" |
| 180 | + "- Prospective dense responses available at lock time: `0`.\n" |
| 181 | + ) |
157 | 182 | print(json.dumps(payload, indent=2)) |
158 | 183 |
|
159 | 184 |
|
|
0 commit comments