Skip to content

Run the cleanup tests in an optimized build - #3443

Open
plajjan wants to merge 1 commit into
mainfrom
cleanup-tests-optimized
Open

plajjan wants to merge 1 commit into
mainfrom
cleanup-tests-optimized

Conversation

@plajjan

@plajjan plajjan commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

make test-stdlib now also runs test_cleanup.act with --fast and 16 workers. In a debug build the cleanup tests pass also when the worker loop's exception frame, jump0, is never dropped, so no test covered the part of #3435 that drops it before each poll.

The worker loop's exception frame, jump0 in the worker context, is
pushed with a setjmp by the first continuation after each poll, and it
is dropped and zeroed right before the next poll. The setjmp saves the
registers that the loop keeps across calls. In an optimized build these
hold the continuation that the worker runs and its argument, so a frame
that stays pushed keeps them, and the actors they reach, alive. A debug
build keeps these values on the stack instead.

make test-stdlib ran test_cleanup.act only in a debug build, where the
tests pass whether the frame is dropped or not. It now also runs that
module with --fast and 16 workers. A frame that stays pushed keeps what
the first continuation of its worker reached. So the tests fail only if
some worker ran a continuation of a test's actors first, and more
workers make that more likely. On cbb0194, before actor construction
became synchronous, the tests passed with 4 workers, the default on a
machine with 4 cores, also when the frame stayed pushed.

Runs of the timer and raise cleanup tests on an M4 Pro, with a frame
that is pushed once per worker and never dropped. "4 cores" means the
four efficiency cores only (taskpolicy -b), like a runner with 4 vCPUs:

  build    workers  cores   timer test   raise test
  debug    16       all     10/10 pass   10/10 pass
  debug    16       4       10/10 pass   10/10 pass
  --fast   4        all      0/10 pass    0/10 pass
  --fast   4        4        1/10 pass    0/10 pass
  --fast   16       all      0/10 pass    0/10 pass
  --fast   16       4        0/10 pass    0/10 pass

On main, all four cleanup tests passed 20 of 20 runs in each of the
--fast rows. The new step takes 25 s on the M4 Pro with an empty compile
cache, most of it to build base and std with --fast, and 1.4 s with a
warm one.
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