rugnux: the rotation-scale walk runs first where pass 1's fit is a step off

Where pass 1's rotation-scale fit is a step or more (STEP_BOUND, 1 %) off the
stored angles, the walk runs on its own before the refined passes instead of
beside an output pass that a refit calls off and throws away. Scheduling only:
the run ends where the sequential walk leaves it either way (the overturned
path already re-ran the refined passes on the run itself).

Exactness E: all output files identical to rc175 e9d4f2221 on 9gdj, 9qw8,
6ttn, lalanine, 9t6s, 2 runs each.

Note: "the walk will then always refit" does not hold. Of the four battery
sets with the fit >= 1 % off (9gdj 0.980, 9qw8 0.988, 9t6s 1.012, lalanine
1.012), the stored angles stand on 9t6s and lalanine, which now walk first and
lose the overlap of the walk's two probes with the output pass (~0.5-0.8 s of
probe time); 6ttn (0.998) is below the step and unchanged.

Wall (time -v, base -> new, rep1 / rep2, shared machine):
  9gdj  99.6->109.7 / 107.4->101.4 (rep1 new run noisy)
  9qw8  43.1->39.2 / 34.4->33.3
  9t6s  18.1->18.2 / 18.9->18.5
  lalanine 20.5->19.7 / 7.9->8.3
Pre-rebase run on rc175 0b2dde214: 9gdj 99.6->93.8 and 99.6->93.4.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SVmAWnzCmRKAXVUCdc4iNi
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-10 00:56:14 +02:00
1 parent 5cedb69833
commit 7664b22ea6
1 file changed
+36 -23
+36 -23
View File
@@ -557,33 +557,46 @@ ProcessResult Rugnux::RunAllPasses(RugnuxObserver *observer) {
// before it writes - and a refit, which integrates and only follows a move off the stored
// angles, first calls the output pass off and waits for it to end, so two integrations never
// share the card.
//
// Except where pass 1's fit is a step or more off the stored angles (STEP_BOUND in
// PostRefine.cpp): there the walk moves off them and refits as a rule, which calls the output
// pass off and throws it away, so the walk runs first, on its own, and the refined passes
// after it. Either way the run ends where the sequential walk leaves it.
constexpr double ROTATION_SCALE_STEP = 0.01;
if (!cancelled_ && gonio_snapshot && pass1.post_refine && !config_.rotation_scale) {
const auto check = std::make_shared<RotationScaleCheck>();
const auto output = std::make_shared<Rugnux>(*this);
output->rotation_scale_check_ = check;
output->cancelled_ = cancelled_.Own();
CancelFlag output_cancel = output->cancelled_;
std::future<RotationScaleWalk> walk_done = std::async(std::launch::async, [&] {
return WalkRotationScaleBeside(pass1, *check, output_cancel);
});
RotationScaleWalk walk;
if (std::fabs(pass1.post_refine->rotation_scale - 1.0) >= ROTATION_SCALE_STEP) {
check->Set(check->output_indexed);
check->Set(check->output_ended);
walk = WalkRotationScaleBeside(pass1, *check, CancelFlag());
} else {
const auto output = std::make_shared<Rugnux>(*this);
output->rotation_scale_check_ = check;
output->cancelled_ = cancelled_.Own();
CancelFlag output_cancel = output->cancelled_;
std::future<RotationScaleWalk> walk_done = std::async(std::launch::async, [&] {
return WalkRotationScaleBeside(pass1, *check, output_cancel);
});
std::optional<ProcessResult> result;
std::exception_ptr output_error;
try {
result = output->RefinedPasses(observer, pass1, start);
} catch (...) {
output_error = std::current_exception();
}
check->Set(check->output_indexed);
check->Set(check->output_ended);
const RotationScaleWalk walk = walk_done.get();
if (!check->overturns) {
if (output_error)
std::rethrow_exception(output_error);
return *result;
std::optional<ProcessResult> result;
std::exception_ptr output_error;
try {
result = output->RefinedPasses(observer, pass1, start);
} catch (...) {
output_error = std::current_exception();
}
check->Set(check->output_indexed);
check->Set(check->output_ended);
walk = walk_done.get();
if (!check->overturns) {
if (output_error)
std::rethrow_exception(output_error);
return *result;
}
}
// Overturned: the refined passes run again, on the run itself.
// Overturned, or the walk ran first: the refined passes run on the run itself.
start.scale_walk = {check->passes, check->text};
if (walk.scale != 1.0f) {
step("Rotation-scale check");
@@ -596,7 +609,7 @@ ProcessResult Rugnux::RunAllPasses(RugnuxObserver *observer) {
"integrates at the corrected angles; the fault is in the hardware and should "
"be fixed there", walk.scale, 100.0 * (walk.scale - 1.0),
walk.scale > 1.0f ? "further" : "less far");
} else
} else if (check->overturns)
logger.Info("Two-pass: the rotation-scale walk changed the spot finding the refined passes "
"start from, so they run again after it");
}