Skip to content

Commit f97af0a

Browse files
committed
[fix.physics.rho.D8-] the remedy the cost gate prescribes erases the answer, so I withdrew it
I shipped a basis selector two commits ago because the refusal said "use a smaller basis (sto-3g is ~31 s here)". Then I measured what that basis does to the question this panel exists to answer, on molecules whose answer is not in doubt: def2-SVP 6-31G STO-3G bromobenzene 44.02 σ-hole 1 refused 18.85 σ-hole 0 chlorobenzene 31.60 σ-hole 1 38.42 σ1 13.94 σ-hole 0 fluorobenzene 18.01 σ-hole 0 25.81 σ0 12.52 σ-hole 0 STO-3G finds ZERO σ-holes on bromobenzene and chlorobenzene. It does not make the number less precise — it flips the classification. Every halogen comes back looking like fluorine, which is the one element that genuinely has no σ-hole and the whole reason this panel and the halogen audit exist. A chemist picking the fast option to get an answer sooner gets the OPPOSITE answer, rendered identically. So STO-3G is withdrawn from this panel, with the measurement printed next to the control rather than in a commit nobody reads. The list stops at 6-31G. What replaces it is the remedy that does not cost the conclusion: a budget selector (90 / 300 / 900 s) that is actually SENT. It never was — post()'s third argument only set the client-side abort, so the server always used its own default and the refusal's second suggestion, "raise max_seconds deliberately", could not be taken from the interface at all. The def2-SVP controls double as a positive control for the endpoint and it passes cleanly: Br 44.0 > Cl 31.6 > F 18.0 with σ-hole counts 1, 1 and 0. Fluorobenzene's positive maximum sits on the ring hydrogens, not on the C–F axis, and the classifier says so — the exact distinction PLIP's geometry-only test cannot make. NOT RESOLVED, and newly surfaced: def2-SVP on lapatinib with a 900 s budget does not time out, it FAILS — "RYS_build_jk kernel for (dp|dd) failed" — a GPU kernel error on the d-function combinations that basis brings in for S and Cl. A 6-31G retry returned "cudaErrorDevicesUnavailable: device busy", which is another session warming caches on the same GPU, so that one says nothing about the molecule. Both need isolating on a quiet GPU and on CPU before anyone concludes anything about lapatinib; I am not claiming the budget fix makes this molecule work.
1 parent 31642a7 commit f97af0a

2 files changed

Lines changed: 36 additions & 4 deletions

File tree

‎src/app.frontend.facets.molstar-rdkit.editable/facets/ligand-physics/index.ts‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,16 +328,35 @@ function selectedBasis(): string {
328328
return el?.value || 'def2-svp';
329329
}
330330

331+
/**
332+
* The remedy that actually works on a large ligand.
333+
*
334+
* The cost gate's first suggestion is a smaller basis, and for THIS question that
335+
* suggestion is wrong: measured on this backend, STO-3G reports zero σ-holes on both
336+
* bromobenzene and chlorobenzene, which carry one at def2-SVP (44.0 and 31.6 kcal/mol).
337+
* It does not make the number less precise, it flips the classification the panel exists
338+
* to produce. So the basis list stops at 6-31G and the budget is what the user raises —
339+
* and max_seconds is now actually SENT, which it never was: post()'s third argument only
340+
* ever set the client-side abort, so the server always used its own default and the
341+
* refusal's "raise max_seconds deliberately" was unreachable from the interface.
342+
*/
343+
function selectedBudget(): number {
344+
const el = document.getElementById('phys-budget') as HTMLSelectElement | null;
345+
const v = parseInt(el?.value || '', 10);
346+
return Number.isFinite(v) && v > 0 ? v : BUDGET_SECONDS;
347+
}
348+
331349
async function runSurface() {
332350
if (!molfile || busy) return;
333351
setBusy(true);
334352
const basis = selectedBasis();
353+
const budget = selectedBudget();
335354
setStatus('phys-surface-status',
336355
`Solving surface electrostatics on ${ligandLabel ?? 'ligand'} in ${basis}… `
337-
+ `(gives up at ${BUDGET_SECONDS} s · Cancel to stop now)`, 'busy');
356+
+ `(gives up at ${budget} s · Cancel to stop now)`, 'busy');
338357
const generation = ligandGeneration;
339358
try {
340-
const out = await post('/surface/mep', { molfile, basis }, BUDGET_SECONDS);
359+
const out = await post('/surface/mep', { molfile, basis, max_seconds: budget }, budget);
341360
if (!isCurrentLigandGeneration(generation)) {
342361
setStatus('phys-surface-status',
343362
'Ligand changed while solving — result discarded rather than '

‎src/app.frontend.facets.molstar-rdkit.editable/index.html‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@
793793
.bond-atlas-block { margin-top: var(--sp-4, 16px); padding-top: var(--sp-3, 12px); border-top: 1px solid var(--border); }
794794
.phys-basis-label { display: inline-flex; align-items: center; gap: var(--sp-1, 4px); color: var(--text-3); font-size: var(--fs-2xs, 9px); letter-spacing: var(--track-wide, .08em); text-transform: uppercase; }
795795
.phys-basis-label select { text-transform: none; letter-spacing: normal; }
796+
.phys-why-warn { border-left: 2px solid var(--warn); padding-left: var(--sp-2, 8px); }
796797
.halogen-block { margin-top: var(--sp-3, 12px); padding-top: var(--sp-3, 12px); border-top: 1px dashed var(--border); }
797798
.halogen-note-inline { color: var(--text-3); font-size: var(--fs-2xs, 9px); letter-spacing: var(--track-wide, .08em); text-transform: uppercase; }
798799
.halogen-row { border-left: 2px solid var(--border-strong); padding: var(--sp-2, 8px) 0 var(--sp-2, 8px) var(--sp-2, 8px); margin-bottom: var(--sp-2, 8px); }
@@ -1476,8 +1477,14 @@ <h3>σ-hole · surface electrostatics</h3>
14761477
<label class="phys-basis-label">Basis
14771478
<select id="phys-basis">
14781479
<option value="def2-svp" selected>def2-SVP · has iodine</option>
1479-
<option value="6-31g">6-31G · faster</option>
1480-
<option value="sto-3g">STO-3G · fastest</option>
1480+
<option value="6-31g">6-31G · faster, no Br/I</option>
1481+
</select>
1482+
</label>
1483+
<label class="phys-basis-label">Budget
1484+
<select id="phys-budget">
1485+
<option value="90" selected>90 s</option>
1486+
<option value="300">300 s</option>
1487+
<option value="900">900 s · large ligand</option>
14811488
</select>
14821489
</label>
14831490
<button type="button" class="phys-btn" id="phys-run-surface">Compute</button>
@@ -1487,6 +1494,12 @@ <h3>σ-hole · surface electrostatics</h3>
14871494
<p class="phys-why">A halogen with no σ-hole cannot make a halogen
14881495
bond however good the geometry looks. The angle is the evidence:
14891496
below 150° from the C–X axis a positive cap is not a σ-hole.</p>
1497+
<p class="phys-why phys-why-warn">STO-3G is <b>not offered here</b>, although it is
1498+
three times faster and the cost gate recommends it. Measured on this backend:
1499+
it finds <b>zero</b> σ-holes on bromobenzene and chlorobenzene, both of which
1500+
have one at def2-SVP (44.0 and 31.6 kcal/mol). A minimal basis does not shrink
1501+
the answer, it erases it — every halogen comes back looking like fluorine. For
1502+
a large ligand raise the budget instead; that costs time, not the conclusion.</p>
14901503
<div id="phys-surface-status" class="field-status" data-tone="idle">Load a ligand first.</div>
14911504
<div id="phys-surface-body"></div>
14921505

0 commit comments

Comments
 (0)