instrument: fix AHD DecayEnd overlay/grab defect, pin flaky curve test, close comment/doc findings

This commit is contained in:
2026-07-31 10:19:45 -04:00
parent 2fa1405b06
commit 03fb471c92
10 changed files with 117 additions and 28 deletions
+5 -2
View File
@@ -156,8 +156,11 @@ static void testKnobLawRoundTripsOutsideTheDetent() {
const double back = curveFromKnobNorm(knobNormFromCurve(e));
CHECK(std::fabs(back - e) < 1e-9);
}
CHECK(curveFromKnobNorm(0.0) == kCurveMin);
CHECK(curveFromKnobNorm(-3.0) == kCurveMin); // out-of-range norm saturates
// exp(-log(10)) is not guaranteed bit-exact to kCurveMin's literal 0.1 (1-2 ulp either way);
// both norms below collapse to the same t == 0.0 computation, so both get the same
// tolerance rather than leaning on clampCurve's floor to land on it by luck.
CHECK(std::fabs(curveFromKnobNorm(0.0) - kCurveMin) < 1e-12);
CHECK(std::fabs(curveFromKnobNorm(-3.0) - kCurveMin) < 1e-12); // out-of-range norm saturates
CHECK(std::fabs(curveFromKnobNorm(1.0) - kCurveMax) < 1e-12);
// The ENDS need only land on the domain, not on an exact norm — 0.1 is not exactly 1/10 in
// binary, so log(kCurveMin) is a hair off -log(kCurveMax). Only the centre carries an