Refinement: a trajectory step taken on R-work alone is followed by one more at most

On a model refined before, R-work falls step after step while R-free does not, and the trajectory ends at its best
anyway; each such step is a wave of trials. A model of 490k atoms spent six of them (240 s of a 760 s refinement) on
a round it then gave back; with the rule it refines to the same R-free in 620 s. On 28 refinements of 22 deposited
models and 6 predictions the rule changed nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UqXYdJDrM65gxsCn2PrbfK
This commit is contained in:
leonarski_fandClaude Fable 5.1 committed 2026-11-14 13:23:10 +01:00
1 parent 44b905de1d
commit 5f8a5814f0
1 file changed
+7 -1
@@ -2779,7 +2779,12 @@ RefinementResult RefineOnce(const gemmi::Structure &placed, const std::vector<Me
TrialOutcome best = state;
from_best.clear();
bool state_is_best = true;
for (int step = 0; step < settings.max_steps && state.ran && !ctx.Cancelled(); step++) {
// A step taken on R-work alone is followed by one more at most: on a model refined before, R-work falls
// step after step while R-free does not, and the trajectory ends at its best anyway - a model of 490k
// atoms spent six such steps (240 s) on a round it then gave back. (On 28 refinements of 22 deposited
// models and 6 predictions the rule changed nothing.)
int since_best = 0;
for (int step = 0; step < settings.max_steps && state.ran && !ctx.Cancelled() && since_best <= 1; step++) {
const double w = state.trial.weight, adp = state.trial.adp_weight, ncs_s = state.trial.ncs_sigma;
std::vector<TrialWeights> trials = {{w, adp, ncs_s}};
if (step % 2 == 1 && adp > 0) {
@@ -2812,6 +2817,7 @@ RefinementResult RefineOnce(const gemmi::Structure &placed, const std::vector<Me
break;
state = std::move(outcomes[k]);
state_is_best = (fresh && step == 0) || displaces(state.trial, best.trial);
since_best = state_is_best ? 0 : since_best + 1;
if (state_is_best) {
best = state;
from_best.clear();