marCCD upload: stage the stored pixels instead of page-locking the frame in place

A UINT16_WIDENED frame (marCCD) was page-locked where it lay with PinInputRegion, which keeps the
registration until the engine moves on to another frame. The pre-scan hands its kept frames to the
spot measurement and to the defective-pixel search at once, each with its own engines, so one
engine could unregister a frame while another engine's copy from it was still in flight. That
takes the context down ("unspecified launch failure"), seen as a rare crash at the end of the
pre-scan on a 3072x3072 marCCD sweep (1 run in 30 reproduced it).

The stored bytes now go through the engine's own page-locked staging buffer, as the CBF and BSLZ4
decoders already do. The pixels decoded are unchanged.

Test: ImagePreprocessorGPU_SharedStoredFramesManyEngines - four engines upload four shared marCCD
frames concurrently; it aborted with the launch failure before the change and passes after it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EizBKhTqrAYago9KJG3dA3
This commit is contained in:
2026-10-13 05:21:33 +02:00
co-authored by Claude Opus 5.5
parent 59648587e3
commit 34092a510f
3 changed files with 67 additions and 2 deletions
@@ -29,6 +29,8 @@ class ImagePreprocessorGPU : public ImagePreprocessor {
// The uncompressed-image counterpart of input_reg: the region PinInputRegion last page-locked.
const void *pinned_input = nullptr;
size_t pinned_input_bytes = 0;
// Staging for a marCCD frame's stored 16-bit pixels (UINT16_WIDENED), allocated on first use.
CudaHostPtr<uint8_t> host_stored;
std::vector<int32_t> cpu_image;