Repository navigation
ci: seed each Swift job width admission compiles at #14275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0cdf7a1
8fa8617
f74860d
ae20f25
3289fc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,26 +54,36 @@ def fingerprint(revision: str, xcode: str) -> str: | |
| ).strip() | ||
|
|
||
|
|
||
| def is_seed_job(name: str | None) -> bool: | ||
| """The seed job is a matrix over pools, which GitHub names "seed (<pool>)".""" | ||
| return name == SEED_JOB or str(name or "").startswith(f"{SEED_JOB} (") | ||
|
|
||
|
|
||
| def seed_state(api: Api, repository: str, run: dict) -> str: | ||
| """'seeded', 'skipped' or 'none' for one seeder run. | ||
|
|
||
| Concurrency is workflow-wide, so this run's decide starts only after every | ||
| earlier seeder run finished: no ancestor's seed is still being built. | ||
| Each pool seeds its own Swift job width, so a commit is seeded only when | ||
| every pool's job saved. Concurrency is per pool, so an earlier run may | ||
| still be building; it reads as 'none' and the walk moves past it, which | ||
| can only make a push build, never skip wrongly. | ||
| """ | ||
| status, conclusion = run.get("status"), run.get("conclusion") | ||
| # A pending run can still be replaced by a newer push. | ||
| if status != "completed" or conclusion != "success": | ||
| return "none" | ||
| jobs = api(f"repos/{repository}/actions/runs/{run['id']}/jobs?per_page=100").get("jobs", []) | ||
| job = next((j for j in jobs if j.get("name") == SEED_JOB), None) | ||
| if job is None: | ||
| seeds = [j for j in jobs if is_seed_job(j.get("name"))] | ||
| if not seeds: | ||
|
Comment on lines
+75
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '1,210p' scripts/ci/seed_decide.py
sed -n '1,115p' tests/test_seed_decide.pyRepository: manaflow-ai/cmux Length of output: 11442 🏁 Script executed: printf '%s\n' '--- workflow references ---'
rg -n -C 5 'pool|matrix|seed|decide|skip|build' .github/workflows/seed-derived-data.yml scripts/ci tests/test_seed_decide.py
printf '%s\n' '--- changed paths and targeted diff ---'
git diff --stat 7f58f608654893d191398bf96103814a11fad2a5 ae20f25333d6bd74f4abf608bc576f07e24f8ecb
git diff --unified=25 7f58f608654893d191398bf96103814a11fad2a5 ae20f25333d6bd74f4abf608bc576f07e24f8ecb -- scripts/ci/seed_decide.py tests/test_seed_decide.py .github/workflows/seed-derived-data.ymlRepository: manaflow-ai/cmux Length of output: 45548 🏁 Script executed: printf '%s\n' '--- width scope and fallback symbols ---'
rg -n -C 8 'scope|scoped|prefix|restore|cache|runner.*(pool|width)|CPU|width|seed' scripts/ci/seed_derived_data.py .github/actions .github/workflows/ci-macos.yml .github/workflows/seed-derived-data.yml scripts/ci --glob '*.py' --glob '*.yml' --glob '*.yaml' --glob '*.sh'
printf '%s\n' '--- workflow consumer locations ---'
rg -n -C 10 'admission-derived-data|seed_derived_data|cache-restore|restore-keys|CMUX_COMPILE_ADMISSION|build.*true|needs\.decide' .github/workflows scripts/ci tests/test_seed_derived_data.py tests --glob '*.py' --glob '*.yml' --glob '*.yaml' --glob '*.sh'Repository: manaflow-ai/cmux Length of output: 45549 🏁 Script executed: sed -n '1,240p' scripts/ci/seed_derived_data.py
printf '%s\n' '--- exact restore consumers ---'
rg -l 'admission-derived-data|seed_derived_data.py|CMUX_COMPILE_ADMISSION_DERIVED_DATA' .github/workflows scripts/ci tests --glob '*.py' --glob '*.yml' --glob '*.yaml' --glob '*.sh' | sortRepository: manaflow-ai/cmux Length of output: 11250 Require every expected seed matrix job before returning
The width-aware consumer can fall back to another width's seed, so this does not reuse an incompatible cache. It does leave the preferred-width cache missing and causes additional compilation work. Count a run as 🤖 Prompt for AI Agents |
||
| return "none" | ||
| if job.get("conclusion") == "skipped": | ||
| if all(j.get("conclusion") == "skipped" for j in seeds): | ||
| return "skipped" | ||
| if job.get("conclusion") != "success": | ||
| return "none" | ||
| save = next((s for s in job.get("steps", []) if s.get("name") == SAVE_STEP), None) | ||
| return "seeded" if save is not None and save.get("conclusion") == "success" else "none" | ||
| for job in seeds: | ||
| if job.get("conclusion") != "success": | ||
| return "none" | ||
| save = next((s for s in job.get("steps", []) if s.get("name") == SAVE_STEP), None) | ||
| if save is None or save.get("conclusion") != "success": | ||
| return "none" | ||
| return "seeded" | ||
|
|
||
|
|
||
| def nearest_seed(api: Api, repository: str, ancestors: Iterable[str]) -> str | None: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: manaflow-ai/cmux
Length of output: 15225
🏁 Script executed:
Repository: manaflow-ai/cmux
Length of output: 30193
🏁 Script executed:
Repository: manaflow-ai/cmux
Length of output: 27917
🏁 Script executed:
Repository: manaflow-ai/cmux
Length of output: 16501
🏁 Script executed:
Repository: manaflow-ai/cmux
Length of output: 8976
Deduplicate the evaluated seed pools.
When
MACOS_RUNNER_PRisblacksmith-12vcpu-macos-26, both matrix entries resolve to the same pool. They share the same concurrency group and seed key, so the workflow can run a redundant seed job. If a newer push replaces the pending index-zero job, that commit can miss product publication.This does not block CI. The macOS consumer compiles the product when reuse misses, and seed adoption can use an earlier seed or perform a cold build. The impact is wasted runner time and a narrow product-cache miss. Generate one matrix entry per distinct pool.
🤖 Prompt for AI Agents