Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Cut CI queue: scope push triggers, and rebalance Repo tests (CPU) on measured runner time

Daniel Hana78110b1be5e
diff --git a/.github/workflows/studio-api-smoke.yml b/.github/workflows/studio-api-smoke.yml
index 7984aea5d93..369df1be24f 100644
--- a/.github/workflows/studio-api-smoke.yml
+++ b/.github/workflows/studio-api-smoke.yml
@@ -38,6 +38,12 @@ on:
# Named, not globbed: the rest of tests/studio is Playwright drivers this
# workflow never runs.
- 'tests/studio/studio_api_smoke.py'
+ # Reached by the installer this workflow already triggers on, so a commit touching
+ # only one of these changes what the job runs while matching nothing else in the
+ # list. install.sh --local hands off to the checked-out studio/setup.sh
+ # (install.sh:7351), setup.sh runs nvidia_probe.py (setup.sh:266), and setup.ps1
+ # runs install_python_stack.py and install_llama_prebuilt.py (setup.ps1:8127, 8655).
+ - 'studio/nvidia_probe.py'
- '.github/workflows/studio-api-smoke.yml'
- '.github/scripts/retry-with-apt-lock.sh'
# Every server boot in this workflow shells out to that script, so an edit
@@ -57,6 +63,28 @@ on:
- '.github/actions/uv-cache-save/action.yml'
push:
branches: [main]
+ paths:
+ - 'studio/backend/**'
+ - 'studio/setup.sh'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - 'studio/prebuilt_core.py'
+ - 'studio/install_manifest.py'
+ - 'unsloth_cli/**'
+ - 'install.sh'
+ - 'pyproject.toml'
+ - 'tests/studio/studio_api_smoke.py'
+ - 'studio/nvidia_probe.py'
+ - '.github/workflows/studio-api-smoke.yml'
+ - '.github/scripts/retry-with-apt-lock.sh'
+ - '.github/scripts/boot-studio-api-only.sh'
+ - '.github/scripts/wait-for-health.sh'
+ - '.github/scripts/hf-download-with-retry.sh'
+ - '.github/actions/install-unsloth-local/action.yml'
+ - '.github/actions/frontend-dist-restore/action.yml'
+ - '.github/actions/frontend-dist-save/action.yml'
+ - '.github/actions/uv-cache-restore/action.yml'
+ - '.github/actions/uv-cache-save/action.yml'
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/studio-backend-ci.yml b/.github/workflows/studio-backend-ci.yml
index 5eacca9d927..97e974133da 100644
--- a/.github/workflows/studio-backend-ci.yml
+++ b/.github/workflows/studio-backend-ci.yml
@@ -54,11 +54,33 @@ on:
# execute tests/studio, and skipped Backend CI, which does. The guards were then
# absent for exactly the change they guard. Same reason as install.sh above.
- '.github/actions/**'
+ # Test inputs, not sources: tests/python/test_docker_publish_tag_scheme.py and
+ # test_docker_publish_ref_freeze.py read docker-publish.yml, and
+ # tests/test_formatter_fixed_point.py plus the pinned-ruff step read
+ # .pre-commit-config.yaml. Editing either changes this job's verdict with no
+ # source change, and docker-publish.yml runs only on tags so it cannot self-check.
+ - '.github/workflows/docker-publish.yml'
+ - '.pre-commit-config.yaml'
- '.github/workflows/studio-backend-ci.yml'
# tests/python/test_amd_extras_contract.py asserts against this file.
- '.github/workflows/security-audit.yml'
push:
branches: [main]
+ paths:
+ - 'studio/**'
+ - 'unsloth/**'
+ - 'unsloth_cli/**'
+ - 'tests/**'
+ - 'docker/**'
+ - 'install.sh'
+ - 'install.ps1'
+ - 'scripts/**'
+ - 'pyproject.toml'
+ - '.github/actions/**'
+ - '.github/workflows/docker-publish.yml'
+ - '.pre-commit-config.yaml'
+ - '.github/workflows/studio-backend-ci.yml'
+ - '.github/workflows/security-audit.yml'
concurrency:
# Unique per commit on main, so a merge burst cannot cancel a pending run
@@ -484,46 +506,117 @@ jobs:
# to fix, and the sharded spread has not been measured on a runner yet.
timeout-minutes: 45
strategy:
- # Three shards of one selection, balanced on measured time, not on file count. Summed
- # test time over the whole discovered set is 2946s (`--durations=0`, -n 16), and it
- # splits by directory almost exactly in thirds:
+ # Three shards of one selection, balanced on measured time, not on file count.
+ #
+ # The balance this replaces was predicted, not observed. It claimed the longest shard
+ # was 1.056x an ideal third, from summed test time on a 16-worker box:
#
# tests/studio 1035.8s 271 files 35.2%
# tests/python + tests/kaggle 955.8s 124 files 32.4%
# everything else 954.4s 180 files 32.4%
#
- # so the longest shard is 1.056x an ideal third and no rebalancing by named file is
- # worth the property below.
+ # What the runner actually does is not that. Measured on the pytest step of this job
+ # over the last ~48 completed runs of each shard, medians:
+ #
+ # Repo tests (CPU, studio) 18.6 min (p90 19.1, max 19.9)
+ # Repo tests (CPU, rest) 8.8 min
+ # Repo tests (CPU, python) 7.5 min
#
- # Shard 3 is written as "tests/ minus the other two roots", never as an allowlist, so
- # a new file lands in exactly one shard without a workflow edit: under tests/studio it
- # is shard 1's, under tests/python or tests/kaggle shard 2's, and anywhere else,
- # including a brand-new top-level directory, shard 3's.
- # tests/test_ci_repo_cpu_shards.py fails if that stops being true.
+ # so the longest shard is 1.60x an ideal third, not 1.056x, and the job's wall clock
+ # is the studio shard alone: 20.9 min against 9.9 and 10.7. Summed time on a
+ # 16-worker host does not predict a 4-vCPU runner, which is the only shape that
+ # matters here.
+ #
+ # Within tests/studio the weight is almost all in one directory. Profiled locally at
+ # this job's own `-n 4 --dist loadgroup` shape with no GPU visible, tests/studio/install
+ # is 658s of the shard's 1125s of CPU-time (58.5%) across 64 files, studiobench 127s,
+ # and the 100-odd files directly under tests/studio 341s. Splitting on that boundary is
+ # what makes a balance reachable at all: no arrangement of the old three roots gets
+ # below 1.4x, because one of them is half the suite.
+ #
+ # Scaling those proportions onto the measured medians gives the blocks below, in
+ # runner-minutes: install 10.9, studiobench 2.1, the rest of tests/studio 5.6,
+ # tests/python 5.4, tests/kaggle 2.1, everything else 8.8. Total 34.9, ideal third
+ # 11.6, and install alone bounds any three-way split at 10.9.
+ #
+ # The arrangement below was then RUN, not just predicted, at the same local -n 4
+ # CPU-only shape as the numbers above:
+ #
+ # old shard new shard
+ # longest 362.8s (studio) 279.0s (studio-install)
+ # middle 208.2s (python) 235.0s (studio)
+ # shortest 174.1s (rest) 234.9s (rest)
+ # longest / ideal 1.46x 1.12x
+ #
+ # so the critical path falls 23% locally, and 1.12x matches what the block arithmetic
+ # predicted. Same 12 failures before and after, redistributed across the shards, and
+ # the id partition was diffed directly: 25762 ids collected either way, none dropped,
+ # none doubled.
+ #
+ # On the runner the imbalance is WORSE than locally (1.60x against 1.46x), because the
+ # studio shard is relatively heavier there, so the saving should be at least this
+ # large; 18.6 min becoming roughly 13 to 14 is the expectation, not a measurement.
+ # Re-measure here rather than trusting that, exactly as the old comment should have
+ # been. The shard that lands longest is the one to split next, and 1.12x is close
+ # enough that the next move is probably not another rebalance.
+ #
+ # Why it matters beyond the wall clock: this job's cap is 45 min and its pytest step
+ # has been measured from 852s to 1683s across 40 runs, so the spread, not the mean, is
+ # what cancels a run. A cancelled job loses the shell, CLI and Docker steps silently
+ # (see the note above `timeout-minutes`), and evening the shards takes the worst shard
+ # further from the cap rather than raising the cap again.
+ #
+ # The `rest` shard is still written as "tests/ minus the other roots", never as an
+ # allowlist, so a new file lands in exactly one shard without a workflow edit:
+ # tests/studio/install and tests/studio/studiobench are shard 1's, tests/python and
+ # the rest of tests/studio are shard 2's, and anything else, including tests/kaggle
+ # and a brand-new top-level directory, falls to shard 3 by default.
+ # tests/test_ci_repo_cpu_shards.py fails if that stops being true, and it derives the
+ # partition from this matrix rather than restating it.
+ #
+ # Shard 1's roots are named UNDER tests/studio, which shards 2 and 3 exclude. That
+ # matters: an explicit root and an `--ignore` of its parent in the same selection is
+ # ambiguous (the note on the backend matrix above records that `--ignore=FILE` does
+ # not filter a file passed as an explicit argument), so the partition is arranged to
+ # never need that behaviour.
+ #
+ # Two check names change with this: "Repo tests (CPU, python)" no longer exists and
+ # "Repo tests (CPU, studio-install)" is new. Required status checks have to be updated
+ # in the same change or every pull request blocks on a check that cannot run.
#
# fail-fast off: three shards of one suite, and cancelling the other two on the first
# failure would hide which of them were also red.
fail-fast: false
matrix:
include:
+ # The heavy half of tests/studio: install, plus studiobench to fill it out. Both
+ # are named roots UNDER tests/studio, which the other two shards exclude, so the
+ # partition stays expressible without an explicit root fighting an --ignore.
+ - shard: studio-install
+ selection: >-
+ tests/studio/install
+ tests/studio/studiobench
+ # The rest of tests/studio, plus tests/python. Keeps the name `studio` because the
+ # hardware-spoof and load_freeze steps below select on it, and those files live
+ # directly under tests/studio.
- shard: studio
selection: >-
tests/studio
+ tests/python
+ --ignore=tests/studio/install
+ --ignore=tests/studio/studiobench
--ignore=tests/studio/load_freeze
--ignore=tests/studio/test_hardware_dispatch_matrix.py
--ignore=tests/studio/test_is_mlx_dispatch_gate.py
--ignore=tests/studio/test_xpu_spoof_pipeline.py
--ignore=tests/studio/test_mlx_context_platform_matrix.py
- - shard: python
- selection: >-
- tests/python
- tests/kaggle
+ # The catch-all. tests/kaggle now falls to it by default rather than being named
+ # by the shard that no longer exists.
- shard: rest
selection: >-
tests/
--ignore=tests/studio
--ignore=tests/python
- --ignore=tests/kaggle
--ignore=tests/qlora
--ignore=tests/saving
--ignore=tests/utils
@@ -709,9 +802,10 @@ jobs:
run: python -m pytest tests/studio/load_freeze -q --tb=short
- name: CLI tests (unsloth_cli)
- # Not under tests/, so no shard owns it by discovery; it rides the python shard,
- # which is the shortest of the three.
- if: matrix.shard == 'python'
+ # Not under tests/, so no shard owns it by discovery; it rides the shortest shard,
+ # which after the rebalance above is `rest` at a projected 10.9 runner-minutes. It
+ # was on `python`, which no longer exists.
+ if: matrix.shard == 'rest'
# unsloth_cli/tests had no CI at all: `unsloth_cli/**` was only a paths
# trigger and a ruff target, so 673 tests covering the studio launcher,
# the pre-exposure gate and the auth secret writers ran nowhere, and
diff --git a/.github/workflows/studio-export-capability-ci.yml b/.github/workflows/studio-export-capability-ci.yml
index 395b501ff59..8070d81d24a 100644
--- a/.github/workflows/studio-export-capability-ci.yml
+++ b/.github/workflows/studio-export-capability-ci.yml
@@ -14,14 +14,29 @@ name: Unsloth export capability
on:
pull_request:
paths:
- - 'studio/backend/utils/hardware/hardware.py'
- 'studio/backend/core/export/export.py'
- 'studio/backend/routes/export.py'
- 'studio/backend/main.py'
- 'studio/backend/tests/test_export_capability.py'
+ # The install below is `uses:` on these two, so an edit to either changes what
+ # this workflow actually runs. Absent while the push trigger was unfiltered,
+ # every commit re-ran this after merge and the gap could not be observed;
+ # scoping push is what turns it into a real hole.
+ - '.github/actions/pip-cache-restore/action.yml'
+ - '.github/actions/pip-cache-save/action.yml'
+ - 'studio/backend/utils/hardware/**'
- '.github/workflows/studio-export-capability-ci.yml'
push:
branches: [main]
+ paths:
+ - 'studio/backend/core/export/export.py'
+ - 'studio/backend/routes/export.py'
+ - 'studio/backend/main.py'
+ - 'studio/backend/tests/test_export_capability.py'
+ - '.github/actions/pip-cache-restore/action.yml'
+ - '.github/actions/pip-cache-save/action.yml'
+ - 'studio/backend/utils/hardware/**'
+ - '.github/workflows/studio-export-capability-ci.yml'
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/studio-frontend-ci.yml b/.github/workflows/studio-frontend-ci.yml
index b3a8423356f..e02885dc434 100644
--- a/.github/workflows/studio-frontend-ci.yml
+++ b/.github/workflows/studio-frontend-ci.yml
@@ -45,10 +45,46 @@ on:
- 'tests/studio/test_playwright_server_lifecycle.py'
- 'scripts/sync_allow_scripts_pins.py'
- 'tests/studio/test_sync_allow_scripts_pins.py'
+ # Both the Linux and Windows jobs execute this checked-out script before installing
+ # dependencies (lines 154 and 649), so an edit to it changes what they run.
+ - 'scripts/lockfile_supply_chain_audit.py'
- '.github/workflows/studio-frontend-ci.yml'
- '.github/scripts/retry-with-apt-lock.sh'
push:
branches: [main]
+ paths:
+ - 'studio/frontend/**'
+ - 'scripts/check_frontend_dep_removal.py'
+ - 'tests/studio/test_frontend_dep_removal.py'
+ - 'tests/studio/playwright_strip_ansi_smoke.py'
+ - 'tests/studio/playwright_composer_icons.py'
+ - 'tests/studio/playwright_chat_autoscroll.py'
+ - 'tests/studio/playwright_research_freeze.py'
+ - 'tests/studio/playwright_research_review.py'
+ - 'tests/studio/playwright_heavy_thread.py'
+ - 'tests/studio/probe_dismiss_guard.py'
+ - 'tests/studio/playwright_nonmodal_menus.py'
+ - 'tests/studio/playwright_settings_tabs.py'
+ - 'tests/studio/playwright_data_settings.py'
+ - 'tests/studio/playwright_keyboard_shortcuts.py'
+ - 'tests/studio/playwright_find_in_page.py'
+ - 'tests/studio/playwright_tool_activity.py'
+ - 'tests/studio/playwright_stream_pacing.py'
+ - 'tests/studio/playwright_code_block_flicker.py'
+ - 'tests/studio/playwright_link_definition_probe.py'
+ - 'tests/studio/_code_block_flicker_analysis.py'
+ - 'tests/studio/test_code_block_flicker_contract.py'
+ - 'tests/studio/_playwright_robust.py'
+ - 'tests/studio/test_autoscroll_harness_contract.py'
+ - 'tests/studio/test_heavy_thread_harness_contract.py'
+ - 'tests/studio/test_heavy_thread_gap_contract.py'
+ - 'tests/studio/test_heavy_thread_measurement_integrity.py'
+ - 'tests/studio/test_playwright_server_lifecycle.py'
+ - 'scripts/sync_allow_scripts_pins.py'
+ - 'tests/studio/test_sync_allow_scripts_pins.py'
+ - 'scripts/lockfile_supply_chain_audit.py'
+ - '.github/workflows/studio-frontend-ci.yml'
+ - '.github/scripts/retry-with-apt-lock.sh'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }}
diff --git a/.github/workflows/studio-inference-smoke.yml b/.github/workflows/studio-inference-smoke.yml
index 5f0c4aa8214..851bec2c3cc 100644
--- a/.github/workflows/studio-inference-smoke.yml
+++ b/.github/workflows/studio-inference-smoke.yml
@@ -50,6 +50,12 @@ on:
- 'unsloth_cli/**'
- 'install.sh'
- 'pyproject.toml'
+ # Reached by the installer this workflow already triggers on, so a commit touching
+ # only one of these changes what the job runs while matching nothing else in the
+ # list. install.sh --local hands off to the checked-out studio/setup.sh
+ # (install.sh:7351), setup.sh runs nvidia_probe.py (setup.sh:266), and setup.ps1
+ # runs install_python_stack.py and install_llama_prebuilt.py (setup.ps1:8127, 8655).
+ - 'studio/nvidia_probe.py'
- '.github/workflows/studio-inference-smoke.yml'
- '.github/scripts/retry-with-apt-lock.sh'
# Every server boot in this workflow shells out to that script, so an edit
@@ -71,6 +77,28 @@ on:
- '.github/actions/uv-cache-save/action.yml'
push:
branches: [main]
+ paths:
+ - 'studio/backend/**'
+ - 'studio/setup.sh'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - 'studio/prebuilt_core.py'
+ - 'studio/install_manifest.py'
+ - 'unsloth_cli/**'
+ - 'install.sh'
+ - 'pyproject.toml'
+ - 'studio/nvidia_probe.py'
+ - '.github/workflows/studio-inference-smoke.yml'
+ - '.github/scripts/retry-with-apt-lock.sh'
+ - '.github/scripts/boot-studio-api-only.sh'
+ - '.github/scripts/wait-for-health.sh'
+ - '.github/scripts/hf-download-with-retry.sh'
+ - '.github/scripts/studio_smoke/multi_turn_chat.py'
+ - '.github/actions/install-unsloth-local/action.yml'
+ - '.github/actions/frontend-dist-restore/action.yml'
+ - '.github/actions/frontend-dist-save/action.yml'
+ - '.github/actions/uv-cache-restore/action.yml'
+ - '.github/actions/uv-cache-save/action.yml'
# Manual trigger for pre-warming HF_HOME caches on main, or re-running
# against an arbitrary branch without pushing a no-op commit.
workflow_dispatch:
diff --git a/.github/workflows/studio-ui-smoke.yml b/.github/workflows/studio-ui-smoke.yml
index 3e49cca8da0..8a780bdb0fb 100644
--- a/.github/workflows/studio-ui-smoke.yml
+++ b/.github/workflows/studio-ui-smoke.yml
@@ -40,6 +40,12 @@ on:
- 'tests/studio/**'
- '.github/scripts/run-studio-permission-browser.sh'
- '.github/scripts/run-studio-indicator-browser.sh'
+ # Reached by the installer this workflow already triggers on, so a commit touching
+ # only one of these changes what the job runs while matching nothing else in the
+ # list. install.sh --local hands off to the checked-out studio/setup.sh
+ # (install.sh:7351), setup.sh runs nvidia_probe.py (setup.sh:266), and setup.ps1
+ # runs install_python_stack.py and install_llama_prebuilt.py (setup.ps1:8127, 8655).
+ - 'studio/nvidia_probe.py'
- '.github/workflows/studio-ui-smoke.yml'
# Every server boot in this workflow shells out to that script, so an edit
# to it changes what this workflow actually runs.
@@ -61,6 +67,31 @@ on:
- '.github/actions/uv-cache-save/action.yml'
push:
branches: [main]
+ paths:
+ - 'studio/backend/**'
+ - 'studio/frontend/**'
+ - 'studio/setup.sh'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - 'studio/prebuilt_core.py'
+ - 'studio/install_manifest.py'
+ - 'unsloth_cli/**'
+ - 'install.sh'
+ - 'pyproject.toml'
+ - 'tests/studio/**'
+ - '.github/scripts/run-studio-permission-browser.sh'
+ - '.github/scripts/run-studio-indicator-browser.sh'
+ - 'studio/nvidia_probe.py'
+ - '.github/workflows/studio-ui-smoke.yml'
+ - '.github/scripts/boot-studio-api-only.sh'
+ - '.github/scripts/wait-for-health.sh'
+ - '.github/scripts/hf-download-with-retry.sh'
+ - '.github/scripts/retry-with-apt-lock.sh'
+ - '.github/actions/install-unsloth-local/action.yml'
+ - '.github/actions/frontend-dist-restore/action.yml'
+ - '.github/actions/frontend-dist-save/action.yml'
+ - '.github/actions/uv-cache-restore/action.yml'
+ - '.github/actions/uv-cache-save/action.yml'
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/studio-windows-api-smoke.yml b/.github/workflows/studio-windows-api-smoke.yml
index 94ae8d848bb..7d1473f3723 100644
--- a/.github/workflows/studio-windows-api-smoke.yml
+++ b/.github/workflows/studio-windows-api-smoke.yml
@@ -37,6 +37,12 @@ on:
# Named, not globbed: the rest of tests/studio is Playwright drivers and
# PowerShell units this workflow never runs.
- 'tests/studio/studio_api_smoke.py'
+ # Reached by the installer this workflow already triggers on, so a commit touching
+ # only one of these changes what the job runs while matching nothing else in the
+ # list. install.sh --local hands off to the checked-out studio/setup.sh
+ # (install.sh:7351), setup.sh runs nvidia_probe.py (setup.sh:266), and setup.ps1
+ # runs install_python_stack.py and install_llama_prebuilt.py (setup.ps1:8127, 8655).
+ - 'studio/nvidia_probe.py'
- '.github/workflows/studio-windows-api-smoke.yml'
# Every server boot in this workflow shells out to that script, so an edit
# to it changes what this workflow actually runs.
@@ -47,6 +53,27 @@ on:
- '.github/scripts/hf-download-with-retry.sh'
push:
branches: [main]
+ paths:
+ - 'studio/backend/**'
+ - 'studio/frontend/**'
+ - 'studio/setup.ps1'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - 'studio/prebuilt_core.py'
+ - 'studio/install_manifest.py'
+ - 'unsloth_cli/**'
+ - 'install.ps1'
+ - '.github/actions/frontend-dist-restore/action.yml'
+ - '.github/actions/frontend-dist-save/action.yml'
+ - '.github/actions/uv-cache-restore/action.yml'
+ - '.github/actions/uv-cache-save/action.yml'
+ - 'pyproject.toml'
+ - 'tests/studio/studio_api_smoke.py'
+ - 'studio/nvidia_probe.py'
+ - '.github/workflows/studio-windows-api-smoke.yml'
+ - '.github/scripts/boot-studio-api-only.sh'
+ - '.github/scripts/wait-for-health.sh'
+ - '.github/scripts/hf-download-with-retry.sh'
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/studio-windows-inference-smoke.yml b/.github/workflows/studio-windows-inference-smoke.yml
index df03369edbc..543a6b95fdc 100644
--- a/.github/workflows/studio-windows-inference-smoke.yml
+++ b/.github/workflows/studio-windows-inference-smoke.yml
@@ -53,6 +53,12 @@ on:
- 'tests/studio/*.ps1'
# The Pester phase runs this guard by name.
- 'tests/studio/test_pester_bootstrap_hardening.py'
+ # Reached by the installer this workflow already triggers on, so a commit touching
+ # only one of these changes what the job runs while matching nothing else in the
+ # list. install.sh --local hands off to the checked-out studio/setup.sh
+ # (install.sh:7351), setup.sh runs nvidia_probe.py (setup.sh:266), and setup.ps1
+ # runs install_python_stack.py and install_llama_prebuilt.py (setup.ps1:8127, 8655).
+ - 'studio/nvidia_probe.py'
- '.github/workflows/studio-windows-inference-smoke.yml'
# Every server boot in this workflow shells out to that script, so an edit
# to it changes what this workflow actually runs.
@@ -65,6 +71,31 @@ on:
- '.github/scripts/studio_smoke/multi_turn_chat.py'
push:
branches: [main]
+ paths:
+ - 'studio/backend/**'
+ - 'studio/frontend/**'
+ - 'studio/setup.ps1'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - 'studio/prebuilt_core.py'
+ - 'studio/install_manifest.py'
+ - 'unsloth_cli/**'
+ - 'install.ps1'
+ - 'scripts/uninstall.ps1'
+ - '.github/actions/frontend-dist-restore/action.yml'
+ - '.github/actions/frontend-dist-save/action.yml'
+ - '.github/actions/uv-cache-restore/action.yml'
+ - '.github/actions/uv-cache-save/action.yml'
+ - 'pyproject.toml'
+ - 'tests/studio_setup_ps1/**'
+ - 'tests/studio/*.ps1'
+ - 'tests/studio/test_pester_bootstrap_hardening.py'
+ - 'studio/nvidia_probe.py'
+ - '.github/workflows/studio-windows-inference-smoke.yml'
+ - '.github/scripts/boot-studio-api-only.sh'
+ - '.github/scripts/wait-for-health.sh'
+ - '.github/scripts/hf-download-with-retry.sh'
+ - '.github/scripts/studio_smoke/multi_turn_chat.py'
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/studio-windows-ui-smoke.yml b/.github/workflows/studio-windows-ui-smoke.yml
index 4f3c4cd72b5..31c8252da06 100644
--- a/.github/workflows/studio-windows-ui-smoke.yml
+++ b/.github/workflows/studio-windows-ui-smoke.yml
@@ -35,6 +35,12 @@ on:
- 'tests/studio/**'
- '.github/scripts/run-studio-permission-browser.sh'
- '.github/scripts/run-studio-indicator-browser.sh'
+ # Reached by the installer this workflow already triggers on, so a commit touching
+ # only one of these changes what the job runs while matching nothing else in the
+ # list. install.sh --local hands off to the checked-out studio/setup.sh
+ # (install.sh:7351), setup.sh runs nvidia_probe.py (setup.sh:266), and setup.ps1
+ # runs install_python_stack.py and install_llama_prebuilt.py (setup.ps1:8127, 8655).
+ - 'studio/nvidia_probe.py'
- '.github/workflows/studio-windows-ui-smoke.yml'
# Every server boot in this workflow shells out to that script, so an edit
# to it changes what this workflow actually runs.
@@ -46,6 +52,30 @@ on:
- '.github/scripts/hf-download-with-retry.sh'
push:
branches: [main]
+ paths:
+ - 'studio/backend/**'
+ - 'studio/frontend/**'
+ - 'studio/setup.ps1'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - 'studio/prebuilt_core.py'
+ - 'studio/install_manifest.py'
+ - 'unsloth_cli/**'
+ - 'install.ps1'
+ - '.github/actions/frontend-dist-restore/action.yml'
+ - '.github/actions/frontend-dist-save/action.yml'
+ - '.github/actions/uv-cache-restore/action.yml'
+ - '.github/actions/uv-cache-save/action.yml'
+ - 'pyproject.toml'
+ - 'tests/studio/**'
+ - '.github/scripts/run-studio-permission-browser.sh'
+ - '.github/scripts/run-studio-indicator-browser.sh'
+ - 'studio/nvidia_probe.py'
+ - '.github/workflows/studio-windows-ui-smoke.yml'
+ - '.github/scripts/boot-studio-api-only.sh'
+ - '.github/scripts/run-studio-ui-lane.sh'
+ - '.github/scripts/wait-for-health.sh'
+ - '.github/scripts/hf-download-with-retry.sh'
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/studio-windows-update-smoke.yml b/.github/workflows/studio-windows-update-smoke.yml
index 6b2416fd269..fafa7aa30b3 100644
--- a/.github/workflows/studio-windows-update-smoke.yml
+++ b/.github/workflows/studio-windows-update-smoke.yml
@@ -32,16 +32,54 @@ on:
- 'tests/studio/test_psmodulepath_normalization.ps1'
- 'studio/setup.ps1'
- 'studio/setup.bat'
- - 'studio/install_python_stack.py'
- - 'studio/install_llama_prebuilt.py'
- 'studio/backend/requirements/**'
- - 'unsloth_cli/commands/studio.py'
- - 'unsloth_cli/__init__.py'
- - 'unsloth_cli/_system_dir_guard.py'
- 'pyproject.toml'
+ # The two installer entrypoints above are not self-contained: these are their
+ # first-order local imports, so a commit touching only one of them changes what
+ # this workflow runs while matching none of the entrypoints. Invisible while the
+ # push trigger was unfiltered, because every commit re-ran this after merge.
+ - 'studio/nvidia_probe.py'
+ - 'studio/prebuilt_core.py'
+ # setup.sh runs this at setup.sh:5130 and setup.ps1 at setup.ps1:9025, so it is the
+ # last executed edge of the installer chain that was not listed here.
+ - 'studio/backend/utils/**'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - 'unsloth_cli/**'
+ # frontend-dist-restore keys its cache on exactly these three globs, and a miss
+ # makes the checked-out setup.ps1 run npm run build (setup.ps1:5060), so a
+ # Windows-only build failure changes this job's verdict. Mirrors the cache key
+ # rather than studio/frontend/**: the key excludes tests, scripts and e2e, and a
+ # change confined to those cannot cause the miss that triggers the build.
+ - 'studio/frontend/*'
+ - 'studio/frontend/src/**'
+ - 'studio/frontend/public/**'
- '.github/workflows/studio-windows-update-smoke.yml'
push:
branches: [main]
+ paths:
+ - 'install.ps1'
+ - '.github/actions/frontend-dist-restore/action.yml'
+ - '.github/actions/frontend-dist-save/action.yml'
+ - '.github/actions/uv-cache-restore/action.yml'
+ - '.github/actions/uv-cache-save/action.yml'
+ - 'scripts/uninstall.ps1'
+ - 'tests/studio/test_uninstall_*.ps1'
+ - 'tests/studio/test_psmodulepath_normalization.ps1'
+ - 'studio/setup.ps1'
+ - 'studio/setup.bat'
+ - 'studio/backend/requirements/**'
+ - 'pyproject.toml'
+ - 'studio/nvidia_probe.py'
+ - 'studio/prebuilt_core.py'
+ - 'studio/backend/utils/**'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - 'unsloth_cli/**'
+ - 'studio/frontend/*'
+ - 'studio/frontend/src/**'
+ - 'studio/frontend/public/**'
+ - '.github/workflows/studio-windows-update-smoke.yml'
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/studiobench-ci.yml b/.github/workflows/studiobench-ci.yml
index b3d2baa3998..9cff0882c28 100644
--- a/.github/workflows/studiobench-ci.yml
+++ b/.github/workflows/studiobench-ci.yml
@@ -35,6 +35,20 @@ on:
pull_request:
paths:
- 'tests/studio/studiobench/**'
+ # Reached by the installer this workflow already triggers on, so a commit touching
+ # only one of these changes what the job runs while matching nothing else in the
+ # list. install.sh --local hands off to the checked-out studio/setup.sh
+ # (install.sh:7351), setup.sh runs nvidia_probe.py (setup.sh:266), and setup.ps1
+ # runs install_python_stack.py and install_llama_prebuilt.py (setup.ps1:8127, 8655).
+ - 'studio/nvidia_probe.py'
+ - 'studio/setup.sh'
+ # setup.sh's fresh-install path runs install_python_stack.py (setup.sh:2014) and
+ # install_llama_prebuilt.py, so the chain from install.sh --local reaches these too.
+ - 'studio/prebuilt_core.py'
+ # setup.sh runs this at setup.sh:5130 and setup.ps1 at setup.ps1:9025, so it is the
+ # last executed edge of the installer chain that was not listed here.
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
- '.github/workflows/studiobench-ci.yml'
# The harness drives the shipped frontend through the real backend, so a
# change to either can break it without touching a file under tests/.
@@ -56,6 +70,26 @@ on:
- '.github/scripts/retry-with-apt-lock.sh'
push:
branches: [main]
+ paths:
+ - 'tests/studio/studiobench/**'
+ - 'studio/nvidia_probe.py'
+ - 'studio/setup.sh'
+ - 'studio/prebuilt_core.py'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - '.github/workflows/studiobench-ci.yml'
+ - 'studio/frontend/**'
+ - 'studio/backend/**'
+ - 'install.sh'
+ - 'pyproject.toml'
+ - '.github/actions/install-unsloth-local/action.yml'
+ - '.github/actions/frontend-dist-restore/action.yml'
+ - '.github/actions/frontend-dist-save/action.yml'
+ - '.github/actions/uv-cache-restore/action.yml'
+ - '.github/actions/uv-cache-save/action.yml'
+ - '.github/scripts/boot-studio-api-only.sh'
+ - '.github/scripts/wait-for-health.sh'
+ - '.github/scripts/retry-with-apt-lock.sh'
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/windows-application-control-ci.yml b/.github/workflows/windows-application-control-ci.yml
index 695f541eba9..0da8053d829 100644
--- a/.github/workflows/windows-application-control-ci.yml
+++ b/.github/workflows/windows-application-control-ci.yml
@@ -52,9 +52,40 @@ on:
- 'studio/src-tauri/src/desktop_auth.rs'
- 'studio/src-tauri/src/preflight/managed.rs'
- 'pyproject.toml'
+ # Reached by the installer this workflow already triggers on, so a commit touching
+ # only one of these changes what the job runs while matching nothing else in the
+ # list. install.sh --local hands off to the checked-out studio/setup.sh
+ # (install.sh:7351), setup.sh runs nvidia_probe.py (setup.sh:266), and setup.ps1
+ # runs install_python_stack.py and install_llama_prebuilt.py (setup.ps1:8127, 8655).
+ - 'studio/nvidia_probe.py'
+ - 'studio/prebuilt_core.py'
+ # setup.sh runs this at setup.sh:5130 and setup.ps1 at setup.ps1:9025, so it is the
+ # last executed edge of the installer chain that was not listed here.
+ - 'studio/backend/utils/**'
+ - 'studio/backend/requirements/**'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
- '.github/workflows/windows-application-control-ci.yml'
push:
branches: [main]
+ paths:
+ - 'install.ps1'
+ - 'scripts/uninstall.ps1'
+ - 'studio/setup.ps1'
+ - 'unsloth_cli/**'
+ - 'studio/src-tauri/src/process.rs'
+ - 'studio/src-tauri/src/update.rs'
+ - 'studio/src-tauri/src/commands.rs'
+ - 'studio/src-tauri/src/desktop_auth.rs'
+ - 'studio/src-tauri/src/preflight/managed.rs'
+ - 'pyproject.toml'
+ - 'studio/nvidia_probe.py'
+ - 'studio/prebuilt_core.py'
+ - 'studio/backend/utils/**'
+ - 'studio/backend/requirements/**'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - '.github/workflows/windows-application-control-ci.yml'
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/windows-no-compiler-ci.yml b/.github/workflows/windows-no-compiler-ci.yml
index 4f2ac8f121d..645cd310d7f 100644
--- a/.github/workflows/windows-no-compiler-ci.yml
+++ b/.github/workflows/windows-no-compiler-ci.yml
@@ -54,9 +54,43 @@ on:
# Its own tests, whose Windows-only ACL control can only run on a Windows
# runner, so an edit to them has to reach one.
- 'tests/python/test_compiler_watch_temp_scan.py'
+ # Reached by the installer this workflow already triggers on, so a commit touching
+ # only one of these changes what the job runs while matching nothing else in the
+ # list. install.sh --local hands off to the checked-out studio/setup.sh
+ # (install.sh:7351), setup.sh runs nvidia_probe.py (setup.sh:266), and setup.ps1
+ # runs install_python_stack.py and install_llama_prebuilt.py (setup.ps1:8127, 8655).
+ - 'studio/nvidia_probe.py'
+ - 'studio/prebuilt_core.py'
+ - 'studio/setup.sh'
+ # setup.sh runs this at setup.sh:5130 and setup.ps1 at setup.ps1:9025, so it is the
+ # last executed edge of the installer chain that was not listed here.
+ - 'studio/backend/utils/**'
+ - 'pyproject.toml'
+ - 'studio/backend/requirements/**'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
- '.github/workflows/windows-no-compiler-ci.yml'
push:
branches: [main]
+ paths:
+ - 'install.ps1'
+ - 'studio/setup.ps1'
+ - 'scripts/uninstall.ps1'
+ - 'install.sh'
+ - 'studio/src-tauri/src/install.rs'
+ - 'studio/src-tauri/src/process.rs'
+ - 'tests/studio/test_installer_av_shapes.py'
+ - '.github/scripts/Watch-ForCompiler.ps1'
+ - 'tests/python/test_compiler_watch_temp_scan.py'
+ - 'studio/nvidia_probe.py'
+ - 'studio/prebuilt_core.py'
+ - 'studio/setup.sh'
+ - 'studio/backend/utils/**'
+ - 'pyproject.toml'
+ - 'studio/backend/requirements/**'
+ - 'studio/install_*.py'
+ - 'studio/node_prebuilt_pins.json'
+ - '.github/workflows/windows-no-compiler-ci.yml'
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/workflow-trigger-lint.yml b/.github/workflows/workflow-trigger-lint.yml
index 6f7583c9c6b..7b61a4f8eed 100644
--- a/.github/workflows/workflow-trigger-lint.yml
+++ b/.github/workflows/workflow-trigger-lint.yml
@@ -159,6 +159,7 @@ jobs:
tests/studio/test_macos_slots_per_commit.py \
tests/studio/test_main_runs_survive_merge_bursts.py \
tests/studio/test_pull_requests_cancel_superseded_runs.py \
+ tests/studio/test_push_filters_match_pull_request_filters.py \
tests/studio/test_probe_cost_claim_is_measured.py \
tests/studio/test_merge_ref_age_is_reported.py \
tests/studio/test_pester_bootstrap_hardening.py \
diff --git a/tests/studio/test_push_filters_match_pull_request_filters.py b/tests/studio/test_push_filters_match_pull_request_filters.py
new file mode 100644
index 00000000000..f3809c3b710
--- /dev/null
+++ b/tests/studio/test_push_filters_match_pull_request_filters.py
@@ -0,0 +1,148 @@
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+"""A scoped `pull_request` trigger must be scoped the same way on `push`.
+
+Sixteen workflows carefully scoped their `pull_request` trigger and then left
+`push: branches: [main]` completely unfiltered. The effect is invisible on a pull request
+and only appears after merge: a commit that changes nothing those workflows can observe
+still starts every one of them. Measured over a 1.5 hour window, this repo's 300 most
+recent runs contained 125 queued, and 70% of a job's wall clock was spent waiting for a
+runner rather than running (`unsloth-zoo`, sharing the same account, measured a 143 minute
+median queue against 5.7 minutes of work). Post-merge work that cannot change a verdict is
+therefore paid for twice: once as the slots it holds, and again as the queue every pull
+request behind it waits in.
+
+`tests/studio/test_macos_slots_per_commit.py` already pins this for the macOS workflows,
+where the five-concurrent-job account-wide cap made it urgent first. This module asks the
+same question of every workflow, on the same reasoning it gives: the two lists are one
+question asked twice -- "could this commit break this workflow" -- so drift is always a
+bug, and a push list narrower than the pull_request list is the dangerous direction,
+because it silently stops testing after merge something that was tested before it.
+
+The prerequisite, and why this file is not just a preference: scoping a push trigger is
+only safe if the `pull_request` list is COMPLETE. While push was unfiltered, every commit
+re-ran everything after merge, so a helper the workflow executes but never listed was a
+gap nobody could observe. Narrowing push is exactly what turns that gap into a real hole.
+`studio-export-capability-ci.yml` had one -- it is `uses:` on pip-cache-restore and
+pip-cache-save and listed neither -- and both were added in the same change that scoped its
+push trigger. `test_local_actions_are_in_path_filters.py` and
+`test_macos_slots_per_commit.py::test_every_helper_a_workflow_executes_is_in_its_trigger`
+are the guards for that half of the invariant.
+"""
+
+from pathlib import Path
+
+import pytest
+import yaml
+
+REPO = Path(__file__).resolve().parents[2]
+WORKFLOWS = REPO / ".github" / "workflows"
+
+# Workflows whose push trigger is deliberately broader than their pull_request trigger.
+# Each needs the reason written here; this set shrinking is good and it growing needs an
+# argument, not a convenience.
+DELIBERATELY_UNFILTERED_ON_PUSH = {
+ # Every job here is a function of the dependency manifests, so a PR touching none of
+ # them cannot change a verdict -- but a FLOATING pin can, with no diff at all: a
+ # version range resolving to a new release, or a freshly published advisory against an
+ # unchanged tree. The workflow's own comment records that the daily cron and every
+ # push to main are left unfiltered for exactly that reason, so scoping push here would
+ # narrow a deliberate safety net rather than remove waste.
+ "security-audit.yml",
+}
+
+
+def _on(doc):
+ """The `on:` mapping, which PyYAML parses as the boolean True."""
+ return doc.get(True) if True in doc else doc.get("on")
+
+
+def _targets_main(push) -> bool:
+ branches = push.get("branches") or []
+ return "main" in branches if isinstance(branches, list) else branches == "main"
+
+
+def _scoped_on_pull_request():
+ """(name, pr_paths, push) for workflows with a scoped PR trigger and a push to main."""
+ for path in sorted(WORKFLOWS.glob("*.yml")):
+ doc = yaml.safe_load(path.read_text(encoding = "utf-8"))
+ if not isinstance(doc, dict):
+ continue
+ on = _on(doc)
+ if not isinstance(on, dict):
+ continue
+ pull_request = on.get("pull_request")
+ push = on.get("push")
+ if not isinstance(pull_request, dict) or not isinstance(push, dict):
+ continue
+ pr_paths = pull_request.get("paths")
+ if not pr_paths or not _targets_main(push):
+ continue
+ yield path.name, pr_paths, push
+
+
+def test_the_scan_finds_the_workflows_it_claims_to():
+ """A scan that matched nothing would pass every check below on an empty set."""
+ names = {name for name, _, _ in _scoped_on_pull_request()}
+ assert len(names) >= 15, f"only found {len(names)} scoped-on-PR workflows; the scan is wrong"
+ for expected in (
+ "studio-backend-ci.yml",
+ "studio-windows-ui-smoke.yml",
+ "mlx-ci.yml",
+ ):
+ assert (
+ expected in names
+ ), f"{expected} scopes its pull_request trigger but the scan missed it"
+
+
+def test_every_exemption_still_exists_and_still_needs_one():
+ """A stale exemption is a filter nobody is asking for any more."""
+ names = {name for name, _, _ in _scoped_on_pull_request()}
+ for name in DELIBERATELY_UNFILTERED_ON_PUSH:
+ assert (WORKFLOWS / name).exists(), f"{name} is exempted here but no longer exists"
+ assert name in names, (
+ f"{name} is exempted here but no longer has a scoped pull_request trigger plus a "
+ f"push to main, so the exemption describes nothing. Remove it."
+ )
+ doc = yaml.safe_load((WORKFLOWS / name).read_text(encoding = "utf-8"))
+ push = _on(doc).get("push")
+ assert not push.get("paths") and not push.get("paths-ignore"), (
+ f"{name} now scopes its push trigger, so it does not need to be exempted. "
+ f"Remove it from DELIBERATELY_UNFILTERED_ON_PUSH."
+ )
+
+
+def test_no_scoped_workflow_runs_unfiltered_on_every_push_to_main():
+ offenders = [
+ name
+ for name, _, push in _scoped_on_pull_request()
+ if name not in DELIBERATELY_UNFILTERED_ON_PUSH
+ and not push.get("paths")
+ and not push.get("paths-ignore")
+ ]
+ assert not offenders, (
+ f"these workflows scope their pull_request trigger but run on EVERY commit to main: "
+ f"{offenders}. A merge that cannot change what they test still holds their runner "
+ f"slots, and the queue that produces is what every pull request behind them waits "
+ f"in. Mirror the pull_request paths onto push, as mlx-ci.yml does. If the broader "
+ f"push trigger is deliberate, add it to DELIBERATELY_UNFILTERED_ON_PUSH with the "
+ f"reason."
+ )
+
+
[email protected]("name", sorted(n for n, _, _ in _scoped_on_pull_request()))
+def test_the_push_filter_matches_the_pull_request_filter(name):
+ """Narrower on push than on PR drops the post-merge backstop; broader wastes slots."""
+ if name in DELIBERATELY_UNFILTERED_ON_PUSH:
+ pytest.skip(f"{name} is deliberately unfiltered on push")
+ doc = yaml.safe_load((WORKFLOWS / name).read_text(encoding = "utf-8"))
+ on = _on(doc)
+ pr_paths = (on.get("pull_request") or {}).get("paths")
+ push_paths = (on.get("push") or {}).get("paths")
+ assert push_paths, f"{name} no longer scopes its push trigger"
+ assert sorted(pr_paths) == sorted(push_paths), (
+ f"{name}: the push and pull_request path filters have drifted apart.\n"
+ f" only on pull_request: {sorted(set(pr_paths) - set(push_paths))}\n"
+ f" only on push: {sorted(set(push_paths) - set(pr_paths))}"
+ )