Skip to content

Commit c981630

Browse files
committed
Harden prospective dense replay evaluation
1 parent f548a34 commit c981630

7 files changed

Lines changed: 321 additions & 18 deletions

File tree

‎active_solvai/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ results/phase1/cache/
66
simulations/**/output/
77
simulations/**/console_attempt_*.txt
88
simulations/**/Arbalest*.log
9+
simulations/**/FFDbLog/
910
simulations/**/*.trr
1011
simulations/**/*.coor
1112
simulations/**/*.vel
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Dense sentinel freeze amendment 001
2+
3+
**Date:** 2026-09-03 UTC
4+
**Original freeze commit:** `512aad3d46c25c28d590e76ebbd6cd2dc9be7186`
5+
6+
Before any prospective-sentinel dense window was generated, an implementation
7+
review identified that acquisition cannot use the standard error of an unqueried
8+
future window. Candidate observation noise is therefore fixed to the
9+
lambda-specific median five-block SEM measured only on the four calibration
10+
molecules. Once a window is actually acquired, its own measured SEM is used for
11+
posterior conditioning.
12+
13+
This is a leakage correction and does not change the molecule panel, response
14+
values, kernel candidates, acquisition objective, budgets, success criteria or
15+
any other frozen analysis choice. At the time of this amendment, several
16+
calibration windows had completed; no prospective-sentinel dense response had
17+
been generated or read.
18+
19+
For consistent provenance, all run-ledger rows refer to the original scientific
20+
freeze commit even when the runner implementation commit differs. Early
21+
calibration rows recorded the then-current implementation commit because the
22+
first runner version queried Git after each window; this metadata-only issue is
23+
retained in the append-only ledger and does not affect configurations or results.

‎active_solvai/scripts/calibrate_dense_models.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def main() -> None:
119119
)
120120
selected: dict[str, dict[str, float]] = {}
121121
all_curves = np.stack([curves[name] for name in names])
122+
all_sems = np.stack([sems[name] for name in names])
122123
generic_mean = all_curves.mean(axis=0)
123124
for prior_kind in ("generic", "solvai"):
124125
best = search.loc[search.prior.eq(prior_kind)].iloc[0]
@@ -143,6 +144,7 @@ def main() -> None:
143144
"initial_lambda_values": grid[initial].tolist(),
144145
"selection": selected,
145146
"generic_prior_mean": generic_mean.tolist(),
147+
"expected_sem_by_lambda": np.median(all_sems, axis=0).tolist(),
146148
"inputs": {
147149
"configuration": {"path": str(CONFIG), "sha256": sha256(CONFIG)},
148150
"calibration_responses": {"path": str(RESPONSES), "sha256": sha256(RESPONSES)},

‎active_solvai/scripts/evaluate_dense_sentinel.py‎

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ def sha256(path: Path) -> str:
4242
return digest.hexdigest()
4343

4444

45-
def bootstrap_interval(values: np.ndarray, seed: int, count: int) -> tuple[float, float]:
45+
def bootstrap_interval(
46+
values: np.ndarray, seed: int, count: int, level: float
47+
) -> tuple[float, float]:
4648
values = np.asarray(values, dtype=float)
4749
rng = np.random.default_rng(seed)
4850
sampled = values[rng.integers(0, len(values), size=(count, len(values)))].mean(axis=1)
49-
low, high = np.quantile(sampled, [0.025, 0.975])
51+
tail = (1.0 - level) / 2.0
52+
low, high = np.quantile(sampled, [tail, 1.0 - tail])
5053
return float(low), float(high)
5154

5255

@@ -203,6 +206,7 @@ def main() -> None:
203206
generic_mean = np.asarray(lock["generic_prior_mean"], dtype=float)
204207
generic_settings = lock["selection"]["generic"]
205208
solvai_settings = lock["selection"]["solvai"]
209+
expected_sem = np.asarray(lock["expected_sem_by_lambda"], dtype=float)
206210
generic_covariance = rbf_covariance(
207211
grid, generic_settings["amplitude"], generic_settings["lengthscale"]
208212
)
@@ -223,16 +227,10 @@ def main() -> None:
223227
solvai_settings["lengthscale"],
224228
local,
225229
)
226-
generic_expected_noise = np.full(
227-
len(grid),
228-
np.nanmedian(group.five_block_sem_kcal_mol.to_numpy(float)) ** 2
229-
* generic_settings["noise_inflation"],
230-
)
231-
solvai_expected_noise = np.full(
232-
len(grid),
233-
np.nanmedian(group.five_block_sem_kcal_mol.to_numpy(float)) ** 2
234-
* solvai_settings["noise_inflation"],
230+
generic_expected_noise = (
231+
expected_sem**2 * generic_settings["noise_inflation"]
235232
)
233+
solvai_expected_noise = expected_sem**2 * solvai_settings["noise_inflation"]
236234
schedules: list[tuple[str, int, list[int], np.ndarray, np.ndarray, float, bool]] = [
237235
(
238236
"fixed_solvai_bq",
@@ -424,17 +422,28 @@ def main() -> None:
424422
candidate.absolute_integral_error_kcal_mol
425423
- control.absolute_integral_error_kcal_mol
426424
).to_numpy(float)
427-
low, high = bootstrap_interval(
428-
difference, config["bootstrap_seed"], config["bootstrap_resamples"]
425+
low90, high90 = bootstrap_interval(
426+
difference,
427+
config["bootstrap_seed"],
428+
config["bootstrap_resamples"],
429+
0.90,
430+
)
431+
low95, high95 = bootstrap_interval(
432+
difference,
433+
config["bootstrap_seed"],
434+
config["bootstrap_resamples"],
435+
0.95,
429436
)
430437
comparisons.append(
431438
{
432439
"total_windows": budget,
433440
"candidate": "active_solvai_bq",
434441
"comparator": comparator,
435442
"candidate_minus_comparator_mae": float(difference.mean()),
436-
"ci95_low": low,
437-
"ci95_high": high,
443+
"ci90_low": low90,
444+
"ci90_high": high90,
445+
"ci95_low": low95,
446+
"ci95_high": high95,
438447
"fraction_candidate_improved": float(np.mean(difference < 0)),
439448
}
440449
)

‎active_solvai/scripts/run_dense_sentinel.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ def main() -> None:
7474
parser.add_argument("--omp", type=int, default=8)
7575
parser.add_argument("--timeout-minutes", type=float, default=30.0)
7676
parser.add_argument("--limit", type=int)
77+
parser.add_argument(
78+
"--freeze-commit",
79+
default="512aad3d46c25c28d590e76ebbd6cd2dc9be7186",
80+
help="Prospective protocol commit recorded for every attempt.",
81+
)
7782
args = parser.parse_args()
7883

7984
manifest = pd.read_csv(args.root / "manifest.csv")
@@ -173,9 +178,7 @@ def main() -> None:
173178
"nominal_bead_steps": 6250,
174179
"force_evaluations": None,
175180
"force_evaluation_note": "Arbalest does not expose exact fast/slow kernel call counts; nominal bead-steps are reported instead.",
176-
"freeze_commit": subprocess.check_output(
177-
["git", "rev-parse", "HEAD"], cwd=RELEASE_ROOT, text=True
178-
).strip(),
181+
"freeze_commit": args.freeze_commit,
179182
}
180183
status.append(record)
181184
pd.DataFrame(status).to_csv(status_path, index=False)

0 commit comments

Comments
 (0)