From c1bbf02a7cb7ad4b5175db2cb501d47549d1bd76 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sat, 14 Nov 2026 01:50:13 +0100 Subject: [PATCH] Live rotation integrates at the radius the spot width gives, as offline does The broker's live mode (and --fast-live) held r1 at the default 4 px because the starvation near-tie is re-checked on the whole sweep, which fast_live never does. Nothing else needs the whole sweep: the spot width is measured on the pre-scan frames and the crowding of the widened background rings is counted on the pre-pass frames, both available to the live run before its canonical pass. A near tie now simply stays where the pre-pass decided it, like every other fast-live decision. Simulated live (--simulate-live 10 --fast-live), before -> after, now equal to the offline run: 360 deg trigonal sweep (r1 4 -> 6): ISa 18.97 -> 20.44, d 1.730 -> 1.717 A, Wilson B 58.3 -> 54.6, reported relative-B over the sweep 15.6 -> 10.9 A^2 monoclinic sweep (r1 widened): d 1.652 -> 1.556 A, ISa 9.8 -> 11.3, R_meas 17.5 -> 16.8% two sets the width leaves at r1 4: unchanged wall time: no increase (30 vs 33 s, 19 vs 24 s, 22 vs 22 s on a shared GPU) Not a free win on every axis: on the trigonal sweep the r1 4 merge reads better against a model (R-free 0.3617 vs 0.3628, shell-scaled R 0.318 vs 0.323, Fe anomalous peaks +1.2 sigma each), and a 10-set battery with --integration-radius 4 forced offline splits the same way (R-free better on 5 of 8, anomalous peak height worse on 5 of 7, one set loses its space group). The radius rule itself is the open question; this commit only makes live and offline give the same answer. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK --- docs/RUGNUX_CLI.md | 2 +- rugnux/RugnuxLive.cpp | 6 ++++-- rugnux/rugnux_cli.cpp | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/RUGNUX_CLI.md b/docs/RUGNUX_CLI.md index 8c09f27c7..f263db765 100644 --- a/docs/RUGNUX_CLI.md +++ b/docs/RUGNUX_CLI.md @@ -162,7 +162,7 @@ With the input already on disk, the URL is ignored. | `-t, --stride ` | Process every *n*-th image (default: 1) | | `-v, --verbose` | Show the whole log on the terminal in place of the steps; `_log.txt` is written either way | | `--simulate-live ` | Read a stored input as the collection it was while being written: image *i* becomes readable (*i*+1)·`ms` ms after the start (0: all at once). The run takes the live path a broker URL takes, with the same result; for testing the live workflow without a broker. `--mode mx` only | -| `--fast-live` | With `--simulate-live` or a broker URL: run as the broker's rugnux live mode does — every decision stands where it was first taken, nothing is re-checked or run again once the sweep is in, the integration radius is fixed, and SIGINT cuts the run to what it has established. A difficult crystal can come out worse | +| `--fast-live` | With `--simulate-live` or a broker URL: run as the broker's rugnux live mode does — every decision stands where it was first taken, nothing is re-checked or run again once the sweep is in (the integration radius from the spot width stays where the pre-pass frames put it), and SIGINT cuts the run to what it has established. A difficult crystal can come out worse | | `--sweeps joint\|separate` | Several rotation sweeps (see Inputs): `joint` (the default) merges them as one dataset into `.*`; `separate` processes each alone into `_s_*` | | `--no-gpu` | Run on the CPU only, as on a machine without a GPU, even where one is present: CUDA is not touched (nor, on macOS, the Apple GPU that Bragg integration, the model density and the molecular-replacement rotation function otherwise run on) and every GPU step takes its CPU path (`-X FFT` indexes with FFTW and `-X FFBIDX` with its CPU implementation; `-X cuFFT` is refused) | diff --git a/rugnux/RugnuxLive.cpp b/rugnux/RugnuxLive.cpp index 1732e781c..ec93ee2e3 100644 --- a/rugnux/RugnuxLive.cpp +++ b/rugnux/RugnuxLive.cpp @@ -59,8 +59,10 @@ RugnuxLiveSetup MakeRugnuxLiveSetup(const JFJochReaderDataset &dataset, int nthr c.refine = true; c.live = true; c.fast_live = true; - // Decided late, on the whole sweep, as it re-checks its radius there - which fast_live does not. - c.adaptive_integration_radius = false; + // The signal radius from the spot width of the pre-scan frames, as in `rugnux`; where the pre-pass + // counts the widened radius crowding the background rings the canonical pass keeps the default, and + // a near tie stays where it was decided (fast_live re-checks nothing on the whole sweep). + c.adaptive_integration_radius = true; return s; } diff --git a/rugnux/rugnux_cli.cpp b/rugnux/rugnux_cli.cpp index 1f113a7ed..5d1cb6a2a 100644 --- a/rugnux/rugnux_cli.cpp +++ b/rugnux/rugnux_cli.cpp @@ -3723,8 +3723,6 @@ int RugnuxInputRun::PrepareRugnuxInput() { config.finalist_ledger = finalist_ledger_flag; config.live = broker_feed || simulate_live; config.fast_live = fast_live && config.live; - if (config.fast_live) - config.adaptive_integration_radius = false; // as MakeRugnuxLiveSetup if (simulate_live) logger.Info("Simulated live collection: image i readable (i+1) x {:.1f} ms after the run starts", simulated_frame_time.count() / 1000.0);