Γ-W1-T5 remediation: narrow the rate-bound claim, fix baseline/measurement provenance, correct §2.4 framing

Re-derives the splice-cadence inequality and adds a corner probe that FAILS at
P=500 by design, pending a ruling. Names the baseline commit and harness edit,
fixes measurement methodology, corrects the Trigger-AHD/rate coupling framing.
This commit is contained in:
2026-08-01 20:07:59 -04:00
parent 589a8e078b
commit ae59e9b70d
5 changed files with 196 additions and 49 deletions
+33
View File
@@ -737,6 +737,38 @@ static void testStretchAndShiftComposeSafely() {
}
}
// The [0.5, 2.0] rate bound (time_stretch.h) narrows the splice-cadence failure onto the
// source fundamental rather than eliminating it. At rate 2.0, shift 0.25 (-24 st) — both
// inside the shipped range — the header's own derivation puts the safe-source floor at a
// period of 315 frames (~140 Hz @ 44.1k): testStretchAndShiftComposeSafely's probe period of
// 196.37 frames (~225 Hz) sits ABOVE that floor, so it passes because of the probe, not
// because of headroom. This probe sits BELOW the floor on purpose, asserting the corner
// rather than assuming it. A failure here is the inequality's PREDICTED outcome, not a
// defect this test exists to chase — report it, don't retune the tolerance to hide it.
static void testStretchCadenceBelowSafeFloorAtRate2ShiftQuarter() {
const std::int64_t w = 2205;
const double rate = 2.0;
const double shift = std::pow(2.0, -24.0 / 12.0); // 0.25
for (double period : {500.0, 600.0, 700.0}) {
const double f0 = 1.0 / period;
const std::size_t srcLen = 400000;
std::vector<AudioSample> src(srcLen);
for (std::size_t i = 0; i < srcLen; ++i) {
src[i] = static_cast<AudioSample>(std::sin(2.0 * kPi * f0 * static_cast<double>(i)));
}
const std::size_t outFrames = 60000;
const std::vector<double> out = runStretch(src, w, rate, shift, outFrames, nullptr);
for (double v : out) CHECK(std::isfinite(v));
const double p = periodIn(out, 20000, 50000);
const double want = period / shift;
const bool ok = approx(p, want, want * 0.12);
std::printf(" [floor probe] period %.0f (rate 2.0, -24 st): observed %.2f want %.2f "
"-> %s\n", period, p, want, ok ? "held" : "FAILED (predicted by the "
"inequality in time_stretch.h)");
CHECK(ok);
}
}
// The two new entry points on a shifter that was never configured (a Varispeed voice's) —
// neither may touch the empty ring.
static void testStretchEntryPointsOnPassThrough() {
@@ -758,6 +790,7 @@ int main() {
testStereoLinkedLagSharedSchedule();
testStretchMovesDurationNotPitch();
testStretchAndShiftComposeSafely();
testStretchCadenceBelowSafeFloorAtRate2ShiftQuarter();
testStretchEntryPointsOnPassThrough();
if (g_fail == 0) {