The polarization plane (measured_plane in ShadowFinder) put the 18 M pixels of
a 16M detector into their sectors on one thread - an atan2, a ring position and
a push_back per pixel - and pooled them over a box with two serial pixel loops.
The pixels now go into their sectors by blocks in parallel, through the same
counting scatter the rings use (bin_by_ring, with the sector as the key), and
the pooling loops are ParallelChunks. A sector's median is an order statistic
of its values, so neither the order they come in nor the full sort bin_by_ring
does (nth_element before) can change it.
The pass after the pre-scan builds its azimuthal mapping at a geometry that is
final once the beam stop has decided the polarization plane: the shadow and
defective-pixel bits added after it do not enter what the geometry cache keeps
(AzimuthalIntegrationMapping applies the mask to its copy). So that mapping is
now built into the run's geometry cache there, beside the defective-pixel pass
(Rugnux::MappingsAhead), and the pass finds it in the cache - waiting under the
cache's lock where it is still being built. Offline the pre-scan's own spot
measurement has built it already and this is a cache hit; live (no spot
measurement) it was built in the gap before the first pass.
Thau, offline (-N 28 -e 1000 --model 5a47), "pre-scan beam stop" 1.33/1.16 s
-> 0.77/0.63 s; cytc 1.21/1.12 -> 0.79/0.59 s; lyso_x06da_ref 0.20/0.21 ->
0.13/0.14 s. The offline pre-scan step does not move: the spot measurement
beside it is the longer branch.
Live replay (thau, 1000 EIGER 16M frames at 100 Hz, idx-simplon harness, the
quiet runs): from the main line's last pre-scan frame read to its first pass
2.58-2.63 s -> 1.85-1.94 s (beam stop 1.25-1.31 -> 0.70; the gap after the
defective pixels 0.67-0.68 -> 0.44-0.51); the probe's beam stop 1.29-1.31 ->
0.80-0.82 s.
Outputs identical to the base binary (thau, cytc, lyso offline; MTZ data,
maps, models, blobs and the live status live).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK