TypeScript member passes index more members than a change needs, and one failing member fails all
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python, typescript
- 領域
- tooling
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 263
- フォーク
- 47
- 平均マージ
- 14時間 21分
- マージ済み PR(30日)
- 873
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ClickHouse/loom のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
ClickHouse/loom#2014 ·
メンテナーはふだん 1 日以内に返信
-
Options of loom period-digest, reextract, reconcile-status and demote-activity-narration print no help text対応中かも @VanshajPoonia が今日担当しました。 オープンbug good first issue help wanted up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
ClickHouse/loom#1988 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
A compiler-tier checkout fetch from a shallow mirror never records its head対応中かも @KaloyanNaumov が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
ClickHouse/loom#2016 ·
メンテナーはふだん 1 日以内に返信
-
Delta workers fetch the compiler-tier checkout under a hard-coded 600 s limit対応中かも @KaloyanNaumov が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
ClickHouse/loom#2012 ·
メンテナーはふだん 1 日以内に返信
-
loom participant retire cannot retire an orphaned participant after container replacement or host reboot対応中かも @l0K1ngg が今日担当しました。 オープンbug help wanted up-for-grabs
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
ClickHouse/loom#2007 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
ClickHouse/loom の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
TigreGotico/orthography2ipa#2950 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Unstructured-IO/unstructured#4876 ·
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
openfoodfacts/openfoodfacts-python#579 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
fairagro/m4.2_sql_to_arc#388 ·
メンテナーはふだん 1 日以内に返信