Repository navigation
A compiler tier the tree calls for runs beside the producers an entry names - #2128
VanshajPoonia wants to merge 29 commits into
Conversation
… names Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
left a comment
There was a problem hiding this comment.
Two focused probes confirmed that an excluded tier can still block commit coverage and that an explicitly excluded Python tier can still run through the manual upload path.
Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…d-compiler-tiers The Go and Rust wire models are main's copies with every generator rerun on the merged tree. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
|
Thank you for the probes. All three are fixed, each with a test that fails on 6daaf55. The crossref pass had the same ownership read as the third, so it gets its own commit too.
Main is merged in 68685c1. The Go and Rust wire models were the only conflicts, so they are main's copies with every generator rerun. Checked locally after the merge: ruff, the mypy gate, the function length gate, every generator |
zlareb1
left a comment
There was a problem hiding this comment.
A compiler tier that stops matching the tree can leave commit coverage waiting on a watermark that can no longer advance.
zlareb1
left a comment
There was a problem hiding this comment.
The isolation walk cannot build the worker approval and enrollment requests on the clean CI base or this merge. The same test passes with the existing fixture fix in an authenticated ClickHouse stack. Failed job · Fixture fix #2142.
The status and the coverage watch kept every tier with a watermark the entry did not exclude. When a clang entry's last go.mod went, the Go worker stopped at its old watermark and readiness waited on it for good. Both paths now take their tiers from runnable_producers over the tree as indexed now, the rule the workers use. A tree read that fails keeps every tier the entry may run, so it never makes a commit ready early. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
The identity step answered "none" only for an entry naming no producer. A clang entry whose tree has no Python build file and that does not name python fell through to the manual path and moved scip_commit_py for a tier the workers and the status do not run. It now asks worker_owns for every entry, so the script, the workers and the status agree on the Python tier. An operator who wants that tier names it in scip_extra_producers. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
The TypeScript, Go and Python workers said they run an entry whose scip_producer names their tier. They run every entry worker_owns gives them, which since this change includes a tier the tree calls for beside a named one. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
code.index_status with a commit served its coverage from the cached status and refreshed only the heads and the watermarks of the tiers already in it. The cache can be an hour old on a quiet web process. A tier whose last go.mod went kept the commit waiting until the next refresh, and a tier that came back was not waited on at all. The commit branch now rebuilds the tiers from this call's state and the tree as indexed now, as the coverage watch does. A failed state read keeps the cached tiers as before. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
The skip named the entry's scip_producer as the tier whose worker owns the entry. Since a tree's tiers run beside the named one, an entry is skipped because it does not run clang: not named, excluded, or no root CMakeLists.txt. For an entry that excludes clang no worker owns that tier, and for one naming no producer the message printed "inferred" as a tier. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
It said a tier the tree starts calling for begins with no watermark and indexes in full. That holds only for a tier that never ran. One that ran before resumes from its old watermark, and a commit waits on it until it catches up. The guide also says a code.repo.add entry has no exclusion list, and the paragraph is wrapped like the rest of the page again. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…y may run Test only. The status and the coverage paths read a failed tree read as every tier the entry may run, so a commit never turns ready early on it. read_tree and runnable_producers each had a unit test, and this one runs the whole code.index_status call with the read failing. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…d-compiler-tiers The Go wire models are main's copy with every generator rerun on the merged tree. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
A commit poll on code.index_status read the tree on every call, and in a repository with no root go.mod that read scans the namespace's file paths for one below the root. read_tree now keeps each namespace's answer for LOOM_CODE_STATUS_TTL_S, which the status, the coverage watch op and the notify pass share. A failed read is not kept. The compiler tier workers still read the tree on their own passes. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
The commit branch of code.index_status rebuilt the tier cards but left scip_producer, scip_commit and scip_lag at the cached status's values, so an entry naming no producer whose Go tier stopped could answer Go as its primary next to a Python-only card list. Those fields now come from the rebuilt primary. A card also keeps its cached lag only while its watermark is the commit that lag was counted from, as published_lags does, so a moved watermark reads -1 instead of the old count. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
The identity step asked worker_owns up to twice and kept dropped() for its excluded case, the helper's last caller. It now asks once: an entry that does not run the tier is excluded when its list names python, else none. A tier the entry names still runs even when it is also excluded, and the owner table gains that case. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
Rewording which entries each worker runs left lines past 90 columns beside short ones. Text unchanged. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
The commit branch refreshed the tier cards and the primary's fields but left scip_commit_py and scip_py_lag at the cached status's values, so a Python entry could answer a fresh Python card next to an older scip_commit_py. The field now comes from this call's state, and its lag reads -1 once the watermark has moved, as the cards' lags do. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
Test only. read_tree keeps an empty answer, which a truthiness check would drop, so a repository with no build files would be read on every poll. A failed read is not kept, so the next call reads again. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
|
Thank you for the go.mod case and for pointing to #2142.
The isolation walk failure is not from this PR. Checked locally after the merge: ruff, the mypy gate, the function length gate, the secrets gate, every generator |
zlareb1
left a comment
There was a problem hiding this comment.
A ready watch can fire before a compiler tier that returns to the tree has caught up. The existing removal test clears the cache between heads and misses this case.
| their own); None when the read fails. A status or coverage answer then waits on every | ||
| tier the entry may run, so a failed read never makes a commit ready.""" | ||
| key = (cfg.org, cfg.namespace) | ||
| if (tree := _trees.get(key)) is not None: |
There was a problem hiding this comment.
P1 — A ready watch can fire before a returning tier catches up. Cache the tree while go.mod is absent and the Go watermark is A. If Fast and Clang publish B with go.mod before the cache expires, this hit hides Go and the watch permanently delivers B as ready. Tie the producer lookup to the indexed head used for coverage and test a tier returning with a warm cache.
There was a problem hiding this comment.
Thank you for checking the returning tier with a warm cache. Fixed in 47bc75e. read_tree now keeps its cache per (org, namespace, git_head). Each caller passes the git_head of the state it judges coverage on: the status, the commit poll, the watch op and the notify pass. A new indexed head misses the cache and reads the tree again. A tier that head calls for is then waited on from its first answer. Polls at one head still share one read per LOOM_CODE_STATUS_TTL_S.
Tests:
test_a_tier_whose_build_file_returns_holds_back_the_watchintest_code_coverage_watch.pyis your case. The watch op reads the tree at A with no go.mod and Go's watermark at A. Then the fast and C++ tiers publish B with a go.mod while that read is still cached. Before the fixnotify_oncedelivered B. Now it waits on Go and delivers once Go reaches B.test_a_tier_whose_last_build_file_went_holds_back_no_watchno longer clears the cache. The head moves from B to C as the go.mod goes. The first pass at C delivers.test_a_commit_is_judged_on_the_tiers_the_tree_calls_for_now_not_the_cached_onesintest_code_status_ops.pypollscode.index_statuswith a commit across three heads and never clears the cache. Before the fix the second head still waited on Go.test_a_tree_read_is_kept_but_a_failed_one_is_notalso checks that a new head reads the tree again.
The three behaviour tests fail on the merged branch without the fix and pass with it.
An ingest writes a commit's file rows before it moves git_head. A read inside that window can see the next commit's build files under the old head. That is what an uncached read sees at the same moment, and the next head gets its own entry.
Drafted with AI help and reviewed by me manually.
zlareb1
left a comment
There was a problem hiding this comment.
The read-scope isolation test cannot build the worker approval and enrollment requests on this run or on the earlier main run. #2156 adds those request fields and keeps the refusal assertion. The failed run still blocks this head. PR job · Main job · Merged fix
…d-compiler-tiers The Go and Rust wire models were the only conflicts. They are main's copies with every generator rerun on the merged tree. Main brings ClickHouse#2156, which the read-scope isolation gate needs. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
|
Thank you for tracing the isolation failure to #2156. Main is merged in ae0cb33, which brings #2156 in. The Go and Rust wire models were the only conflicts. They are main's copies with every generator rerun on the merged tree. The status, coverage watch, compiler tier, delta upload, tunable constant, SDK parity and docs tests pass on the merge (193). |
zlareb1
left a comment
There was a problem hiding this comment.
The returning-tier finding still applies. The indexed head can advance before the namespace-keyed detection cache expires, so a ready watch can fire without waiting for the returning tier. GitHub also reports a merge conflict in the generated Go and Rust models.
…d-compiler-tiers The Go and Rust wire models are main's copies with every generator rerun on the merged tree. notify_once keeps main's derived_once block and reads the running tiers once per namespace inside it. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…r is waited on at once Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 47bc75e. Configure here.
|
Thank you for the re-review.
CI on ae0cb33: the Python SDK adapter jobs are the dependency pin #2164 fixed, which this merge brings in. Drafted with AI help and reviewed by me manually. |
zlareb1
left a comment
There was a problem hiding this comment.
The tree read still races publication of the indexed head, as described in the existing thread. The status response also mixes two tree reads. GitHub reports conflicts with main.
…d-compiler-tiers Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com> # Conflicts: # sdk/go/wire/models.gen.go # sdk/rust/src/wire_models.rs
…sked about read_tree stored the tree under the git_head the caller had read earlier, but the caller can await a mirror lag first, so the read may see the next head's files. It now reads the head again after the tree and returns None when it moved. The caller waits on every tier the entry may run and no entry is kept for the old head. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…t judged coverage on With a warm status cache, removing the last go.mod refreshed the tier cards and the coverage but left Go in compiler_tier_rules, compiler_candidates and the has-not-run warnings. The commit path now rebuilds those from the same tree read. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
notify_once reads the tiers an entry runs before it judges a watch. The stub for coverage_for from ClickHouse#2170 took three arguments and the pass read the tree against no database, so no watch was delivered. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
|
Thank you for the re-review. This round answers the three open points.
CI on 47bc75e: "pytest integration part 4 of 4" failed One window stays open. An ingest writes a commit's file rows before it moves Drafted with AI help and reviewed by me manually. |
zlareb1
left a comment
There was a problem hiding this comment.
The status fields now share a single tree read. The coverage finding still applies before watermark publication. Ingestion writes or removes file rows before it advances git_head, so both head reads can return B while the marker read already reflects C. Bind compiler inference to the same revision as the coverage state and cover that interval in the ready-watch test.

Closes: #2119
Related: #1609
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
A code repository entry that names
scip_producernow also runs every compiler tier its tree has a build file for. A newscip_excluded_producerslist drops a tier whose build file is incidental, so add it before upgrading for such an entry: each tier that starts costs build time and memory (about 4 GB for each Go module job).code.index_statusnames the rule behind each tier incompiler_tier_rules.Why
An entry that names
scip_producerended the tree inference:worker_ownsanswered from the named producers alone. A tree that gained ago.modafter the entry was written kept only its fast tier for the Go files.code.index_statuslistedgoincompiler_candidatesand nothing ran it. Anyone who named one producer and later added another language hit this, and only a warning showed it.Now a tier runs when the entry names it or when the tree calls for it and the entry does not exclude it.
scip_producerstill names the primary tier and its checkout.scip_extra_producersstill adds a tier the tree has no build file for. The newscip_excluded_producersis the way out for a build file that only serves tooling, which is the case the explicit producer was used for before.Scope and risk
worker_owns(server/code/app/index/producer_inference.py) answers true for a named tier and false for an excluded one without reading the tree. For any other tier it reads the tree as an entry naming no producer already did, which is one membership read of a few file names (plus one for ago.modbelow the root). An entry that names a producer did no tree read before, so each compiler worker pass now reads once for it. A named tier wins over the exclusion list.appliesis removed.selected_bycarries the rule andworker_ownsand the status both use it.runnable_producersnow names every tier's checkout but the excluded ones, as it did for an entry naming no producer.code.index_statusskips the "available for this tree but has not run" warning for an excluded tier. It still warns for a selected tier that has not run.code_index_state, whether the entry excludes it or the tree loses its last build file for it.compiler_tierstakes the tiers the entry runs,runnable_producersover the tree as indexed now, which is the ruleworker_ownsapplies. A tier outside them gets no card and is never the primary of an entry naming no producer, so neithercommit_coveragenor a coverage watch waits on it.code.index_statuswith a commit rebuilds the tiers, the primary's fields,scip_commit_py,compiler_candidates,compiler_tier_rulesand the "has not run" warnings from that call's state and one tree read instead of the cached status's. The status, the coverage watch op and the notify pass read a namespace's tree at most once per indexed head (git_head) andLOOM_CODE_STATUS_TTL_S(read_tree). A tier a new head calls for is waited on from that head's first answer. When that read fails or the head moves while it runs, they keep every tier the entry may run.run_python_delta.shgives ownerexcludedto a Python tier the entry excludes andnoneto an entry that does not run the Python tier, and skips both. Before,nonecovered only an entry naming no producer, so a clang entry took the manual path with Python excluded or with no Python build file in its tree.loom code scip-fullsays the entry does not run the clang tier when it skips one, instead of naming the entry's producer as the owner.run_tierand the crossref pass read ownership inside the per-entry failure boundary. A failed tree read is that entry's error and the pass goes on to the next entry. Inrun_tierit writes or drops no health record.checkout_for, so a detected tier works in<scip_checkout_dir>.<producer>, and the named primary tier and its card incompiler_tiers.code.repo.add) gets the same rule but has no exclusion list, as it has no extra producers.compiler_tier_rulesyet. Its types are unchanged.index_status.py.Compatibility, rollout and rollback
code.index_statusreturns a newcompiler_tier_rulesmap (producer to rule,{}by default). The Python, TypeScript, Rust and Go SDKs, the operation reference and the Rust contract test are regenerated. The Rust diff is mostly renumbereddefault_NNNNhelpers. An entry inLOOM_CODE_REPOS_JSONtakesscip_excluded_producers, a list or a comma separated string likescip_extra_producers. A build that does not know the key ignores it.compiler_tierslists only the tiers the entry runs over its current tree, and its description in the operation reference says so. No field is added or removed for this.scip_excluded_producersto each entry that names a producer and whose tree has a build file for another tier it should not run. Otherwise that tier starts on the next pass after the upgrade. The Go tier takes about 4 GB for each module job (LOOM_CODE_SCIP_GO_JOBS). An entry that names another producer and runsrun_python_delta.shon a tree with no Python build file addspythontoscip_extra_producers, or the script skips it.code_index_stateand their checkouts stay until the sweep removes them. No migration and no new table.Tests
worker_owns, the entry JSON key, the status rules and warnings, and the sweep keeping a detected tier's checkout while removing an excluded one's. A tier excluded after it ran holding back commit coverage or a coverage watch, a clang entry running an excluded Python tier on the manual path, and a failed ownership read ending a compiler or crossref pass each have a test that fails on the round's base. So do a detected tier whose last build file went holding back commit coverage or a coverage watch, a cached status judging a commit on its old tier list, a clang entry with no Python build file getting the manual Python pass, and theloom code scip-fullskip message. So do a tier whose go.mod comes back with a watch delivering before it catches up, a tree read that saw the head move being kept for the old head, and a commit answer keeping a removed tier incompiler_candidates,compiler_tier_rulesand the warnings.python -m pytestover 104 unit test files that reach the compiler tiers, the status, coverage watches, crossref, the scip CLI, the shell harnesses and the docs, after merging main: 2,746 passed and 35 skipped. Ten fail on this Mac for reasons outside this diff: twotest_mirrors.pyrepack tests inside their git-only fixture (3 packs where it expects 56), fourtest_scip_harness_windows.pycases that fail on a cleanupstream/maincheckout too, threetest_code_delta_stream.pycases that read/proc/self/fd, which macOS lacks, andtest_no_new_tunable_constanton_MAX_GENERATIONfrom main, which test_tunable_constants passes on main: the worker setup generation bound says why it is not a setting #2138 fixes.test_run_python_delta_upload_mode.pyandtest_scip_harness_checkout_path.pyneed bash 4 or newer. They pass with bash 5 and fail with macOS's bash 3.2 (_HARNESS_ON_EXIT[@]: unbound variable), the same onupstream/main.code.repos, status and watch tests. The same twotest_mirrors.pyrepack tests fail, on main too.tests/unit/test_doc_links.py,test_public_copy.py, the SDK and codegen tests,test_package_contracts.pyandtest_code_extractor_stamp.pypass (729 in that run, with the same 9 failures from the shell harness file).scripts/gates/mypy_gate.pyreports 0 errors andmypy --strict sdk/python/loomis clean.scripts/gates/function_length_gate.pyis at its baseline.python -m scripts.codegen.<gen> --checkis clean for the Python, TypeScript, Rust (and its fixtures) and Go SDK generators, the docs reference and the reach census.ruff format --checkandruff checkare clean. Prettier 3.9.9 is clean on the four edited pages.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code wrote the diff and ran the checks listed under Tests.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.Note
High Risk
Backward-incompatible indexing behavior can start new compiler workers (cost and ~4 GB per Go module job) on upgrade unless operators preconfigure
scip_excluded_producers; coverage readiness logic changed for dynamic trees.Overview
Backward-incompatible: Repository entries that set
scip_producernow run every compiler tier their tree’s build files imply (Go, TypeScript, C++, Python), not only the named primary andscip_extra_producers. Use the newscip_excluded_producerslist to suppress incidental manifests (e.g. apyproject.tomlused only for test tooling).Tier selection is centralized in
producer_inference:worker_owns, mirror checkout sweeps, and workers userunnable_producers/selected_by. Excluded or tree-removed tiers keep old watermarks but disappear fromcompiler_tiers, quality warnings, and commit coverage / coverage watches—so CI is not blocked by tiers that no longer run.code.index_statusaddscompiler_tier_rules(per producer:scip_producer,scip_extra_producers,tree, orscip_excluded_producers) and refreshes tier lists on commit queries via TTL-cached tree reads (read_tree).run_python_delta.shandloom code scip-fullskip tiers the entry does not run, with clearer messages.Docs and Python/TypeScript/Rust/Go SDK types reflect the new field and semantics.
Reviewed by Cursor Bugbot for commit 4a5fad9. Bugbot is set up for automated code reviews on this repo. Configure here.