Summary
From the #30 comparison against Calder's original CUBE. Two node-extraction
quality improvements: surface the hypothesis-strength ratio Calder computes, and
make hypothesis tie-breaking deterministic.
Part of #30.
1. Expose the hypothesis-strength ratio (real diagnostic value)
Calder's depth extraction returns a hypothesis-strength ratio — a measure of
how dominant the chosen hypothesis is over the runners-up
(max(0, MAX_HYPOTHESIS_RATIO - N_best/N_rest), cube_node.c:1566-1586,
:2108-2112). It does not change the chosen depth; it is a node-ambiguity
signal. The port's extractDepthAndUncertainty (node.cpp:167-187) drops it.
Exposing it (e.g. as a third grid layer alongside elevation/uncertainty) would
let CAMP/rviz flag cells where multiple competing depth hypotheses survive —
useful for QA and for steering re-survey.
2. Deterministic tie-break
Calder stores hypotheses in a push-down linked list (newest at head); the port
uses a std::vector with push_back (newest at tail), reversing iteration. On an
exact error / num_samples tie the two pick different hypotheses
(bestHypothesis node.cpp:65-79, chooseHypothesis :189-200). Calder's own
qsort comparator never returns 0, so its tie outcome is also undefined.
Exact float ties are vanishingly rare in practice, but a defined rule makes the
behavior testable. Add an explicit tie-break (e.g. on a tie, prefer higher
num_samples, then lower current_variance, then most-recent) and a test that
pins it.
Acceptance
- Hypothesis-strength ratio computed and surfaced from node extraction (+ optional
grid layer); test pins the ratio for a known multi-hypothesis node.
- Deterministic tie-break rule implemented in both selection paths; test asserts
the chosen hypothesis on a constructed exact tie.
Authored-By: Claude Code Agent
Model: Claude Opus 4.8 (1M context)
Summary
From the #30 comparison against Calder's original CUBE. Two node-extraction
quality improvements: surface the hypothesis-strength ratio Calder computes, and
make hypothesis tie-breaking deterministic.
Part of #30.
1. Expose the hypothesis-strength ratio (real diagnostic value)
Calder's depth extraction returns a hypothesis-strength ratio — a measure of
how dominant the chosen hypothesis is over the runners-up
(
max(0, MAX_HYPOTHESIS_RATIO - N_best/N_rest),cube_node.c:1566-1586,:2108-2112). It does not change the chosen depth; it is a node-ambiguitysignal. The port's
extractDepthAndUncertainty(node.cpp:167-187) drops it.Exposing it (e.g. as a third grid layer alongside
elevation/uncertainty) wouldlet CAMP/rviz flag cells where multiple competing depth hypotheses survive —
useful for QA and for steering re-survey.
2. Deterministic tie-break
Calder stores hypotheses in a push-down linked list (newest at head); the port
uses a
std::vectorwithpush_back(newest at tail), reversing iteration. On anexact
error/num_samplestie the two pick different hypotheses(
bestHypothesisnode.cpp:65-79,chooseHypothesis:189-200). Calder's ownqsortcomparator never returns 0, so its tie outcome is also undefined.Exact float ties are vanishingly rare in practice, but a defined rule makes the
behavior testable. Add an explicit tie-break (e.g. on a tie, prefer higher
num_samples, then lowercurrent_variance, then most-recent) and a test thatpins it.
Acceptance
grid layer); test pins the ratio for a known multi-hypothesis node.
the chosen hypothesis on a constructed exact tie.
Authored-By:
Claude Code AgentModel:
Claude Opus 4.8 (1M context)