Repository navigation
Fix main's red CI after #13806, #13899 and recent formatter drift - #13909
Merged
Merged
Conversation
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
danielhanchen
added a commit
that referenced
this pull request
Oct 15, 2026
…13922) `(Python 3.13, rest)` is red on main since #13806 (1be7795), including on #13909's own run: ``` FAILED studio/backend/tests/test_tensor_parallel.py::test_mtp_decode_probe_wired_under_tensor_parallel AssertionError: the probe must precede the drafter-drop fallback ``` #13806 is right. It made an EAGLE-3 drafter droppable on a failed load like the others, so the fallback in `LlamaCppBackend.load_model` became ```python if ( not healthy and ( _spec_requested_mtp or _spec_requested_dspark or _spec_requested_dflash or _spec_requested_eagle3 ) and not _load_cancelled() ): ``` The test located that block with `src.find("and (_spec_requested_mtp or _spec_requested_dspark or _spec_requested_dflash)")`, the old one-line spelling. After the change `find` returns -1, so `0 <= probe < fallback` fails even though the probe still comes first. The ordering it guards is intact. The test now finds the fallback by its shape: `not healthy and (` followed by the `_spec_requested_mtp or _spec_requested_dspark ... _spec_requested_dflash` alternatives, whitespace and line breaks allowed, so adding another drafter kind or rewrapping does not break it. If no such block exists it fails with its own message (`load_model no longer has a drafter-drop fallback for MTP`) rather than reporting a misleading order failure. Verification: - `studio/backend/tests/test_tensor_parallel.py`: fails on main as above, 111 passed with this change. - Sabotage, `_spec_requested_dflash` removed from the fallback in `llama_cpp.py`: fails with `load_model no longer has a drafter-drop fallback for MTP`. - Sabotage, the fallback block moved ahead of the probe in the source the test reads: fails with `the probe must precede the drafter-drop fallback`. - `tests/test_formatter_fixed_point.py`: passes.
danielhanchen
added a commit
that referenced
this pull request
Oct 15, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With #13846 merged, main (d303bac) is still red in Backend CI and Repo tests, from three regressions that landed in the last few hours. Each is reproduced locally on main and fixed here.
1.
test_text_io_names_its_encoding[drafter.py](from #13806)core/training/drafter.pyruns the drafter capability probe in a child interpreter withtext = Trueand no encoding, so the parent decodes the child's output with the locale codec (cp1252 on Windows, ASCII under a C locale). The guard is right and the code is what changes: the call now passesencoding = "utf-8", errors = "replace", and the child getsPYTHONIOENCODING=utf-8so it writes what the parent reads. That matches howcore/training/worker.pyruns its own probes. The payload line isjson.dumpsoutput, so nothing parsed changes.2.
test_backfill_splits_a_quant_suffix_the_way_the_backend_does(from #13899)#13899 widened the GGUF known-quant pattern from
MXFP...to(?:MX|NV)FP...so NVFP4 files get their own variant key. That change is right, and it was made consistently in all three places that must agree:core/inference/llama_cpp.py(_GGUF_KNOWN_QUANT_RE),hub/utils/gguf.py(_GGUF_QUANT_RE) and the frontend'smodel-identity.ts(QUANT_TOKEN_SOURCE). The test was checking that the literal substringMXFPappears inllama_cpp.py, which it no longer does.The test now checks the property it was standing in for: it reads the pattern string out of both Python modules with
ast(adjacent literals joined as Python joins them) and the TypeScript constant, asserts all three are identical, and asserts the shared pattern still fully matchesMXFP4,NVFP4,IQ4_XS,TQ1_0,Q4_K_M,Q8_0,BF16,F16andF32. That is stricter than before, since a pattern edited on one side only now fails, and it no longer breaks on a correct rewording.3.
test_every_tracked_python_file_is_already_formattedFormatter drift (pinned ruff 0.6.9 via
scripts/run_ruff_format.py), output only, no logic change:studio/backend/core/inference/llama_cpp.py,offload_layout.py,tests/test_nemotron35_bolt_super.py,tests/test_nemotron35_planner.pystudio/backend/tests/test_muse_spark.pytests/test_norm_fast_launch.py,unsloth/kernels/layernorm.pytests/test_remote_code_class_and_expert_submodules.py,unsloth/models/_utils.pytests/test_triton_fp_fusion.pyVerification
tests/test_formatter_fixed_point.py(ruff 0.6.9): fails on main, 16 passed here.tests/studio/test_model_picker_contracts.pyandtests/test_runtime_text_encoding.py: 210 passed.studio/backend/tests/test_text_io_encoding.py,test_nemotron35_bolt_super.py,test_drafter_training.py: all pass excepttest_capability_child_process_runs_for_real, which fails identically on main without this change on this host (it runs the probe in a real child interpreter) and is not failing in CI.NVfrom the pattern inhub/utils/gguf.pyonly, or inmodel-identity.tsonly, fails it; restored, it passes.