Fix vacuous bounds test and stale/circular comments from the settle

Replace the self-comparing render-window loop with a genuinely discriminating
floor-vs-exact check; correct two stale claims; mark the Auto/Manual floor-parity
premise as unverified; drop the STARTPOS/ENDPOS comment's circular justification.
This commit is contained in:
2026-08-02 17:08:11 -04:00
parent 8331df2e91
commit 4c7e0507a1
4 changed files with 32 additions and 25 deletions
+9 -6
View File
@@ -65,9 +65,11 @@ static void testRealtimeIsUnsupportedOffline() {
}
static void testEveryRenderSourceLabelIsPinnedVerbatim() {
// docs/VERIFICATION.md asks Daniel to report the refusal's `Render source:` line
// back verbatim, so every label is pinned to its literal — a typo in any of them
// breaks the report that quotes it, and only a literal catches that.
// docs/VERIFICATION.md's short-render bullet asks Daniel to report the refusal
// line back verbatim, and that line always carries the render source
// (render_bounds_gate.cpp appends "Render source: <label>."), so every label
// is pinned to its literal — a typo in any of them breaks the report that
// quotes it, and only a literal catches that.
CHECK(std::strcmp(renderSourceLabel(SourceMode::MasterMix), "master mix") == 0);
CHECK(std::strcmp(renderSourceLabel(SourceMode::TimeSelection), "master mix") == 0);
CHECK(std::strcmp(renderSourceLabel(SourceMode::SelectedTracks),
@@ -81,9 +83,10 @@ static void testEveryRenderSourceLabelIsPinnedVerbatim() {
static void testLabelsSeparateExactlyWhatTheRenderSeparates() {
// The labels partition the offline modes the way RENDER_SETTINGS does, and no
// finer: same bits => same words (MasterMix/TimeSelection both render the master
// mix, custom-time-bounded), different bits => different words. Naming two modes
// apart that render identically would put a distinction in a bug report that does
// not exist in the render.
// mix, unqualified — both hand their window over the same time-selection bounds
// mode), different bits => different words. Naming two modes apart that render
// identically would put a distinction in a bug report that does not exist in
// the render.
const SourceMode offline[] = {
SourceMode::MasterMix, SourceMode::TimeSelection, SourceMode::SelectedTracks,
SourceMode::SelectedItems, SourceMode::RazorArea,
+19 -13
View File
@@ -408,14 +408,17 @@ static void testOnAndOffGridWindowsAreHonoredIdentically() {
CHECK(on == 48000);
CHECK(off == 48000);
// The discriminating half: the off-grid window is one a flooring render WOULD get
// wrong (47992 against 48000) while the on-grid one is untouched by a floor. The
// gate's verdict must not notice that difference at any delta.
CHECK(msFlooredEndFrameCount(offStart, offEnd, 48000) == 47992);
CHECK(msFlooredEndFrameCount(onStart, onEnd, 48000) == on);
for (long long delta = -3; delta <= 3; ++delta)
CHECK(renderHonoredBounds(on, on + delta) ==
renderHonoredBounds(off, off + delta));
// The discriminating half: a render that landed the FLOORED count would be
// refused on the off-grid window (47992 against the required 48000, an
// 8-frame gap) but honored on the on-grid one, where flooring changes
// nothing. If the floor ever came back on the settled path, this is what
// would start failing.
const long long offFloored = msFlooredEndFrameCount(offStart, offEnd, 48000);
const long long onFloored = msFlooredEndFrameCount(onStart, onEnd, 48000);
CHECK(offFloored == 47992);
CHECK(onFloored == on);
CHECK(!renderHonoredBounds(off, offFloored));
CHECK(renderHonoredBounds(on, onFloored));
}
static void testOnAndOffGridAt44100WhereAMillisecondIsNotWholeFrames() {
@@ -428,11 +431,14 @@ static void testOnAndOffGridAt44100WhereAMillisecondIsNotWholeFrames() {
const long long off = frameCountFor(offStart, offEnd, 44100);
CHECK(on == 44100);
CHECK(off == 44100);
CHECK(msFlooredEndFrameCount(offStart, offEnd, 44100) == 44092);
CHECK(msFlooredEndFrameCount(onStart, onEnd, 44100) == on);
for (long long delta = -3; delta <= 3; ++delta)
CHECK(renderHonoredBounds(on, on + delta) ==
renderHonoredBounds(off, off + delta));
const long long offFloored = msFlooredEndFrameCount(offStart, offEnd, 44100);
const long long onFloored = msFlooredEndFrameCount(onStart, onEnd, 44100);
CHECK(offFloored == 44092);
CHECK(onFloored == on);
// Same discriminating pair as the 48 kHz case: the floor would be caught
// off-grid and invisible on-grid, even where the grid itself isn't frame-aligned.
CHECK(!renderHonoredBounds(off, offFloored));
CHECK(renderHonoredBounds(on, onFloored));
}
int main() {