Commit Graph
17 Commits
Author SHA1 Message Date
leonarski_fandClaude Opus 5.5 2c1123c267 rugnux: calibration re-bin sums every image; clean out-of-host-memory failures
Calibration (--mode calibration): RebinAndRefit gave each worker one
AzimuthalIntegrationProfile that AzIntEngineCPU::Run clears on every
image, so the re-binned profile held only the last image each worker
read, added in completion order - on a 1800-frame LaB6 run the re-binned
fit changed with -N (197 / 181 / 205 ring points at rms ~7 px). Each
fixed block of images is now summed in image order into its own slot
(ParallelBlocks) and the slots added in block order, so the profile is
the sum over every image and the same at any thread count (rms 0.93 px,
identical at -N 1, 7 and 32). On the LaB6 runs with a sane header the
first pass still wins and the .poni is unchanged; with a header 100 px
off the re-binned fit is now adopted (218 vs 140 ring points). New test
Rugnux_CalibrationRebinsEveryImage spreads the rings over six frames
and fails on the old code (241 vs 141 points at -N 1 vs -N 4).

Host memory: out-of-memory now ends with "Processing failed: out of
host memory (...) - this data set needs more RAM than is available" and
exit 1. Tested with ulimit -v and an LD_PRELOAD allocator that refuses
allocations from a chosen phase (CPU and GPU builds, image loop through
merging and writing, calibration mode). Paths that crashed instead:
- PostIndexingRefinement ran candidate blocks on bare std::threads, so
  a bad_alloc there called std::terminate (seen: "terminate called
  recursively", SIGABRT); now std::async futures.
- FFTW aborts on its own failed allocation (CK(p) in kernel/alloc.c,
  also inside buffered transforms: BeamCenterFFTCPU, FFTIndexerCPU);
  rugnux now defines fftwf_assertion_failed to report it and exit 1.
- libjpeg's default error_exit calls exit() from the diagnostic-JPEG
  thread ("Insufficient memory (case 12)"); WriteJPEGToMem now
  longjmps back and throws (bad_alloc for JERR_OUT_OF_MEMORY).
- WorkerPool construction that fails to start a thread destroyed
  joinable threads (terminate); it now joins them and rethrows.
Also: length_error counts as a fatal resource error, pinned host
allocation failure is MemAllocFailed, and the GPU scaling fail-fast
message says the CPU path needs a lot of host memory.

Docs: very large cells and what running out of host memory looks like
(including the OOM killer) in RUGNUX_INSTALL.md, pointer in RUGNUX.md.

Validation: myob, cytc, lyso, sparse md5-identical to 82e6583e0 on
both GPU and CPU builds.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D1G8gJVAy6gp1K5Dz3NE5C
2026-09-28 23:25:54 +02:00
leonarski_f 53c90ee5d8 v1.0.0-rc.40 2025-05-28 18:49:27 +02:00
leonarski_f b245967df3 v1.0.0-rc.38 2025-05-12 14:17:24 +02:00
leonarski_f 040cf08386 v1.0.0-rc.36 2025-05-05 19:32:22 +02:00
leonarski_f 7564619574 version 1.0.0-rc.29 2024-12-08 13:26:13 +01:00
leonarski_f 71290f374a version 1.0.0-rc.27 2024-12-02 21:17:14 +01:00
leonarski_f 28d224afab version 1.0.0-rc.25 2024-11-22 21:25:20 +01:00
leonarski_f e812918e2e version 1.0.0-rc.13 2024-10-05 13:14:49 +02:00
leonarski_f 953c3fa972 Updates after MAX IV experiment 2024-06-03 10:56:43 +02:00
leonarski_f f85b87bfd2 PreviewImage: remove mutex 2024-05-23 22:58:52 +02:00
leonarski_f 949f693311 1.0.0-rc2: Fixes in preview 2024-05-16 17:41:47 +02:00
leonarski_f 91fd44bff7 Improve release/versioning of Jungfraujoch repository 2024-05-15 11:29:01 +02:00
leonarski_f ca54d66841 Preview improvements 2024-05-02 17:16:23 +02:00
leonarski_f 64dbd2291e Further enhacements 2024-04-29 14:13:35 +02:00
leonarski_f c6d2b5eedf File writer and spot finding improvements 2024-04-08 11:18:50 +02:00
leonarski_f 30e775d8a2 Improve plotting 2024-03-31 23:08:19 +02:00
leonarski_f babb1a5c8d Fixes after MAX IV experiment 2024-02-05 17:18:16 +01:00