Repository navigation
test(compiler): exercise repeated in-process compilation - #1409
Merged
Lorenzobattistela merged 5 commits intoOct 12, 2026
Merged
Conversation
Lorenzobattistela
requested changes
Oct 8, 2026
Lorenzobattistela
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @oxura! The check does what #1310 asks, and it catches the bug it is there for. I tested it on current main (d5fe656):
- With the
PROBES.length = 1reset removed fromfile_new(the #976 bug), the test gate fails 4 tests with 40 probe-count mismatches. The bytes stay identical in that case, so the probe count is the only thing that sees it. - Sharing some of
file_new's other maps across compilations is caught too (siteson bytes,loopson the probe count). - Gates on main + PR: repo 54/54, test 1594/1594, ping 48/48, perf same as main. On my machine
compiler_puritytook 3-6 s and the wholegates/_run.tsstayed around 20 s, the same as main.
What needs to change before merge:
- The 30 s cap. The gates must finish in 30 s (see
gates/_run.ts), and this check has no bound on its total time. It runs 8 clang builds and 16 program runs one after another, each with its own timeout (20 s per build, 5 s per run), so the worst case is about 240 s, and the test gate waits for all of it. It is also the first part of the test gate that runs on the local machine instead of the cluster: on main every test goes to the minis, while this needs clang on whatever machine runs the gates, and its speed depends on that machine. The header of gates/test.ts still says everything runs on the cluster. - Style, following the repo's style (bend.ts and the rest of gates/): 7 new lines are over 80 columns, there are 3
ifs without braces, and one line holds fourcompare(...)calls. - Minor: only the first fixture's baseline is truly fresh; the other three are compiled after earlier fixtures in the same process. It matches a fresh process today, but "fresh baselines" in the comments overstates it.
Contributor
Author
|
Thanks @Lorenzobattistela — I accept the 30-second cap and cluster-execution findings, and won’t claim the current per-process timeouts bound the entire check. I’ll revise the execution design and baseline wording, plus the bounded style fixes. @VictorTaelin: could you approve this narrowly scoped gates/ follow-up to #1310 in #1409? The test must respect the existing total gate budget and cluster ownership; I will not edit protected gate files or their allow-list/caps without your approval. |
oxura
marked this pull request as draft
October 8, 2026 19:36
….3 s state_run loads each fixture twice, takes its first copy's C and JS (hash and probes left) as the baseline and compares the second copy at every step; the shards already run these programs. PROBES is exported instead of a retained_probes() hook. The baselines are honest about not coming from a fresh process. Same catch as before: without file_new's PROBES reset, 4 tests fail with 40 mismatches.
Lorenzobattistela
marked this pull request as ready for review
October 12, 2026 12:41
Lorenzobattistela
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1310.
The tests never compiled more than one book in the same process, so state a compile leaves behind went unseen. #976 was one such bug:
PROBESwasn't reset, so every compile kept the previous books' probes, with C still byte-identical.gates/test.tsnow has astate_runcheck that runs while the shards do. In one process, it loads and checks two copies of each of 4 fixtures (reg/borrow_loop,run/harness_cache_compile,run/harness_cache_purity,run/harness_cache_stats). The first copy's C and JS are the baseline. The second copy goes throughc c js c snf js c +c +js c js, wheresnfnormalizes every def and+compiles the next fixture, so it covers A -> B -> A. At every step its bytes (hashed) and the number of probes left must match the baseline. A mismatch counts as a test failure under the fixture that diverged.The check only compiles: no clang, and it runs no programs. The shards already build and run these fixtures. It takes about 0.3 s.
bend2/comp.ts:PROBESis exported so the check can read its length (+1 ttok).state_rundoes with them.Verified: with the #976 reset removed, 4 tests fail with 40 probe mismatches. Leaks in other shared state (hot/lits/ids) aren't caught, because they don't change the probe count or the output. Gates: repo 54/54, test 1602/1602, ping 49/49.