Skip to content

state_exec async test: SL-7 times the sleeper from just before a warm sleep - #1282

Merged
transfix merged 2 commits into
masterfrom
fix/sl07-due-from-first-tick
Nov 16, 2026
Merged

transfix merged 2 commits into
masterfrom
fix/sl07-due-from-first-tick

Conversation

@transfix

@transfix transfix commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Slices.SL07_ABetterPriorityPreempts failed all three tries in #1246's recipe / macos-latest / Release job (run 43708365932, job 132794319979). It fails after_due_at_seen <= 32 with 62, 37 and 42: the busy, lower-priority process's ticks after the sleeper's due time. The same job passed it on #1253 and #1255 earlier today. #1246 doesn't touch state_exec. The test came in with #1192.

What the test measured

  • The test set its due time in (arm), the step before a first (sleep 0.02).
  • The scheduler's due time is the sleep's own clock reading plus 20 ms (async_scheduler::sleep, called straight from the intrinsic).
  • ctest runs each case in a fresh process, so the code between those two readings ran for the first time there. Every tick the runner made over that gap counted as the scheduler being late.
  • Measured on an idle Windows machine (MSVC Release, 22 CPUs) with the counts printed, fresh processes: 9–24 ticks counted that way. Counted from 20 ms after the runner's first tick, which is never earlier than the scheduler's due time, the same runs gave 0.
  • A tick there takes about 0.23 µs. The macOS runner's 37–62 fits a slower first run of that code on a VM.

The change (test only)

  • (arm) is now the sleep's argument, (sleep (arm)), and returns the 20 ms. It reads the clock just before the sleep does.
  • A (sleep 0.001) first runs the sleep path once, so nothing between the two readings runs for the first time.
  • The limit stays 32 ticks (the 16-step clock checks plus room), and the count is printed: SL-7: the runner made N ticks past the sleeper's due time, M in all.

Checked locally (Windows, MSVC Release)

Version Runs Ticks past due
master's fresh processes, idle 9–24
this PR 40 fresh processes, idle 1–5 (median 3)
this PR 300 repeats in one process 0–12
this PR 30 fresh processes, 66 busy loops on 22 CPUs 0–10
  • clang-format 19 (git clang-format HEAD) leaves the changed lines alone.
  • Master's version also passed 30 of 30 here under load, so this machine doesn't reproduce the macOS failure. The printed count will show what macOS gets.
  • Not run locally: macOS or Linux. This PR's own CI covers both.

Also: the Ariadne action-caps test (db0fbfc)

This PR's libcvc-debug run failed AriadneAsyncFn.ActionCapsAreTreeSettingsAndChargeAsyncCalls three times: the 200-round loop hit the default 0.1 s time cap, which is wall time, on a loaded Debug runner.

  • The step-cap checks raise the time cap to 30 s.
  • The default time cap gets its own check: ten million rounds with no step cap.
  • Each button is clicked alone, by its label. button_click clicked every button.
  • Each kill waits for its own warning, up to 30 s. A second identical kill uses its own key, because a kill warns once per message.

Locally (Windows, MSVC Release): 5/5, and 160/160 with 32 copies running at once.

The same run also failed Groups.PA01_TwoCallersShareThePool, which #1280 fixes.

… sleep

Slices.SL07_ABetterPriorityPreempts failed all three tries in #1246's
recipe / macos-latest / Release job (run 43708365932): the runner made 62,
37 and 42 ticks past the sleeper's due time, against a limit of 32.

The test timed the due time from (arm), the step before a first
(sleep 0.02). The scheduler's due time is the sleep's own clock reading plus
20 ms, and in a fresh process (one test per ctest run) the code between the
two readings runs for the first time there: the runner's ticks over that gap
counted as lateness. On an idle Windows machine, fresh processes counted
9-24 that way; the macOS runner, 37-62.

Now (arm) is the sleep's argument, (sleep (arm)), so it reads the clock just
before the sleep does, and a (sleep 0.001) first warms the sleep's path. The
same machine counts 1-5 in fresh processes (40 runs), 0-12 warm (300), and
0-10 in fresh processes with 66 busy loops on its 22 CPUs (30). The limit
stays 32, and the count is printed.
@transfix
transfix enabled auto-merge (squash) November 15, 2026 22:03
…h kill waits for its warning

AriadneAsyncFn.ActionCapsAreTreeSettingsAndChargeAsyncCalls failed three times running on
package-linux / libcvc-debug: the 200-round loop was killed with time_limit_exceeded. The
default time cap (0.1 s) is wall time, and a loaded Debug runner spent it on the loop.

- The step-cap checks raise ariadne.limits.action_max_time to 30 s, so only steps decide them.
- The default time cap gets its own check: ten million rounds with no step cap, which run into
  0.1 s on any machine (time_limit_exceeded).
- Each button is clicked alone, by its label (button_click clicked every button, so each click
  ran every program), and a kill waits up to 30 s for its own warning instead of a fixed 1 s.
- The second spin kill has its own key: a kill warns once per message.

Locally (Windows, MSVC Release): 5/5, and 160/160 with 32 copies running at once (slowest 403 ms).
@transfix
transfix merged commit a5e83b1 into master Nov 16, 2026
29 of 30 checks passed
@transfix
transfix deleted the fix/sl07-due-from-first-tick branch November 16, 2026 11:24
transfix added a commit that referenced this pull request Nov 16, 2026
…#1307)

One conflict, in ariadne_runtime_test.cpp's ActionCapsAreTreeSettingsAndChargeAsyncCalls: this
branch cut its loop to 20 rounds so it fit the 0.1 s time cap on Linux debug CI, and master
(#1282) rewrote the test, raising the time cap to 30 s wherever the loop must finish.
Master's fix covers the same flake, so the test is master's as it stands, 200 rounds again.

tools/singleton_scan is master's (#1276); the auto-merged net, CI, test and doc files keep both
sides.
transfix added a commit that referenced this pull request Nov 16, 2026
… sleep (#1282)

* state_exec async test: SL-7 times the sleeper from just before a warm sleep

Slices.SL07_ABetterPriorityPreempts failed all three tries in #1246's
recipe / macos-latest / Release job (run 43708365932): the runner made 62,
37 and 42 ticks past the sleeper's due time, against a limit of 32.

The test timed the due time from (arm), the step before a first
(sleep 0.02). The scheduler's due time is the sleep's own clock reading plus
20 ms, and in a fresh process (one test per ctest run) the code between the
two readings runs for the first time there: the runner's ticks over that gap
counted as lateness. On an idle Windows machine, fresh processes counted
9-24 that way; the macOS runner, 37-62.

Now (arm) is the sleep's argument, (sleep (arm)), so it reads the clock just
before the sleep does, and a (sleep 0.001) first warms the sleep's path. The
same machine counts 1-5 in fresh processes (40 runs), 0-12 warm (300), and
0-10 in fresh processes with 66 busy loops on its 22 CPUs (30). The limit
stays 32, and the count is printed.

* Ariadne action-caps test: steps checked with the time cap raised; each kill waits for its warning

AriadneAsyncFn.ActionCapsAreTreeSettingsAndChargeAsyncCalls failed three times running on
package-linux / libcvc-debug: the 200-round loop was killed with time_limit_exceeded. The
default time cap (0.1 s) is wall time, and a loaded Debug runner spent it on the loop.

- The step-cap checks raise ariadne.limits.action_max_time to 30 s, so only steps decide them.
- The default time cap gets its own check: ten million rounds with no step cap, which run into
  0.1 s on any machine (time_limit_exceeded).
- Each button is clicked alone, by its label (button_click clicked every button, so each click
  ran every program), and a kill waits up to 30 s for its own warning instead of a fixed 1 s.
- The second spin kill has its own key: a kill warns once per message.

Locally (Windows, MSVC Release): 5/5, and 160/160 with 32 copies running at once (slowest 403 ms).

(cherry picked from commit a5e83b1)
transfix added a commit that referenced this pull request Nov 17, 2026
…1319)

SegmentationIntrinsicsAriadne.AnActionStartsItUnderTheDefaultLimits
runs a 160^3 seeded segmentation through an action's frame loop, which
it bounds at 300 s of wall time, the same as ctest's default timeout.
In Debug jobs it takes 93-101 s (#1282's and #1299's runs). On a loaded
runner it went past 300 s in all three tries (#1301's package-linux /
libcvc-debug, job 133118449718), failing a docs-only PR.

- port tests: segmentation_intrinsics_test's tests are discovered with
  TIMEOUT 900, as ocean_ewave_test's are with 1200 (#1261).
- The test's own loop allows 900 s.

The volume stays 160^3, so the test still spans many frames and the
threaded job's chunks.
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