Live stills: count a frame once it has its slot; cancel test waits for its frames
JFJochReceiverRugnux_Stills_CancelDuringRun failed once in CI (images_sent 3 vs given 4) after passing on the same code three times. In the test's four-slot buffer the last frame given could still be waiting for a hold slot when the cancel came. The cancel ends that wait and the frame is dropped, as one arriving after the cancel would be, but it had already been counted as collected, so collected and sent disagreed. The frame is now counted only once it has its slot. Every frame counted is then written, and collected matches sent. The test cancels once every frame given has been analysed, which takes the race out of it. Passed 10 of 10 runs; JFJochReceiverRugnux*, *GPUStills*, [StillsGPUAnalysis], [JFJochReceiver] and JFJochIntegrationTest_* pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVeDQrPqZ52Tp6rzzZGxf3 (cherry picked from commit 16e8dcd0657f39e5776b134c68413bdbce8b37da)
This commit is contained in:
1 parent
d729b7c6d4
commit
ec5c6cd6f1
2 files changed
+5
-4
No files matched your search
@@ -91,7 +91,6 @@ void JFJochReceiverRugnuxStills::OnImage(uint32_t id, DataMessage &message, std:
|
||||
return;
|
||||
}
|
||||
live_status.ImageReceived(received);
|
||||
CountImage(message);
|
||||
const size_t size = message.image.GetCompressedSize();
|
||||
|
||||
// Waits for the analysis in a slot of the image buffer, where it can be seen while it waits (it is not sent from
|
||||
@@ -104,7 +103,8 @@ void JFJochReceiverRugnuxStills::OnImage(uint32_t id, DataMessage &message, std:
|
||||
held->slot = image_buffer.GetImageSlot(hold_keep_free);
|
||||
}
|
||||
if (!held->slot)
|
||||
return;
|
||||
return; // cancelled while it waited: dropped like a frame arriving after the cancel, and not counted
|
||||
CountImage(message);
|
||||
// Not chosen (stills_downsample): written as it came, without its analysis
|
||||
held->analyse = StillsImageSelected(message.number, downsample, prepass_images);
|
||||
held->message = message;
|
||||
|
||||
@@ -383,8 +383,9 @@ TEST_CASE("JFJochReceiverRugnux_Stills_CancelDuringRun", "[JFJochReceiverRugnux]
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
}
|
||||
REQUIRE(given < images - 1);
|
||||
WaitForStatus(service, [](const RugnuxLiveSnapshot &s) {
|
||||
return s.stills && s.stills->prepass == RugnuxLivePrePass::Done && s.stills->images_analysed > 0;
|
||||
// Every frame given is analysed before the cancel: one still waiting for a slot when it comes is dropped
|
||||
WaitForStatus(service, [&](const RugnuxLiveSnapshot &s) {
|
||||
return s.stills && s.stills->prepass == RugnuxLivePrePass::Done && s.stills->images_analysed == given;
|
||||
});
|
||||
service.Cancel(false);
|
||||
const auto out = service.Stop();
|
||||
|
||||
Reference in new issue
Block a user