Files
Jungfraujoch/tests
leonarski_fandClaude Opus 5 7db76560a6 beam centre: the background fit stops at its fixed point, and reads the pixels on every thread
The background ring fit is the largest single phase of an offline run on a large
detector: 626 s of a 5403 s hundred-dataset battery, against 127 s for the
beam-stop projection it reads. The cost is not spread over its invocations - the
worst single invocation per dataset accounts for 516 s of that 626 s - and the
worst one is always the second pass, at the post-refined geometry, where the fit
starts essentially at the answer.

Instrumented per iteration, that invocation is not a truncated walk. It reaches
its answer at iteration 4 and then enters a period-2 limit cycle: the step
alternates in sign every iteration at a fixed 0.30 px, and the centre oscillates
by 0.08 px about a value it knows to 1.75 px, for the 96 iterations left in the
budget. CONVERGED_PXL sits below the cycle amplitude, so the run can never meet
it; whether a dataset costs 5 s or 55 s is decided by whether its cycle happens
to fall under 0.02 px. Travel looks nothing like that - a fit forced to walk
339 px keeps its step direction through all 22 of its travelling iterations and
takes steps of 75 px down to 0.1 px - so the sign of the step against the one
before it separates the two without any length to compare against.

Two changes, measured apart.

The walk now also stops when its step reverses the previous one twice running,
which is a crossing of the fixed point rather than a step toward it.
MAX_ITERATIONS stays at 100, so the long-travel budget is untouched: the forced
339 px walk arrives as before, in 27 iterations instead of 29, 0.013 px away. A
monotone fit is bit-identical. The two cycling invocations measured go from 100
iterations to 7 and 9, moving 0.11 and 0.16 px - under 6% of the sigma each
reports, and the hundredth iteration was itself an arbitrary point on the cycle.

The per-pixel passes - a rotation, a sqrt, two atan2 and two divisions each, over
18 Mpx, three times an iteration - now run on the threads the caller was given,
split over a fixed 64 row blocks folded in block order, so the grouping of the
sums is a property of the image and not of the machine. Serial against six
threads on the same projection in the same process: 4.2-5.3x, with beam_x, beam_y
and sigma identical to four decimals on all five fits measured, and a test that
asserts one thread and eight give the same answer.

Together, measured on the same phase boundary the battery numbers use: 57.7 s to
2.4 s and 54.5 s to 3.0 s on the two worst datasets, 0.23 s to 0.10 s on a small
one. The beam-stop mask is untouched - ShadowFinder is not modified and the fit
runs after it and writes nothing back - and both masks come out at exactly the
pixel counts the unmodified binary logged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-09 18:40:45 +02:00
..
2026-08-13 17:03:10 +02:00
2026-07-19 09:39:28 +02:00
2026-07-19 09:39:28 +02:00
2026-04-09 13:30:47 +02:00
2024-10-05 13:14:49 +02:00
2024-10-05 13:14:49 +02:00
2025-05-05 19:32:22 +02:00
2026-09-02 21:17:31 +02:00
2026-09-09 07:25:13 +02:00
2026-04-29 09:50:50 +02:00
2026-08-13 17:03:10 +02:00
2026-08-13 17:03:10 +02:00
2026-09-02 21:17:31 +02:00
2026-09-09 07:25:13 +02:00
2026-05-28 18:48:35 +02:00
2025-05-05 19:32:22 +02:00
2026-09-09 07:25:13 +02:00
2025-06-10 18:14:04 +02:00
2026-09-02 21:17:31 +02:00
2025-11-19 09:40:50 +01:00
2026-04-29 09:50:50 +02:00
2026-08-25 08:21:39 +02:00
2026-09-02 21:17:31 +02:00
2026-08-13 17:03:10 +02:00
2024-11-22 21:25:20 +01:00
2025-10-20 20:43:44 +02:00
2025-04-14 11:52:06 +02:00
2025-11-09 12:42:27 +01:00
2025-09-08 20:28:59 +02:00
2025-09-08 20:28:59 +02:00
2025-03-24 12:16:33 +01:00
2026-09-02 21:17:31 +02:00
2025-06-18 15:19:18 +02:00
2026-09-02 21:17:31 +02:00
2026-09-09 07:25:13 +02:00
2025-12-12 21:24:20 +01:00
2026-02-01 13:29:33 +01:00
2026-03-03 22:24:44 +01:00
2025-11-19 09:40:50 +01:00
2026-08-13 17:03:10 +02:00
2026-08-13 17:03:10 +02:00
2026-09-09 07:25:13 +02:00
2025-05-05 19:32:22 +02:00
2024-11-22 21:25:20 +01:00
2026-09-09 07:25:13 +02:00
2026-08-25 08:21:39 +02:00
2026-09-02 21:17:31 +02:00
2024-11-22 21:25:20 +01:00
2025-05-28 18:49:27 +02:00
2026-06-23 20:29:49 +02:00
2026-09-02 21:17:31 +02:00
2026-09-09 07:25:13 +02:00
2024-11-22 21:25:20 +01:00
2026-09-09 07:25:13 +02:00
2026-09-09 07:25:13 +02:00
2026-09-09 07:25:13 +02:00
2025-03-02 13:15:28 +01:00
2026-06-08 08:30:35 +02:00
2026-08-25 08:21:39 +02:00
2025-11-09 12:42:27 +01:00
2026-08-13 17:03:10 +02:00
2026-08-27 22:16:54 +02:00
2024-11-22 21:25:20 +01:00
2025-11-09 12:42:27 +01:00
2025-10-01 22:54:40 +02:00
2026-09-02 21:17:31 +02:00
2026-09-02 21:17:31 +02:00
2026-09-09 07:25:13 +02:00
2026-09-02 21:17:31 +02:00
2026-09-02 21:17:31 +02:00
2026-06-23 20:29:49 +02:00
2026-06-23 20:29:49 +02:00
2026-06-23 20:29:49 +02:00
2026-09-02 21:17:31 +02:00
2026-08-13 17:03:10 +02:00
2026-08-26 22:47:00 +02:00
2026-09-09 07:25:13 +02:00
2026-08-25 08:21:39 +02:00
2026-09-09 07:25:13 +02:00
2026-09-09 07:25:13 +02:00
2026-03-02 15:57:12 +01:00
2025-11-09 12:42:27 +01:00
2026-09-02 21:17:31 +02:00
2026-07-11 07:19:11 +02:00
2026-06-23 20:29:49 +02:00
2026-04-16 11:59:59 +02:00
2026-06-23 20:29:49 +02:00
2025-11-02 13:45:57 +01:00
2025-12-12 21:24:20 +01:00
2026-09-09 07:25:13 +02:00
2026-09-09 07:25:13 +02:00
2026-05-28 18:48:35 +02:00
2026-09-09 07:25:13 +02:00
2026-08-13 17:03:10 +02:00
2026-09-02 21:17:31 +02:00
2026-03-05 22:13:12 +01:00
2026-03-26 20:50:33 +01:00
2024-11-22 21:25:20 +01:00
2026-08-13 17:03:10 +02:00