Skip to content

tests: run the gate's test loops in parallel (xargs -P) - #62

Merged
vic merged 1 commit into
mainfrom
gate-par
Nov 11, 2026
Merged

vic merged 1 commit into
mainfrom
gate-par

Conversation

@vic

@vic vic commented Nov 11, 2026

Copy link
Copy Markdown
Owner

The gate was slow because every test loop ran one test at a time. Most of the time goes to the 22 component tests: each one is a C compile of all of s2, about 3 s and 157 MB. After them come 126 prog tests and about 290 neg, cneg and cok tests.

Now each loop body is a function of the test file (t_comp, t_prog, t_neg, t_cneg, t_cok, t_l2), and par runs them with xargs -0 -n2 -P "$GATE_JOBS". GATE_JOBS defaults to nproc. Each test writes its verdict to its own file, and par prints the files in file order, so the log reads like the serial run. GNU parallel is not installed, so xargs adds no dependency.

FAIL detection:

  • a FAIL line from any test makes par return 1, and the caller sets fail
  • a test function that exits nonzero gets a FAIL line with its exit code
  • a test process killed by a signal makes xargs exit nonzero, and par adds FAIL <fn>: a test process died

I checked this with fake test functions: output order kept, a FAIL line gives rc=1, and a kill -9 gives the "died" line and rc=1.

Not done: the serial bootstrap (s2c0, then s2c1, then the fixpoint, about 39 s) stays serial, because each step needs the one before. The eval, hash, mem and store loops are small, so they stay serial too.

Not yet verified: my comparison run (serial run.sh from main, then this one, on the same tree, with logs to be byte-identical and both timed) is still running. I will post the result here. CI decides the rest.

…r core)

Component, prog, neg, cneg, cok and l2-agree tests are each a fn of the test file. par runs them GATE_JOBS at once
and prints each test's verdict in file order, so the log reads as a serial run's. A test process that exits nonzero
or dies is a FAIL line.
@vic
vic merged commit 412d6a3 into main Nov 11, 2026
3 checks passed
@vic
vic deleted the gate-par branch November 17, 2026 16:48
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