Skip to content

test: size linearity timing tests above the Windows clock tick (#4840) - #4861

Merged
squid-protocol merged 2 commits into
mainfrom
test/4840-prism-regex-bomb-timing
Oct 10, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
test/4840-prism-regex-bomb-timing

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4840

Why

test_prism_suppression_regex_bomb failed on windows / 3.10 in the main matrix (run 38083925457): 0.0156 s vs 0.1250 s read as 8.0x for a 4x input. On Windows time.thread_time advances in ~15.6 ms ticks, so the small sample was a single tick, not a measurement.

Change

  • tests/_timing.py: MIN_RELIABLE_S 2 ms → 50 ms (≥ 3 Windows ticks).
  • The floor is max(t_small, MIN_RELIABLE_S), so a small run under it would make the ratio lenient and hide a quadratic. Every caller is sized so the small run clears 50 ms honestly (best CPU, Linux):
test small → large small CPU ratio
prism suppression tags 150k → 600k (repeats=3) 138 ms 4.0x
unterminated EXEC 15k → 60k 77 ms 4.0x
MOVE statements (unchanged) 10k → 40k 158 ms 3.8x
unterminated DECLARE 10k → 40k 112 ms 4.2x

The four tests run in ~12 s together.

Checks

pr_gates --fast PASS. --ratchets: all PASS except ports, which fails locally because the CardDemo corpus is not fetched at its pinned ref (mainframe_corpus.py fetch ...): environment, not this change (tests only). shepherd:matrix runs the OS matrix to prove it on Windows.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AUWeQX7v4QBdErFbghEEEX

On Windows `time.thread_time` advances in ~15.6 ms ticks, so a 16 ms small
sample can be one tick: test_prism_suppression_regex_bomb read 0.0156 s vs
0.1250 s as 8.0x for a 4x input on the main matrix (run 38083925457).

MIN_RELIABLE_S goes from 2 ms to 50 ms (>= 3 ticks), and the three callers
whose small run was below that now use larger inputs, so the floor never
masks a real quadratic. Measured best CPU of the small run on Linux:
prism 138 ms, unterminated EXEC 77 ms, MOVE statements 158 ms (unchanged),
unterminated DECLARE 112 ms; every ratio ~4x.

Part of #4840

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AUWeQX7v4QBdErFbghEEEX
@squid-protocol squid-protocol added ci-cd Continuous integration, delivery, and automated runners shepherd:matrix Maintainer: run the full-suite matrix on this head first. Guide: docs/ci.md shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md testing Unit, integration, and E2E pipeline verification labels Oct 10, 2026
@squid-protocol squid-protocol removed shepherd:matrix Maintainer: run the full-suite matrix on this head first. Guide: docs/ci.md shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Oct 10, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

Holding: shepherd:matrix + shepherd:merge removed until the macOS shard-3 hang fix (box tools, next PR) is on main; then main gets merged in here and both labels go back on, so one matrix run proves Windows (this PR) and macOS (that one).

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol added shepherd:matrix Maintainer: run the full-suite matrix on this head first. Guide: docs/ci.md shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Oct 10, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

1 similar comment
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 10, 2026 23:44
@squid-protocol
squid-protocol merged commit 8366381 into main Oct 10, 2026
38 checks passed
@squid-protocol
squid-protocol deleted the test/4840-prism-regex-bomb-timing branch October 10, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd Continuous integration, delivery, and automated runners shepherd:matrix Maintainer: run the full-suite matrix on this head first. Guide: docs/ci.md shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md testing Unit, integration, and E2E pipeline verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant