Skip to content

Fix main's red Backend CI, repo and picker contract tests after #13724, #13749 and #13828 - #13846

Merged
danielhanchen merged 5 commits into
mainfrom
fix-diffusion-peaks-main
Oct 15, 2026
Merged

danielhanchen merged 5 commits into
mainfrom
fix-diffusion-peaks-main

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

#13724 landed with three CI jobs red, #13749 left a picker contract test behind, and #13828 added a test file the formatter and encoding checks reject, so main fails (Python 3.13, a-k), (Python 3.13, rest), Repo tests (CPU, rest) and Repo tests (CPU, studio) on every PR. This brings those tests back to green. No runtime behaviour changes beyond naming the peak store's encoding.

What was failing on main (59ab069b5)

  • test_text_io_names_its_encoding[diffusion_measured_peaks.py] and test_shipping_code_names_an_encoding: the learned-peak store reads with read_text() and writes through os.fdopen(fd, "w") without an encoding, so the locale decides it (cp1252 on Windows, ASCII under a C locale).
  • test_calibration_records_and_reuses_for_any_family, test_retagged_peak_is_recorded_under_the_mode_that_ran: record_request_peak now records a keyed peak only when stream_window_pad_mib(pipe) can size the placement ("an unknown placement enters neither the keyed table nor the store"). The tests' fake pipe has no placement, so nothing was recorded and measured_extra_mib returned None.
  • test_oom_inside_the_first_offload_apply_unwinds_its_hooks imports diffusers.hooks directly, and the Backend CI runners have no diffusers, so it errors with ModuleNotFoundError there instead of skipping.
  • test_diffusion_capability_labeled_image_video_gen (tests/studio/test_model_picker_contracts.py) still expects "Image/video gen" in all three Hub files. Studio Hub: one filter popover for capabilities, size, context and uploader, composer-style menus #13749 split the Hub filter into "Image gen" and "Video gen" and only rewrote the comments that held the old label in the other two.
  • test_every_tracked_python_file_is_already_formatted and test_checked_in_file_reads_name_an_encoding: tests/test_triton_fp_fusion.py (Kernels: request enable_fp_fusion=True explicitly, ahead of Triton 3.9's False default #13828) is not a fixed point of scripts/run_ruff_format.py and reads four kernel sources with read_text() and no encoding.
  • test_calibration_revision_includes_the_companion_base: _calibration_revision now uses _peak_model_identity, which keys on source@revision plus +base@base_revision for a GGUF or single-file load, not the old bare fingerprint and |base= suffix.

Fix

  • diffusion_measured_peaks.py: encoding = "utf-8" on the read and on the write. json.dump writes ASCII by default, so existing peak files read the same.
  • The two peak tests run under a known on-card placement (stream_window_pad_mib patched to 0), the case Studio diffusion: learned activation peaks, OOM retry in group offload setup, pinned GGUF host copies, tied-weight groups #13724 still records.
  • The OOM test uses pytest.importorskip("diffusers.hooks"), the same guard the rest of the file uses for optional dependencies. It still runs where diffusers is installed.
  • The label test still checks that no Hub file says "Image to text". It now asserts the filter label { value: "diffusion", label: "Image/video gen" } in model-type-filter.ts and the split Image gen / Video gen options in view-models.ts.
  • tests/test_triton_fp_fusion.py: encoding = "utf-8" on its four reads, then python scripts/run_ruff_format.py on it.
  • The revision test asserts the new identity format. It still checks the same three things: no base for a pipeline load, the base for a GGUF load, and a different base giving a different key.

Tests

With no GPU visible (as on the CI runners), test_diffusion_component_sizes.py, test_text_io_encoding.py and test_diffusion_learned_peaks.py: 4 failed on main, 984 passed and 0 failed here (with current main merged in). tests/test_runtime_text_encoding.py: 9 passed. tests/studio/test_model_picker_contracts.py: 201 passed. tests/test_triton_fp_fusion.py, tests/test_formatter_fixed_point.py, tests/test_source_read_encoding.py, tests/test_runtime_text_encoding.py: 43 passed, 2 skipped. The OOM test skips cleanly when diffusers is not importable, and passes where it is.

@danielhanchen danielhanchen self-assigned this Oct 15, 2026
@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-15T15:56:26.738194Z 816c7fa Manual request
🔒 Security Review ⚠️ Failed 2026-10-15T12:25:35.272361Z b24230e 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

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: b24230e59f

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

@danielhanchen danielhanchen changed the title Fix the diffusion peak encoding and calibration test reds on main Fix main's red Backend CI and picker contract tests after #13724 and #13749 Oct 15, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 2e1593494d

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

@danielhanchen danielhanchen changed the title Fix main's red Backend CI and picker contract tests after #13724 and #13749 Fix main's red Backend CI, repo and picker contract tests after #13724, #13749 and #13828 Oct 15, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 816c7fac27

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

@danielhanchen
danielhanchen merged commit d303bac into main Oct 15, 2026
@danielhanchen
danielhanchen deleted the fix-diffusion-peaks-main branch October 15, 2026 18:12
danielhanchen added a commit that referenced this pull request Oct 15, 2026
…3909)

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)

```
drafter.py:222: subprocess(text = True) without encoding
```

`core/training/drafter.py` runs the drafter capability probe in a child
interpreter with `text = True` and 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 passes `encoding = "utf-8", errors = "replace"`, and the child gets
`PYTHONIOENCODING=utf-8` so it writes what the parent reads. That
matches how `core/training/worker.py` runs its own probes. The payload
line is `json.dumps` output, so nothing parsed changes.

## 2. `test_backfill_splits_a_quant_suffix_the_way_the_backend_does`
(from #13899)

```
AssertionError: MXFP
```

#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's
`model-identity.ts` (`QUANT_TOKEN_SOURCE`). The test was checking that
the literal substring `MXFP` appears in `llama_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 matches
`MXFP4`, `NVFP4`, `IQ4_XS`, `TQ1_0`, `Q4_K_M`, `Q8_0`, `BF16`, `F16` and
`F32`. 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_formatted`

Formatter drift (pinned ruff 0.6.9 via `scripts/run_ruff_format.py`),
output only, no logic change:

| file | from |
| --- | --- |
| `studio/backend/core/inference/llama_cpp.py`, `offload_layout.py`,
`tests/test_nemotron35_bolt_super.py`,
`tests/test_nemotron35_planner.py` | #13899 |
| `studio/backend/tests/test_muse_spark.py` | #13903 |
| `tests/test_norm_fast_launch.py`, `unsloth/kernels/layernorm.py` |
#13889 |
| `tests/test_remote_code_class_and_expert_submodules.py`,
`unsloth/models/_utils.py` | #13851 |
| `tests/test_triton_fp_fusion.py` | #13846 |

## Verification

- `tests/test_formatter_fixed_point.py` (ruff 0.6.9): fails on main, 16
passed here.
- `tests/studio/test_model_picker_contracts.py` and
`tests/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
except `test_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.
- Sabotage on the rewritten picker guard: dropping `NV` from the pattern
in `hub/utils/gguf.py` only, or in `model-identity.ts` only, fails it;
restored, it passes.
- Sabotage for (1) is main itself: without the encoding, the guard fails
as quoted above.
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