Skip to content

Repair the three checks that are red on main itself - #11207

Merged
danielhanchen merged 1 commit into
mainfrom
fix/ruff-format-drift-on-main
Sep 17, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/ruff-format-drift-on-main

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Three checks are red on main itself right now, and every open PR inherits all three. Same shape as #11139. None of this is any PR's doing; all of it landed on main today.

1. pre-commit.ci: three files landed unformatted

pre-commit run --all-files rewrites three files that arrived today, each with a blank line the ruff-format-with-kwargs hook adds or removes:

This is the hook's own output, run with the ruff 0.6.9 that .pre-commit-config.yaml pins under the hook's additional_dependencies. Blank lines only.

It matters more than the diff suggests, because pre-commit.ci evaluates a PR merged with main and then pushes any fix to the PR's own branch. While main is unformatted, every open PR is offered an autofix commit touching files it never went near:

Neither is fixable inside the affected PR. Pulling main in only imports the drift; committing the fix there puts the unrelated files back in the diff.

2. Repo tests (CPU, python): two skip guards read a spoofed probe

tests/python/test_accelerator_skip_guards.py::test_no_skip_guard_reads_a_spoofable_accelerator_probe fails on clean main, no PR content at all:

test_apply_qkv_fallback.py:235: torch.cuda.is_available()
test_lora_dropout_patch_summary.py:104: torch.cuda.is_available()

Both files came in with #11038. tests/_zoo_aggressive_cuda_spoof.py patches that probe to True process-wide, so both tests un-skip on a CPU-only runner and try to load a real checkpoint through FastLanguageModel.

Gated on the probes the failing test names, and on the distinction its sibling test_no_cuda_only_test_is_gated_on_the_broad_accelerator_probe enforces: has_real_cuda() for test_apply_qkv_fallback_end_to_end, which asks for a cuda device, and has_real_accelerator() for the other, which does not. All 24 guard tests pass afterwards, and the two files still collect: 76 passed, 2 deselected.

3. Repo tests (CPU, python): a launcher test takes the real, shared runtime lock

Also observed red, on #11126, job 104949989945:

unsloth_cli/_studio_runtime_gate.py:224: in studio_runtime_launch_guard
    fcntl.flock(lock_file.fileno(), flags)
E   BlockingIOError: [Errno 11] Resource temporarily unavailable
E   StudioRuntimeGateBusy: /home/runner/.unsloth/studio/.studio-runtime.lock
...
E   typer._click.exceptions.Exit: 1
[gw3]

unsloth_cli/commands/studio.py resolves STUDIO_HOME once, at import, and _studio_runtime_launch_guard takes a non-blocking flock on the one .studio-runtime.lock beneath it. Left at the real ~/.unsloth/studio, that file is shared by every xdist worker, so two tests in this shard that reach update() together collide and the loser exits 1 on a machine where nothing is wrong. Confirmed directly:

STUDIO_HOME (module-level, resolved at import): ~/.unsloth/studio
lock file: ~/.unsloth/studio/.studio-runtime.lock
while parent holds it -> CHILD REFUSED

_configure_windows already redirected STUDIO_HOME at tmp_path; the tests that build their own environment, including the one that failed, did not. Moved into the studio fixture so it cannot be missed again.

Measured either side of the change, with the real lock file deleted first:

~/.unsloth/studio/.studio-runtime.lock after the file runs
before created
after never appears

Checks

  • ruff 0.6.9 + the hook's exclude list, scripts/run_ruff_format.py over all 2681 tracked Python files: no further changes.
  • tests/python/test_accelerator_skip_guards.py: 24 passed.
  • tests/test_apply_qkv_fallback.py tests/test_lora_dropout_patch_summary.py: 76 passed, 2 deselected.
  • the four files that touch the runtime gate, under -n 8: 99 passed, 32 skipped.
  • tests/python tests/kaggle (the shard), -n 8: the guard failure is gone.

…tted

#11025, #10533 and #11067 each landed today with a blank line the
ruff-format-with-kwargs hook removes or adds, so `pre-commit run --all-files`
is red on main. Every open PR inherits that: pre-commit.ci evaluates the PR
merged with main, finds files to rewrite that the PR never touched, and pushes
them onto the PR branch, which is how unrelated files end up in a diff. On a
branch too far behind main to apply, it fails outright instead.

Output of the repo's own hook, with the pinned ruff 0.6.9. Blank lines only.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-17T13:33:15.368147Z 7599e8d PR opened
🔒 Security Review ✅ Completed 2026-09-17T13:35:58.199290Z 7599e8d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen
danielhanchen merged commit 32cca45 into main Sep 17, 2026
5 of 44 checks passed
@danielhanchen
danielhanchen deleted the fix/ruff-format-drift-on-main branch September 17, 2026 13:40
@danielhanchen danielhanchen changed the title Re-run the kwarg-spacing formatter on three files that landed unformatted Repair the three checks that are red on main itself Sep 17, 2026
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…tted (unslothai#11207)

unslothai#11025, unslothai#10533 and unslothai#11067 each landed today with a blank line the
ruff-format-with-kwargs hook removes or adds, so `pre-commit run --all-files`
is red on main. Every open PR inherits that: pre-commit.ci evaluates the PR
merged with main, finds files to rewrite that the PR never touched, and pushes
them onto the PR branch, which is how unrelated files end up in a diff. On a
branch too far behind main to apply, it fails outright instead.

Output of the repo's own hook, with the pinned ruff 0.6.9. Blank lines only.

Co-authored-by: danielhanchen <[email protected]>
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.

2 participants