TypeScript member passes index more members than a change needs, and one failing member fails all
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python, typescript
- Ambito
- tooling
Direzione di ricerca
Start with scripts/scip_harness/scip_ts_projects.py and scripts/scip_harness/run_typescript_delta.sh, then review the related changes in #1782 and the selection behavior in #1958. The issue identifies five selection cases and a partial failure policy that needs a watermark decision. Done means the selection, reference indexing, and member failure cases have documented outcomes, with the proposed harness coverage passing.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Company
Independent
Component
Code index
Describe the situation
#1782 runs one scip-typescript process per member and, on a delta, only the members that own a changed path. A delta inside one package works as intended: one process, 6 s on a small fixture, and under a minute at 0.95 GB on the repository from #1678 where the whole project set ran before. Four parts of the selection and the member loop cost more than the change needs, or turn one bad member into a failed pass:
-
A changed TypeScript path that no member owns reruns every member and converts nothing.
select_projects_for_deltareturns the full set for it (scripts/scip_harness/scip_ts_projects.py:267-273), but the merge keeps only documents inside a member's directory, so no member index can hold that path (case 2 of https://github.com/ClickHouse/loom/issues/1958). Root*.config.ts,scripts/*.tsandtools/**trigger it. Fixture: a commit changingtools/build.tsruns 4 indexer processes for 18.0 s and writes 0 files. On the repository from #1678, 77 of the last 400 first-parent commits (19%) take this path (test/scripts63 paths,scripts/lib23,scripts/e2e9,test/vitest6), each a rerun of all 226 members; a full pass over the list (222 members at an earlier commit) took 7,629 s, past the worker's defaultcode_scip_ts_delta_timeout_secondsof 3,600 s. -
A change in a nested member also selects every member above it. The filter (
scip_ts_projects.py:262-266) selects each member that contains the path by prefix, while the merge keeps only the most specific owner (_preferred_owner). With memberssrcandsrc/infra, a change tosrc/infra/net.tsindexes both, and the merge then dropssrc's documents for that path. A root-level explicit member (scope., such as typescript-eslint'stsconfig.repo-config-files.json) is selected by every delta. On the repository from #1678, 131 of the 275 subset windows (48%) selectsrconly through a path in asrc/*member;srcalone took 826 s in a full pass, so these deltas spend about 14 minutes on a member whose output is discarded. -
One process per member re-indexes each member's reference closure. scip-typescript 0.4.0 indexes every project a target references, recursively, in the same process (
dist/src/main.js:148-154), and the merge then discards the copies. On typescript-eslint, a full pass takes 4.5 times as long for the same rows, with a smaller largest process:typescript-eslint a1faa174processes wall peak RSS, largest process files / symbols / edges before #1782, root pass, --full1 91 s 1.51 GiB 1,368 / 6,735 / 4,220 (10 documents emitted twice) main,--full36 408 s 0.97 GiB 1,358 / 6,628 / 4,220 (same per-file content) before #1782, one edit in packages/utils/src1 89 s 1.29 GiB 1 / 5 / 0 main, the same edit3 50 s 0.73 GiB 1 / 5 / 0, same rows The delta on
mainranutils/tsconfig.build.json,utils/tsconfig.spec.jsonand the root-leveltsconfig.repo-config-files.json(case 2), and each process re-indexed its reference closure. -
One member whose indexer exits non-zero fails the pass for all members (
run_typescript_delta.sh:164-170underset -e), the watermark stays, and the next pass repeats it. On typescript-eslint at90497319, the first member fails withTS5023 Unknown compiler option 'stableTypeOrdering'(scip-typescript 0.4.0's bundled TypeScript does not know the option) and the pass exits 1 after 0.8 s. The root pass before #1782 failed as a whole too, so this is not new; with dozens or hundreds of separate runs it is the likeliest failure, and a member split could contain it.
Does it reproduce on the latest release or main?
Yes
How to reproduce
Selection, from a checkout of main:
printf 'tools/build.ts\n' > unowned.txt
python3 scripts/scip_harness/scip_ts_projects.py filter --changed-file-list unowned.txt -- packages/a packages/b
# prints packages/a and packages/b
printf 'src/infra/net.ts\n' > nested.txt
python3 scripts/scip_harness/scip_ts_projects.py filter --changed-file-list nested.txt -- src src/infra
# prints src and src/infra
printf 'packages/a/src/x.ts\n' > one.txt
python3 scripts/scip_harness/scip_ts_projects.py filter --changed-file-list one.txt -- packages/a packages/b tsconfig.repo-config-files.json
# prints packages/a and tsconfig.repo-config-files.json
Cost and failure, from the Loom checkout, on typescript-eslint/typescript-eslint after pnpm install --frozen-lockfile --ignore-scripts, with a wrapper as SCIP_TYPESCRIPT that logs each invocation:
git -C /path/to/typescript-eslint checkout a1faa174
DELTA_OUT=full.json scripts/scip_harness/run_typescript_delta.sh /path/to/typescript-eslint --full HEAD # 36 invocations
git -C /path/to/typescript-eslint checkout 90497319
DELTA_OUT=head.json scripts/scip_harness/run_typescript_delta.sh /path/to/typescript-eslint --full HEAD # exit 1, TS5023
The same commands against scripts/scip_harness/ at 1bc5be8b1^1 give the "before #1782" rows.
Expected performance
- An unowned TypeScript path selects no member, or once ownership follows each member's resolved files (https://github.com/ClickHouse/loom/issues/1958), the members whose program includes it.
- The filter selects
_preferred_ownerover the full member set for each changed path, as the merge does, so asrc/infrachange runssrc/infraalone and a root-level member runs only for paths no other member owns. - A member is indexed without re-indexing its references (its references stripped in a generated tsconfig, or members ordered so each closure is indexed once), keeping the full pass near the single root process's time.
- A failing member leaves the other members' rows: the merge takes the parts that succeeded, the failed member's files keep their rows marked stale, and the log names the member and its error. This needs a decision on the watermark for a partial pass.
Environment
Loom main at 3058a5816 (contains #1782); "before #1782" is scripts/scip_harness/ at 1bc5be8b1^1.
@sourcegraph/scip-typescript 0.4.0, node 22.23.4, pnpm 12.15.0, Python 3.12.
run_typescript_delta.sh in DELTA_OUT mode, the worker's mode; no ClickHouse involved.
Repositories: a 4-package pnpm fixture; typescript-eslint/typescript-eslint a1faa174 (references umbrella, nested umbrellas, 36 members) and 90497319; the repository from #1678 with a project list of 226 members expanded from 15 directory patterns, history classified with main's select_projects_for_delta over one-commit windows.
The host was shared with other jobs: wall times are within about ±20%. The 7,629 s and 826 s figures come from #1782's head e8fbb33 before the merge, with a 24 GiB heap and with the merge and converter changes from https://github.com/ClickHouse/loom/issues/1959 and #1704 in place, because the whole-index merge fails on that repository.
Related issues and pull requests
Related: https://github.com/ClickHouse/loom/pull/1782
Related: https://github.com/ClickHouse/loom/issues/1678
Related: https://github.com/ClickHouse/loom/issues/1958
Additional context
How this was found: an AI tool found it, and I have not reproduced it myself.
Smaller selection gaps:
- A lockfile name at any depth counts as a shared change, because the name test runs before the
/test (scip_ts_projects.py:226-231), sopackages/a/test/fixtures/x/package-lock.jsonreindexes every member. has-configreads the whole window (run_typescript_delta.sh:211): an unownedpackage.jsonbeside an owned TypeScript edit drops--changed-filesfor the selected member, so its whole output is converted.- An empty selection falls through to
index_workspace's branch for no member list, which runs scip-typescript on the checkout root (run_typescript_delta.sh:150-160, 200-205).select_projects_for_deltadoes not return an empty list today when a TypeScript path changed, so it is not reachable, but that fallback is the whole-root pass.
Tests that would cover this; the harness tests use a stub indexer, so cases 3 and 4 above need the real one:
- Members
srcandsrc/infra, a change tosrc/infra/x.ts: assert onlysrc/infrais indexed. - A root-level explicit member beside package members, a package-only change: assert the root-level member is not selected.
- An unowned TypeScript path alone (
tools/build.ts): assert no indexer run, or a documented reason for one. - A member whose indexer exits non-zero among healthy members: assert the documented outcome.
- A nested lockfile under a member's test fixtures: assert that member alone, or none, is selected.
Redaction
- I removed tokens, keys, passwords and personal or customer data from everything above.
- Lingua principale
- Python
- Stelle
- 263
- Fork
- 47
- Merge medio
- 14h 21m
- PR unite (30g)
- 873
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ClickHouse/loom
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
ClickHouse/loom#2014 ·
I maintainer di solito rispondono entro 1 giorno
-
Options of loom period-digest, reextract, reconcile-status and demote-activity-narration print no help textForse già presa @VanshajPoonia l’ha presa oggi. Apertabug good first issue help wanted up-for-grabs
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/loom#1988 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
A compiler-tier checkout fetch from a shallow mirror never records its headForse già presa @KaloyanNaumov l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
ClickHouse/loom#2016 ·
I maintainer di solito rispondono entro 1 giorno
-
Delta workers fetch the compiler-tier checkout under a hard-coded 600 s limitForse già presa @KaloyanNaumov l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 35/100
ClickHouse/loom#2012 ·
I maintainer di solito rispondono entro 1 giorno
-
loom participant retire cannot retire an orphaned participant after container replacement or host rebootForse già presa @l0K1ngg l’ha presa oggi. Apertabug help wanted up-for-grabs
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
ClickHouse/loom#2007 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ClickHouse/loom
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
TigreGotico/orthography2ipa#2950 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Unstructured-IO/unstructured#4876 ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openfoodfacts/openfoodfacts-python#579 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
fairagro/m4.2_sql_to_arc#388 ·
I maintainer di solito rispondono entro 1 giorno