Skip to content

test(sql): time the confirmation gate's cost guards in alternating rounds sized to their bound - #2256

Merged
cevheri merged 2 commits into
mainfrom
test/gate-walk-ratio-flake
Nov 5, 2026
Merged

cevheri merged 2 commits into
mainfrom
test/gate-walk-ratio-flake

Conversation

@cevheri

@cevheri cevheri commented Nov 5, 2026

Copy link
Copy Markdown
Member

The macOS cross-platform job failed on a diff that touches no SQL code: the gate's walk-ratio guard read 34.8 walks of a script of short statements against its bound of 24, for a gate that costs about 12.

Both cost guards compared the cheapest of five runs of each side, timed one after the other; a busy runner preempts a 12 ms gate run but often misses a 1 ms walk.

Each guard now times one gate run, or two of the long text, against 24 times as many yardstick runs in nine alternating rounds and reads the median, so both sides share the load at the bound, still 24.

With one CPU shared by three test processes the old guards failed every run and the new ones none (at most 15.6); the gate before #2249 still fails every shape (35.5 or more), and a one-line reconstruction of its quadratic lock clause check still fails its own shape (about 55, idle and loaded).

…unds sized to their bound

The cost guards divided the cheapest of five runs of one side by the cheapest of five of the other, timed one after the other.
A 1 ms walk often escapes preemption whole while a 12 ms gate run cannot, so a busy macOS runner read a script of short statements at 34.8 walks against a bound of 24, for a gate that costs about 12; the growth guard shares the flaw.

Each guard now times one gate run, or two of the long text, against 24 times as many yardstick runs, in nine rounds that alternate which side goes first, and reads the median round, so both sides of a round take the same load where the cost meets the bound, which stays 24.
On one CPU shared with two other test processes the old guards failed every run of the file and these none, while the gate before #2249 still reads above 30 on every shape.
@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@cevheri
cevheri merged commit 88eb567 into main Nov 5, 2026
43 of 44 checks passed
@cevheri
cevheri deleted the test/gate-walk-ratio-flake branch November 5, 2026 19:05
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