Skip to content

Commit d447827

Browse files
committed
fill_prof_email: --hardware + --platform also flow into the hydration body
The hydration template hardcoded "Apple M5 Max (40-core GPU), OpenMM Metal backend" and "friend's M5 Max overnight" — the binding template already honored --hardware/--platform but the hydration one ignored them. Today's pilot-3 run on Henry's MacBook CPU produced the right verdict (MAE 1.42 PASS) but the generated email body was wrong about where it ran. Fix: thread hardware_hint + platform_hint into HYDRATION_TEMPLATE the same way they go into BINDING_TEMPLATE; soften the intro sentence to drop the M5-Max-specific phrasing. 10/10 regression covers the new "hardware lands in body" test + verifies the M5 Max hardcoding can never silently regress (asserts "Apple M5 Max" is NOT in the override output). Now I can re-generate Henry's prof email with the correct hardware ("Henry's MacBook Pro M-series, CPU platform") instead of hand- editing the draft.
1 parent f7b8fe4 commit d447827

2 files changed

Lines changed: 38 additions & 3 deletions

File tree

scripts/fill_prof_email.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242
Hi {prof_name},
4343
4444
Quick update on Milestone A. The CellSim Layer-1.3 alchemical FEP
45-
pipeline is now end-to-end on a Mac and the FreeSolv-12 hydration
46-
gate ran on a friend's M5 Max overnight. Results below.
45+
pipeline is now end-to-end and the FreeSolv-12 hydration gate has
46+
run. Results below.
4747
4848
== What ran ==
4949
50-
- Hardware: Apple M5 Max (40-core GPU), OpenMM Metal backend
50+
- Hardware: {hardware_hint} (OpenMM {platform_hint} backend)
5151
- Force field: OpenFF Sage 2.1.0 (small molecules) + AM1-BCC partial
5252
charges + TIP3P water — no learned surrogate at any layer
5353
- MD: openmmtools.alchemy + GHMC integrator (Metropolised Langevin),
@@ -399,6 +399,8 @@ def main(argv: list[str] | None = None) -> int:
399399
acetamide_sign = _grab_compound_sign(md, "acetamide") or "<missing>"
400400
filled = HYDRATION_TEMPLATE.format(
401401
prof_name=args.prof_name,
402+
hardware_hint=args.hardware,
403+
platform_hint=args.platform,
402404
overall_verdict=overall,
403405
n_ok=n_ok,
404406
n_total=n_total,

tests/fep/test_fill_prof_email_smoke.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,38 @@ def test_prof_name_override():
223223
assert "Hi [Prof]," not in out
224224

225225

226+
def test_hydration_hardware_override_lands_in_body():
227+
"""--hardware / --platform must reach the hydration body, not
228+
just the binding one. Earlier the hydration template had M5 Max
229+
hardcoded; pilot-3 CPU run on Henry's MacBook exposed the
230+
hardcoding and pushed a parametrisation."""
231+
with tempfile.TemporaryDirectory(
232+
prefix="cellsim_fill_") as tmp:
233+
tmp = Path(tmp)
234+
_write_report_with_overrides(
235+
tmp, kind="hydration", verdict="PASS",
236+
rows_table=(
237+
"| methane | `C` | +2.00 | +1.78 | 0.15 | -0.22 | "
238+
"0.22 | ✓ | 4290 | |\n"
239+
"| acetamide | `CC(=O)N` | -9.71 | -8.90 | 0.55 | "
240+
"+0.81 | 0.81 | | 560 | |"))
241+
rc, out = _run_fill(
242+
tmp,
243+
"--hardware", "Henry's MacBook Pro M-series, 16 GB RAM",
244+
"--platform", "CPU (Reference/CPU only; no Metal)")
245+
assert rc == 0, out
246+
assert "Henry's MacBook Pro M-series, 16 GB RAM" in out, (
247+
"hydration body must use --hardware override; got:\n"
248+
f"{out[:800]}")
249+
assert "OpenMM CPU (Reference/CPU only; no Metal) backend" in out, (
250+
"hydration body must use --platform override; got:\n"
251+
f"{out[:800]}")
252+
# The old M5 Max hardcoding must be gone for the hydration path.
253+
assert "Apple M5 Max" not in out, (
254+
"hydration template still has M5 Max hardcoded; got:\n"
255+
f"{out[:800]}")
256+
257+
226258
def test_fail_case_fixture_hydration():
227259
"""End-to-end on the committed fail_case fixture — methane
228260
sign flipped, MAE 1.67. Email reflects both failures."""
@@ -262,6 +294,7 @@ def test_fail_case_fixture_hydration():
262294
test_missing_numbers_returns_exit_2,
263295
test_no_report_md_returns_exit_1,
264296
test_prof_name_override,
297+
test_hydration_hardware_override_lands_in_body,
265298
test_fail_case_fixture_hydration,
266299
]
267300
fails = []

0 commit comments

Comments
 (0)