v1.0.0-rc.128 (#35)
All checks were successful
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 10m26s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 12m30s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 13m25s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 13m53s
Build Packages / Generate python client (push) Successful in 26s
Build Packages / build:rpm (rocky8) (push) Successful in 14m11s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 14m22s
Build Packages / Build documentation (push) Successful in 44s
Build Packages / build:rpm (rocky9) (push) Successful in 15m17s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 15m26s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m11s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m55s
Build Packages / Unit tests (push) Successful in 54m33s

This is an UNSTABLE release. The release has significant modifications and bug fixes, if things go wrong, it is better to revert to 1.0.0-rc.124.

* jfjoch_broker: Handle properly reuse of image buffer locations
* jfjoch_broker: Fix bug in counting idle slots
* jfjoch_broker: Force obtuse angle for monoclinic cells
* jfjoch_process: Change scaling refinement tolerance

Reviewed-on: #35
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #35.
This commit is contained in:
2026-03-03 22:24:44 +01:00
committed by leonarski_f
parent f3e0a15d26
commit 3036b1d37f
143 changed files with 364 additions and 190 deletions

View File

@@ -243,3 +243,93 @@ TEST_CASE("ImageBuffer_BuffersNotReturned") {
REQUIRE(buf_ctrl.GetAvailSlots() == 3);
REQUIRE(!buf_ctrl.CheckIfBufferReturned(std::chrono::microseconds(1)));
}
TEST_CASE("ImageBuffer_SlotReuse") {
DiffractionExperiment experiment(DetJF(18,3,8,36));
// Only 1 slot so reuse is guaranteed
ImageBuffer buf_ctrl(experiment.GetImageBufferLocationSize());
buf_ctrl.StartMeasurement(experiment);
REQUIRE(buf_ctrl.GetStatus().total_slots == 1);
REQUIRE(buf_ctrl.GetAvailSlots() == 1);
// First cycle: acquire -> ReadyToSend -> release
ZeroCopyReturnValue *ret = buf_ctrl.GetImageSlot();
REQUIRE(ret != nullptr);
REQUIRE(buf_ctrl.GetAvailSlots() == 0);
ret->SetImageNumber(0);
ret->SetImageSize(100);
ret->SetIndexed(false);
ret->ReadyToSend();
REQUIRE(buf_ctrl.GetStatus().sending_slots == 1);
REQUIRE(buf_ctrl.GetStatus().preparation_slots == 0);
ret->release();
REQUIRE(buf_ctrl.GetAvailSlots() == 1);
REQUIRE(buf_ctrl.GetStatus().sending_slots == 0);
// Second cycle: reuse the same slot — this is where the bug manifested
ZeroCopyReturnValue *ret2 = buf_ctrl.GetImageSlot();
REQUIRE(ret2 != nullptr);
REQUIRE(buf_ctrl.GetAvailSlots() == 0);
REQUIRE(buf_ctrl.GetStatus().preparation_slots == 1);
ret2->SetImageNumber(1);
ret2->SetImageSize(200);
ret2->SetIndexed(true);
REQUIRE_NOTHROW(ret2->ReadyToSend());
REQUIRE(buf_ctrl.GetStatus().sending_slots == 1);
REQUIRE(buf_ctrl.GetStatus().preparation_slots == 0);
REQUIRE_NOTHROW(ret2->release());
REQUIRE(buf_ctrl.GetAvailSlots() == 1);
REQUIRE(buf_ctrl.GetStatus().sending_slots == 0);
// Third cycle: verify it keeps working
ZeroCopyReturnValue *ret3 = buf_ctrl.GetImageSlot();
REQUIRE(ret3 != nullptr);
ret3->SetImageNumber(2);
ret3->SetImageSize(300);
ret3->SetIndexed(false);
REQUIRE_NOTHROW(ret3->ReadyToSend());
REQUIRE_NOTHROW(ret3->release());
REQUIRE(buf_ctrl.GetAvailSlots() == 1);
REQUIRE(buf_ctrl.Finalize(std::chrono::microseconds(1)));
}
TEST_CASE("ImageBuffer_SlotReuse_ReleaseFromInPreparation") {
DiffractionExperiment experiment(DetJF(18,3,8,36));
ImageBuffer buf_ctrl(experiment.GetImageBufferLocationSize());
buf_ctrl.StartMeasurement(experiment);
// First cycle: acquire -> release directly (skipping explicit ReadyToSend)
ZeroCopyReturnValue *ret = buf_ctrl.GetImageSlot();
REQUIRE(ret != nullptr);
ret->SetImageNumber(0);
ret->SetImageSize(100);
ret->release();
REQUIRE(buf_ctrl.GetAvailSlots() == 1);
// Second cycle: reuse after release-from-InPreparation path
ZeroCopyReturnValue *ret2 = buf_ctrl.GetImageSlot();
REQUIRE(ret2 != nullptr);
ret2->SetImageNumber(1);
ret2->SetImageSize(200);
REQUIRE_NOTHROW(ret2->ReadyToSend());
REQUIRE_NOTHROW(ret2->release());
REQUIRE(buf_ctrl.GetAvailSlots() == 1);
REQUIRE(buf_ctrl.Finalize(std::chrono::microseconds(1)));
}