From b146cd6f8933da09ac5e48bade736a37726cd1ce Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sun, 8 Nov 2026 10:47:07 +0100 Subject: [PATCH] receiver, image_analysis: fix comments that describe removed behaviour Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK --- image_analysis/IndexAndRefine.h | 6 +++--- image_analysis/MXAnalysisWithoutFPGA.h | 6 +++--- receiver/JFJochReceiver.cpp | 6 +++--- receiver/JFJochReceiverService.cpp | 3 +-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/image_analysis/IndexAndRefine.h b/image_analysis/IndexAndRefine.h index 5809a8864..3ddec8a6f 100644 --- a/image_analysis/IndexAndRefine.h +++ b/image_analysis/IndexAndRefine.h @@ -25,9 +25,9 @@ #include "scale_merge/ScalingResult.h" #include "IntegrationOutcome.h" -// Integrates the predicted reflections off whatever image the caller holds: the preprocessed GPU/CPU -// buffer on the WithoutFPGA path (GPU when available), or the assembled detector image read straight, -// on the CPU, on the forced-CPU FPGA path. Keeps IndexAndRefine independent of the image representation. +// Integrates the predicted reflections off whatever image the caller holds, the preprocessed GPU/CPU +// buffer of MXAnalysisWithoutFPGA (GPU when available). Keeps IndexAndRefine independent of the image +// representation. using BraggIntegrateFn = std::function( const std::vector &predicted, size_t npredicted, int64_t image_number)>; diff --git a/image_analysis/MXAnalysisWithoutFPGA.h b/image_analysis/MXAnalysisWithoutFPGA.h index d333d6831..63e7d2eb4 100644 --- a/image_analysis/MXAnalysisWithoutFPGA.h +++ b/image_analysis/MXAnalysisWithoutFPGA.h @@ -60,9 +60,9 @@ class MXAnalysisWithoutFPGA { ImageSpotFinder &FixedThresholdFinder(); // Self-calibrating finder, used when spot settings request adaptive detection. Kept alongside the // default finder because the choice arrives with the per-image settings, not at construction. It is - // an AdaptiveSpotFinderCPU by default; on the GPU path, when the fused engine is enabled (rugnux - // offline only), it is instead an AdaptiveSpotFinderGPU that also computes the azimuthal profile, - // aliased through fused_adaptive so Analyze() can take that profile and skip the separate azint pass. + // an AdaptiveSpotFinderCPU by default; on the GPU path, when the fused engine is enabled (rugnux, + // the viewer and the receivers), it is instead an AdaptiveSpotFinderGPU that also computes the + // azimuthal profile, aliased through fused_adaptive so Analyze() can take that profile and skip the separate azint pass. std::unique_ptr adaptiveSpotFinder; AdaptiveSpotFinderGPU *fused_adaptive = nullptr; // The CPU finder, where it gives the profile too (the azimuthal integration being on the CPU). diff --git a/receiver/JFJochReceiver.cpp b/receiver/JFJochReceiver.cpp index 1257ed53a..b9abe9f40 100644 --- a/receiver/JFJochReceiver.cpp +++ b/receiver/JFJochReceiver.cpp @@ -28,7 +28,7 @@ JFJochReceiver::JFJochReceiver(const DiffractionExperiment &in_experiment, scan_result(in_experiment), serialmx_filter(in_experiment), pixel_mask(in_pixel_mask), - // retain_outcomes=false: no online scaling/merge at the end, so the integration outcomes are not used + // retain_outcomes=false: the receivers index only, there is no scaling or merging at the end indexer(experiment, indexing_thread_pool, false, /*real_time=*/true) { logger.Debug("Initializing receiver"); // Ensure there is nothing running for now @@ -38,7 +38,7 @@ JFJochReceiver::JFJochReceiver(const DiffractionExperiment &in_experiment, logger.Debug("Image buffer from previous run finalized"); current_status.SetProgress(0); - current_status.SetStatus(JFJochReceiverStatus{}); // GetStatus() is virtual function and cannot be called yet! + current_status.SetStatus(JFJochReceiverStatus{}); // GetStatus() calls virtual functions and cannot be called yet auto start_time_point = std::chrono::steady_clock::now(); az_int_mapping = std::make_unique(experiment, pixel_mask); @@ -198,7 +198,7 @@ void JFJochReceiver::StampImage(DataMessage &message, size_t fifo_delay) { message.run_name = experiment.GetRunName(); message.receiver_buf_available = image_buffer.GetAvailSlots(); message.receiver_aq_dev_delay = fifo_delay; - // Uncompressed/compressed (e.g. 7x), as JFJochReceiverFPGA and JFJochReceiver::GetFinalStatistics + // Uncompressed/compressed (e.g. 7x), as JFJochReceiverFPGA and JFJochReceiver::GetStatus if (message.image.GetCompressedSize() > 0) message.compression_ratio = static_cast(message.image.GetUncompressedSize()) / static_cast(message.image.GetCompressedSize()); diff --git a/receiver/JFJochReceiverService.cpp b/receiver/JFJochReceiverService.cpp index aa8327f79..abe2e08d2 100644 --- a/receiver/JFJochReceiverService.cpp +++ b/receiver/JFJochReceiverService.cpp @@ -112,7 +112,7 @@ void JFJochReceiverService::Start(const DiffractionExperiment &experiment, preview_image.Configure(experiment, pixel_mask); - // Pedestal runs and host summation stay with JFJochReceiverFPGA + // Pedestal runs go to JFJochReceiverPedestal, host summation stays with JFJochReceiverFPGA bool stream_input = (experiment.GetDetectorType() == DetectorType::DECTRIS); if (fpga_image_puller && !stream_input && (experiment.GetImageNum() > 0)) { if (experiment.IsCPUSummation()) @@ -424,7 +424,6 @@ void JFJochReceiverService::ClearImageBuffer() { JFJochReceiverService &JFJochReceiverService::Indexing(const IndexingSettings &input) { std::unique_lock ul(state_mutex); - // Clearing image buffer during data collection could be catastrophic, so better protect here if (state == ReceiverState::Idle) { // The receiver goes first: it holds a raw pointer to the pool, and a stale one's GPU resources can fail the new indexers receiver.reset();