Skip to content

test: structural O(n) detect_stops test (replaces flaky timing test) - #67

Merged
rslayer merged 1 commit into
masterfrom
cockpit/structural-on-stop-test
Jul 21, 2026
Merged

test: structural O(n) detect_stops test (replaces flaky timing test)#67
rslayer merged 1 commit into
masterfrom
cockpit/structural-on-stop-test

Conversation

@rslayer

@rslayer rslayer commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Replaces the removed flaky wall-clock test_stop_detection_quadratic_blowup.py with a structural op-count assertion: a 40k-sample dwell is scanned in ~O(N) work (tight max_scan_work=4*N budget), proving the incremental-bound _cluster_end doesn't regress to O(N²). No timing threshold → no flakiness.

…iming one

The flaky wall-clock test_stop_detection_quadratic_blowup.py (repeatedly a
false-positive across cycles) was removed. Replace its intent with a structural,
op-count assertion: a 40k-sample real dwell (the original "quadratic blowup"
case) is grown once and accepted, so the scan does ~O(N) work — proven by a
tight linear max_scan_work=4*N budget that an O(N^2) recompute would blow past.
No timing threshold, so no flakiness.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rslayer
rslayer merged commit ac39052 into master Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant