From 7c622f9e7ffd917cc50075d01df10161c1ec6d33 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Tue, 13 Oct 2026 16:07:33 +0200 Subject: [PATCH] rugnux: the scaling engine's card memory goes back before molecular replacement The rotation merge engine is released before model validation decides whether its GPU path fits, but a predicted model (or --mr) skips that validation and went into molecular replacement with the engine still on the card - about 10 GB on the AF 9v16 run, which then failed with 0.0 GB free on some runs and on the others got fewer rigid-body engines. It is now released before the search too, on the same condition (no finalist-ledger merge still running on it). Card peak of that run 15.75 -> 14.05 GB; MR keys identical. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01EizBKhTqrAYago9KJG3dA3 --- rugnux/RugnuxScaleMerge.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rugnux/RugnuxScaleMerge.cpp b/rugnux/RugnuxScaleMerge.cpp index aab638267..f94b76f95 100644 --- a/rugnux/RugnuxScaleMerge.cpp +++ b/rugnux/RugnuxScaleMerge.cpp @@ -4124,6 +4124,10 @@ bool Rugnux::ScaleMergeAndSymmetry(PipelineLocals &p) { phase("Molecular replacement"); Step("Molecular replacement"); TimingMark mark(logger, "model prior"); + // As before the validation above, which a predicted model or --mr does not run: the engine's card + // memory goes back before the search sizes its rigid-body engines from what the card has free. + if (!ledger_ahead.valid()) + rsm.reset(); std::vector merges{{"MERGE", &sm.merged, *result.consensus_cell, experiment_.GetSpaceGroupOrP1()}}; if (twin_file) merges.push_back({"TWIN_SUBGROUP_MERGE", &twin_file->merged, twin_file->cell, twin_file->space_group,