Skip to content

Fix the three CI failures blocking every open PR - #7722

Merged
danielhanchen merged 4 commits into
mainfrom
ci-all-three
Aug 1, 2026
Merged

danielhanchen merged 4 commits into
mainfrom
ci-all-three

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Three unrelated CI failures are red on every open PR in the repo, so nothing can go green on its own merits. This combines the three fixes into one change: each was reviewed separately, and the files here are byte-identical to those reviewed heads. Supersedes #7713, #7712 and #7714.

None of the three is a flake, and none is caused by the PRs they were failing on.


1. Core (HF=latest + TRL=latest) — tests/utils/test_packing.py

_DummyTrainer built TRL's DataCollatorForLanguageModeling from a hardcoded kwarg set, then walked a ladder of try/except TypeError fallbacks for the optional flags. completion_only_loss was in the always-passed group, so when TRL removed that field the first constructor call raised TypeError and so did every rung of the ladder. The dummy trainer ended up with no data_collator at all, and the test failed with an AttributeError naming neither TRL nor the removed field.

Upstream removal: huggingface/trl commit f9aeb59 (huggingface/trl#6037), which moved completion-only label masking into dataset preparation. First released in TRL v1.7.0.

The collator is now built from the installed TRL's live signature, which subsumes the fallback ladder:

accepted = set(inspect.signature(DataCollatorForLanguageModeling).parameters)
collator = DataCollatorForLanguageModeling(**{k: v for k, v in wanted.items() if k in accepted})

Adds test_enable_sample_packing_only_requires_torch_call, pinning the contract the test was implicitly relying on: enable_sample_packing may require nothing of a collator beyond torch_call.

Test-only. Production was never affected: unsloth/utils/packing.py reads the collator via getattr(trainer, "data_collator", None) and guards every optional field with hasattr, and unsloth/models/rl.py references the transformers class, not TRL's.

Verified on TRL 0.22.2, 0.25.1, 0.29.1, 1.6.0, 1.7.1 and 1.9.2, so both the pre-1.7 and post-1.7 field sets are covered.

2. virgin win container / overlay=false — clean-machine-install-ci.yml

The released-wheel row carried continue-on-error plus a tripwire step asserting the install had failed, both there for a release lag that has since passed. The released wheel now installs end to end, so a step demanding failure fails.

Removing the tripwire alone would have left a hole: the only check for the VIRGIN WINDOWS CONTAINER INSTALL PASSED marker sat behind if: matrix.overlay, and every later step is if: always() and exits 0, so the released row would have been gated on docker exec's exit code alone — the case the file's own comment anticipates, since an exec that loses its container also exits 0. The marker check is hoisted into its own ungated step; the overlay-specific assertions stay gated.

3. Chat UI Tests — tests/studio/playwright_chat_ui.py

This one reads as a flake but is deterministic. Three separate workflows publish the check name Chat UI Tests, so one consistently broken platform looks like "one of three parallel runs failed at random". On #7686 the three are three different runners, and it is always the mac:

job runner result
91316909182 macos-14 fail
91316909276 ubuntu-latest pass
91316909316 windows-latest pass

Every mac failure emits the identical box, {'x': 1008, 'y': 712, 'width': 256, 'height': 172}.

In exercise_floating_monitor_geometry, the caller gates on the /api/system request rather than its response, because ctx.on("request", ...) fires when the request is issued. initial_box is then sampled with no further gate. Until the response is applied the panel paints use-system.ts's DEFAULT_SYSTEM, whose gpu is {available: false, devices: []}. On macOS detect_hardware() returns DeviceType.MLX and hardware.py:2705 reports one available device, so hasGpu flips and floating-monitor.tsx:469 renders a VRAM row, changing the panel's natural height permanently.

The later predicate then cannot be satisfied: the bottom-anchor half passes (712 + 172 = 884 = 900 - 16), only the height comparison against the stale baseline fails. The growth check is satisfied by the VRAM row alone, which is why growth completes in 0.4s and the shrink burns its whole deadline. Measured against the real component: RAM alone renders 113.5px, RAM plus one VRAM row renders exactly 172.0px at y=712.

The fix waits for the real signal before baselining, in one wait_for_function: a non-zero RAM total, the scroll region exactly fitting the content it was reconciled against, and that geometry holding for two consecutive animation frames. The frame-stability condition is load-bearing, because an intermediate state exists where both rows are present but the space-y-3 gap is not yet applied, and that state is self-consistent. Two frames is how Playwright defines a stable element, and wait_for_function defaults to polling="raf". No sleeps added, no timeout raised.

Before and after, running the real function against the live component with the response held back by a randomised delay:

scenario before after
GPU-reporting host, delay 0-500ms 24/25 failed 0/25 failed
GPU-reporting host, delay 0-60ms 40/40 failed 0/40 failed
no-GPU host (ubuntu/windows control) 0/20 failed 0/20 failed

Every "before" failure reproduced the byte-identical CI string. The no-GPU control explains why ubuntu and windows pass and confirms the fix does not regress them.

Confirmed on the real runner: all three Chat UI Tests jobs pass on #7714, including macos-14.


Scope

Two test files and one workflow. No production code path is touched.

Not established locally: the chat UI suite was not run end to end (the harness renders the real FloatingMonitor through the project's own vite server and executes the real test function, but it is not the whole suite), and it was not run on macOS, so the MLX step rests on the backend source plus the platform correlation of the failing jobs. CI here covers both.

TRL 1.7.0 removed completion_only_loss from
trl.trainer.sft_trainer.DataCollatorForLanguageModeling when label
construction moved from collation into dataset preparation
(huggingface/trl#6037). tests/utils/test_packing.py passed that kwarg on
every construction attempt, so on TRL 1.x every attempt raised TypeError,
_DummyTrainer.data_collator was never assigned, and
test_enable_sample_packing failed with AttributeError on the
HF=latest + TRL=latest matrix leg.

Filter the collator kwargs against the installed dataclass signature so
the dummy tracks whatever fields TRL currently exposes, and add a
regression test pinning the production contract that enable_sample_packing
only requires torch_call on the collator.

(cherry picked from commit 5d8513b)
…el carries #7549

The "virgin win container / overlay=false" row installs unsloth from PyPI on
purpose, so its studio/setup.ps1 comes out of the released wheel. A Server Core
container has no Microsoft Store and so no winget, and the released setup.ps1
hard-stopped on a winget-only git gate and reached for winget again for the VC++
runtime, so that row could not install end to end. #7549 relaxed both gates but
merged on 2026-07-29, after the then newest wheel 2026.7.5 (2026-07-23), so the
row was held under continue-on-error and a step that asserted it failed only on
that known signature.

unsloth 2026.7.6 shipped later the same day and is the first wheel to carry the
relaxed gates: unpacking it shows the old "Git is required but could not be
installed automatically" wording gone and both "so git is not needed" and
"downloading the runtime directly" present. The row now installs end to end and
the pin's own tripwire fired to say so.

Drop continue-on-error from the Install step and delete the release-lag
assertion, so the released-wheel row gates like the overlay row. The Install
step is already passing on this row in recent runs, so nothing else is being
tolerated by the escape hatch being removed.

(cherry picked from commit cf0b25e)
Removing the released row's tripwire made a green released row reachable
for the first time, and the only log-based verdict check sat behind
`if: matrix.overlay`. Every later step is `if: always()` and exits 0, so
that row was gated on `docker exec`'s exit code alone -- which the file
already notes can be 0 for an exec that lost its container. Hoisted the
marker check out of the overlay step so both rows read the harness's own
verdict; the overlay-specific assertions stay gated.

(cherry picked from commit 7613460)
…geometry

The geometry check baselines the panel with a single bounding_box() taken as
soon as the caller observes an /api/system request go out. The response has not
been applied yet at that point, so the panel is still painting use-system.ts's
zero-filled DEFAULT_SYSTEM, which reports no GPU. On a host that does report one
the VRAM row then lands and adds a row permanently, so the panel never returns
to the sampled baseline and "content shrink" waits out its whole 5s deadline
before failing.

That is why this looked flaky but is not: macos-14 reports a single MLX device
and failed on every PR, while ubuntu-latest and windows-latest have no GPU row
to add and passed. Three jobs share the name "Chat UI Tests", so the one
consistent platform failure read as one of three parallel runs failing at
random.

Wait for the payload to be rendered and for the panel to have finished resizing
to it before sampling the baseline. The gate requires a non-zero RAM total, the
scroll region to exactly fit the content it was reconciled against, and that
geometry to hold for two consecutive animation frames, which is how Playwright
defines a stable element and is what wait_for_function's default polling="raf"
provides.

(cherry picked from commit 7d5cc8c)
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 245f7888f5

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