Skip to content

Fix main's red Backend CI after #13850 and #13806 - #13930

Merged
danielhanchen merged 1 commit into
mainfrom
ci-main-red-after-13850
Oct 15, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-main-red-after-13850

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Main (bd06376) is red in Backend CI on five tests, seen on every PR based on it (#13914, #13919). Four come from #13850 and #13806, which are both right; one comes from my own #13909. Each is reproduced locally on main and fixed here.

From #13850 (token preview)

test_every_long_lived_spawner_consults_the_shutdown_latch: core/training/token_preview.py adopts its worker with adopt_pid but was in neither the gated nor the not-gated set. It already checks is_process_shutting_down() before spawning, so it belongs with the gated spawners, but a gated spawner also has to recheck after adopting: a quit that lands between the check and adopt_pid happens after the shutdown sweep took its snapshot, and the worker would outlive it. _spawn_locked now rechecks right after adopting, and if the latch is set it stops the new worker and raises TokenPreviewError("Unsloth is shutting down."), the same message _start_locked uses. The module goes into the gated set.

New test test_a_quit_that_races_the_spawn_reaps_the_new_worker drives that race: the latch flips inside Process.start(), and the worker must be stopped and the call refused.

test_the_dataset_format_check_installs_the_decoder: check_format_response now reads its rows through load_preview_slice, which calls ensure_audio_decoding() before any tier, so the wiring is intact. The test only read check_format_response's own source. It now checks that check_format_response reads through load_preview_slice, and that load_preview_slice installs the decoder before its first read (resolve_dataset_path( / load_dataset(), which also pins the ordering the old form never checked.

test_the_subprocess_tokenizes_and_masks_typed_text: the completion-masking half imports unsloth in the worker, as training does, and Backend CI has torch but no unsloth_zoo (Unsloth: Please install unsloth_zoo via pip install unsloth_zoo then retry!). The test skipped only when torch was missing; it now also skips when unsloth_zoo is not importable. The plain tokenization half still runs everywhere.

From #13806 (drafter training)

test_owner_training_start_status_cancel_bytes_are_unchanged: the training status details gained "drafter": null. The test pins the exact status bytes on purpose, so a new field is a deliberate, one-line update to the expected dict.

From #13909 (mine)

test_python_children_are_told_to_emit_utf8: #13909 made the drafter capability probe decode its child as UTF-8 but set PYTHONIOENCODING on its own line, while this guard requires the child env to go through utf8_child_env() at the call site. The probe now passes env = utf8_child_env(env), which sets the same variable through the shared helper.

Verification

  • test_audio_dataset_decode.py, test_chat_text_encoding.py, test_job_accounts.py, test_orchestrator_unload_cancel.py, test_token_preview.py, test_text_io_encoding.py, test_drafter_training.py: 1144 passed. One failure, test_capability_child_process_runs_for_real, fails identically on main on this host (it runs the probe in a real child interpreter) and is not failing in CI.
  • Without unsloth_zoo importable: the token preview real-worker test tokenizes, then skips the masking half with its reason.
  • Sabotage, the post-adopt recheck removed: the spawner-set guard fails (never rechecks the latch after adopting) and the new race test fails (DID NOT RAISE TokenPreviewError).
  • Sabotage, ensure_audio_decoding() moved after resolve_dataset_path( in load_preview_slice: the decoder test fails (the decoder must be installed before the first row is read).
  • tests/test_formatter_fixed_point.py: passes.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-10-15T20:09:20.932323Z 545b1ac Manual request
🔒 Security Review ⚠️ Failed 2026-10-15T20:07:47.855489Z 545b1ac 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 545b1ac0ff

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant