Skip to content

A compiler tier the tree calls for runs beside the producers an entry names - #2128

Open
VanshajPoonia wants to merge 25 commits into
ClickHouse:mainfrom
VanshajPoonia:issues/2119-detected-compiler-tiers
Open

VanshajPoonia wants to merge 25 commits into
ClickHouse:mainfrom
VanshajPoonia:issues/2119-detected-compiler-tiers

Conversation

@VanshajPoonia

@VanshajPoonia VanshajPoonia commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #2119
Related: #1609

Changelog category (leave one):

  • Backward Incompatible Change

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_producer now also runs every compiler tier its tree has a build file for. A new scip_excluded_producers list 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_status names the rule behind each tier in compiler_tier_rules.

Why

An entry that names scip_producer ended the tree inference: worker_owns answered from the named producers alone. A tree that gained a go.mod after the entry was written kept only its fast tier for the Go files. code.index_status listed go in compiler_candidates and 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_producer still names the primary tier and its checkout. scip_extra_producers still adds a tier the tree has no build file for. The new scip_excluded_producers is 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 a go.mod below 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.
  • applies is removed. selected_by carries the rule and worker_owns and the status both use it.
  • The mirror sweep named only the named tiers' checkouts for such an entry. It would have removed a detected tier's checkout on every sweep. runnable_producers now names every tier's checkout but the excluded ones, as it did for an entry naming no producer.
  • code.index_status skips 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.
  • A tier that stops running keeps its watermark in code_index_state, whether the entry excludes it or the tree loses its last build file for it. compiler_tiers takes the tiers the entry runs, runnable_producers over the tree as indexed now, which is the rule worker_owns applies. A tier outside them gets no card and is never the primary of an entry naming no producer, so neither commit_coverage nor a coverage watch waits on it. code.index_status with a commit rebuilds the tiers, the primary's fields and scip_commit_py from that call's state and tree 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 LOOM_CODE_STATUS_TTL_S (read_tree). When that read fails, they keep every tier the entry may run.
  • A tier that comes back resumes from its old watermark, and a commit waits on it until it catches up. A tier that never ran indexes in full on its first pass.
  • run_python_delta.sh gives owner excluded to a Python tier the entry excludes and none to an entry that does not run the Python tier, and skips both. Before, none covered 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-full says the entry does not run the clang tier when it skips one, instead of naming the entry's producer as the owner.
  • run_tier and 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. In run_tier it writes or drops no health record.
  • Left alone: checkout_for, so a detected tier works in <scip_checkout_dir>.<producer>, and the named primary tier and its card in compiler_tiers.
  • A newly detected tier that never ran starts on the next pass with no watermark and indexes its modules in full, as a first run does.
  • A self-service entry (code.repo.add) gets the same rule but has no exclusion list, as it has no extra producers.
  • The dashboard does not render compiler_tier_rules yet. Its types are unchanged.
  • Related: Index status explains how to select a detected compiler tier #1609 adds a warning for exactly the unselected tier case, which no longer arises. It touches the same lines in index_status.py.

Compatibility, rollout and rollback

  • Wire: code.index_status returns a new compiler_tier_rules map (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 renumbered default_NNNN helpers. An entry in LOOM_CODE_REPOS_JSON takes scip_excluded_producers, a list or a comma separated string like scip_extra_producers. A build that does not know the key ignores it. compiler_tiers lists 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.
  • Operator steps: before upgrading, add scip_excluded_producers to 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 runs run_python_delta.sh on a tree with no Python build file adds python to scip_extra_producers, or the script skips it.
  • Rollback: reverting stops the extra tiers. Their watermarks stay in code_index_state and their checkouts stay until the sweep removes them. No migration and no new table.

Tests

  • The new and changed tests failed before the change and pass after it. They cover a named tier, a detected tier and an excluded tier in 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 the loom code scip-full skip message.
  • python -m pytest over 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: two test_mirrors.py repack tests inside their git-only fixture (3 packs where it expects 56), four test_scip_harness_windows.py cases that fail on a clean upstream/main checkout too, three test_code_delta_stream.py cases that read /proc/self/fd, which macOS lacks, and test_no_new_tunable_constant on _MAX_GENERATION from 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.py and test_scip_harness_checkout_path.py need bash 4 or newer. They pass with bash 5 and fail with macOS's bash 3.2 (_HARNESS_ON_EXIT[@]: unbound variable), the same on upstream/main.
  • tests/unit/test_doc_links.py, test_public_copy.py, the SDK and codegen tests, test_package_contracts.py and test_code_extractor_stamp.py pass (729 in that run, with the same 9 failures from the shell harness file).
  • scripts/gates/mypy_gate.py reports 0 errors and mypy --strict sdk/python/loom is clean. scripts/gates/function_length_gate.py is at its baseline.
  • python -m scripts.codegen.<gen> --check is clean for the Python, TypeScript, Rust (and its fixtures) and Go SDK generators, the docs reference and the reach census. ruff format --check and ruff check are clean. Prettier 3.9.9 is clean on the four edited pages.
  • Not run here: the integration suite and the frontend, which this diff does not touch.

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

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/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 under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.
  • I signed the Contributor License Agreement (CLA) if CLA assistant requested a signature.

Note

High Risk
Backward-incompatible indexing behavior: upgrades can start new compiler workers (notably Go ~4GB/module) on repos that only named one producer unless scip_excluded_producers is set first; coverage and worker ownership logic changed broadly.

Overview
Breaking change: A repo entry that sets scip_producer no longer limits indexing to that tier alone—it also runs every compiler tier implied by build manifests in the tree (go.mod, root package.json, CMakeLists.txt, Python manifests, etc.), unless you opt out.

Adds scip_excluded_producers on registry entries so incidental manifests (e.g. pyproject.toml only for tests on a C++ repo) can suppress a tier without reverting to “named producer only” behavior. A tier listed in both scip_producer / scip_extra_producers and scip_excluded_producers still runs (explicit naming wins).

worker_owns and tier scheduling are rebuilt around selected_by, runnable_producers, and tier_rules instead of the old applies helper. Named tiers skip a tree read; detected tiers read manifests; excluded tiers never own the checkout. Mirror sweep and compiler workers use runnable_producers so checkout dirs match what actually runs.

code.index_status exposes compiler_tier_rules (producer → scip_producer, scip_extra_producers, tree, or scip_excluded_producers). compiler_tiers and commit commit_coverage / coverage watches only wait on tiers the entry runs now—stale watermarks from stopped tiers no longer block “ready.” Tree reads are cached per git_head via read_tree; failed reads conservatively treat all possible tiers as running. Per-commit status refreshes tier cards from live state, not the stale cache.

Operational tweaks: run_python_delta.sh skips excluded Python tiers distinctly; loom code scip-full explains clang skip in terms of “entry does not run clang tier”; compiler/crossref passes isolate tree-read failures to one repo. Docs and SDK types include the new field and rules map.

Reviewed by Cursor Bugbot for commit 47bc75e. Bugbot is set up for automated code reviews on this repo. Configure here.

… 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>
@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Dec 5, 2026 7:56am UTC
loom-telemetry Ready Ready Preview Dec 5, 2026 7:56am UTC

Request Review

@zlareb1 zlareb1 self-assigned this Dec 4, 2026

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread server/code/app/index_status.py Resolved
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>
@VanshajPoonia

Copy link
Copy Markdown
Contributor Author

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.

  • 4be374f: a tier the entry excludes gets no card in compiler_tiers, so neither commit_coverage nor a coverage watch waits on its old watermark.
  • 74a8def: run_python_delta.sh skips a Python tier the entry excludes, for a clang entry too.
  • 0166d76: a failed ownership read is that entry's error, and the compiler pass goes on to the next entry.
  • b354cdd: the same for the crossref pass, which asks the same ownership question before its per-entry try.

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 --check and 69 unit test files that reach the compiler tiers, the status, coverage, crossref, the harness and the docs (1,096 passed). Two test_mirrors.py repack tests fail on this Mac inside their git-only fixture, which gets 3 packs where it expects 56. Four test_scip_harness_windows.py cases also fail here, and they fail on a clean main checkout too. This PR touches neither. The replies are on the threads.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A compiler tier that stops matching the tree can leave commit coverage waiting on a watermark that can no longer advance.

Comment thread server/code/app/index_status.py Outdated
tiers = compiler_tiers(cfg.scip_producer, state, lags)
# The entry's own tier is the headline; every tier with a watermark is listed but
# one the entry drops. An entry naming no producer defers to whichever is set.
tiers = compiler_tiers(cfg.scip_producer, state, lags, dropped(cfg))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 — This filters explicit exclusions but still requires a tier whose build marker disappeared. If a clang entry auto-detects Go at A and commit B removes its last go.mod, the Go worker stops while this status and the coverage watch still wait on Go's watermark at A. Use the current tier selection for readiness and test a detected tier losing its last marker.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the go.mod case. Fixed in 0fada47 and 1897c48. compiler_tiers now takes the tiers the entry runs, and every caller passes runnable_producers(cfg, tree) over the tree as indexed now. That is the rule worker_owns applies, so the status, commit_coverage and the coverage watch drop a tier on the same pass its worker stops. The status reads the tree once and shares it with compiler_candidates and compiler_tier_rules. The watch op reads it once per call and the notify pass once per namespace. A failed tree read keeps every tier the entry may run, so it never makes a commit ready early.

code.index_status with a commit served its tiers from the cached status, which can be an hour old on a quiet web process. 1897c48 rebuilds them from that call's state and tree, as the watch does. Without it the answer kept waiting on Go until the cache refreshed, and a tier whose go.mod came back was not waited on at all. 33b59f0 and 6dd8436 take scip_producer, scip_commit, scip_lag and scip_commit_py from that call too. a9db222 keeps each namespace's tree for LOOM_CODE_STATUS_TTL_S, so a poller reads it once per status TTL and not on every call.

Tests in test_code_status_ops.py:

  • test_a_tier_whose_last_build_file_went_holds_back_no_commit is your case: a clang entry with Go at A and no go.mod left at B. It also checks that worker_owns stops the Go worker for that tree. On 68685c1 the status answered ready false with waiting_on ['Go'].
  • test_a_commit_is_judged_on_the_tiers_the_tree_calls_for_now_not_the_cached_ones keeps one cached status while the go.mod goes and comes back. Before 1897c48 the second call still waited on Go.
  • test_a_tree_the_status_cannot_read_keeps_every_tier_the_entry_may_run covers the failed read.
  • test_a_poller_reads_the_tree_once_per_status_ttl counts one tree read for a status and three polls. There were four before a9db222.

test_a_tier_whose_last_build_file_went_holds_back_no_watch in test_code_coverage_watch.py waits on Go while the tree has a go.mod, then removes it and runs notify_once. On 68685c1 that pass delivered nothing.

The same rule covers a tier the entry stops naming in scip_producer or scip_extra_producers when the tree does not call for it either.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@VanshajPoonia

Copy link
Copy Markdown
Contributor Author

Thank you for the go.mod case and for pointing to #2142.

  • 0fada47: readiness takes its tiers from the tree as indexed now. A tier whose last build file went no longer holds back commit_coverage or a coverage watch.
  • 335c55d: run_python_delta.sh runs a Python tier only when the entry runs it. Before, a clang entry with no Python build file that did not name python still got the manual pass and moved scip_commit_py. An operator who wants that pass now names python in scip_extra_producers. Say if you would rather keep the manual pass for those entries.
  • 1b70027: the TypeScript, Go and Python workers' docstrings name the entries they run.
  • 1897c48: code.index_status with a commit judges it on the tiers the entry runs now, not the cached status's tier list.
  • 21c133c: loom code scip-full says the entry does not run the clang tier when it skips one. It named the entry's producer as the owner, which is wrong when clang is excluded.
  • fe5551c: the operations guide says a tier that comes back resumes from its old watermark, and that a code.repo.add entry has no exclusion list.
  • 1e717c6: a test of the status with a tree read that fails.
  • 0c1b081 merges main. The Go wire models were the only conflict, so they are main's copy with every generator rerun.
  • a9db222: the status and coverage paths read a namespace's tree once per LOOM_CODE_STATUS_TTL_S. The workers still read it on each pass.
  • 33b59f0: a commit's answer takes scip_producer, scip_commit and scip_lag from the tiers it was judged on, and a card keeps its cached lag only while its watermark has not moved.
  • 99bd645: run_python_delta.sh asks worker_owns once, and dropped() goes with its last caller.
  • a922902: rewraps the worker docstrings from 1b70027.
  • 6dd8436: a commit's answer reads scip_commit_py from the same state as its tiers.
  • d82188e: a test that read_tree keeps an empty tree and retries a failed read.

The isolation walk failure is not from this PR. test_ops_that_cannot_bound_their_answer_are_refused fails the same way on main's CI at 502a008, this PR's base, in the isolation gates, part 4 and both Postgres isolation jobs. #2142 fixes it. Unit part 3 fails only on test_no_new_tunable_constant for _MAX_GENERATION, which #2138 fixes. Dependency review stops on incomplete snapshots. Both fail on main too.

Checked locally after the merge: ruff, the mypy gate, the function length gate, the secrets gate, every generator --check and the analyzer corpus are clean. 104 unit test files that reach the compiler tiers, the status, coverage, crossref, the scip CLI, the harness and the docs: 2,746 passed and 35 skipped. Ten fail here for reasons outside this diff: two test_mirrors.py repack tests in their git-only fixture, four test_scip_harness_windows.py cases, three test_code_delta_stream.py cases that read /proc/self/fd, which macOS lacks, and test_no_new_tunable_constant on main's _MAX_GENERATION.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_watch in test_code_coverage_watch.py is 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 fix notify_once delivered B. Now it waits on Go and delivers once Go reaches B.
  • test_a_tier_whose_last_build_file_went_holds_back_no_watch no 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_ones in test_code_status_ops.py polls code.index_status with 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_not also 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 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@VanshajPoonia

Copy link
Copy Markdown
Contributor Author

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 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python SDK adapter job fails during test collection with agent-framework-core 1.26.0 and opentelemetry-api 1.46.0. Clean main fails with the same versions and traceback. A separate PR constrains the incompatible dependency. PR job · Main job · Fix #2164

…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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 47bc75e. Configure here.

logger.debug("compiler inference unavailable for %s: %s", cfg.namespace, e)
return None
_trees.put(key, tree)
return tree

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tree cache binds the wrong head

High Severity

read_tree caches the live index under the git_head it was given, but that head is not the tree it just read. _repo_status saves git_head, then awaits mirror lag, and only then fills the cache, so a newer commit's manifests can be stored for the previous head for the whole status TTL. A coverage check or watch still on that head can omit a tier the tree required, and a ready watch is not asked again.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 47bc75e. Configure here.

@VanshajPoonia

Copy link
Copy Markdown
Contributor Author

Thank you for the re-review.

  • f9784e2 merges main. The Go and Rust wire models were the generated conflicts. They are main's copies with every generator rerun. notify_once also conflicted with main's derived_once block. It keeps that block and reads the running tiers inside it.
  • 47bc75e keeps the tree read per indexed head (see the thread).

CI on ae0cb33: the Python SDK adapter jobs are the dependency pin #2164 fixed, which this merge brings in. pytest integration (Postgres 18, storage) failed only test_cell_update_run_pg.py::test_delayed_actual_finish_cannot_release_after_backend_death_and_fresh_rewiden[False], which this PR does not touch. The same test failed in the same job on #2199 and #1704 today. Dependency review stops on incomplete snapshots as before.

Drafted with AI help and reviewed by me manually.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


head = state_value(state, "git_head")
runs = runnable_producers(cfg, await read_tree(CodeRepo(), cfg, head))
_fresh_heads(st, state, cfg.scip_producer, runs) # Never a cached head or tier

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 — With a warm status cache, removing the last go.mod refreshes the tier cards and coverage but leaves Go in compiler_tier_rules and compiler_candidates. Compute the selection fields and compiler warnings from the same tree read as coverage. Extend the warm-cache removal test to check those fields.

This branch has not been deployed

No deployments
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.

A compiler tier the tree calls for runs beside the producers an entry names

2 participants