Skip to content

Name the encoding when the offload test reads llama.py - #10039

Merged
danielhanchen merged 2 commits into
mainfrom
fix/encoding-offload-frozen-module-test
Aug 31, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
fix/encoding-offload-frozen-module-test

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What is red

main is failing Repo tests (CPU):

FAILED tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding
  tests/test_offload_frozen_module_device.py:40: read_text()
  tests/test_offload_frozen_module_device.py:254: read_text()

Why it is on main

#10034 added that file with two bare read_text() calls, and its own CI caught them -- that was its single failing check. It merged at 02:54:14 on head 14c6f0b5c; the fix I had pushed to that branch landed a few minutes later, so it is not in the squash. This is the same change, reapplied against main.

The verdict

The gate is right and the reads were wrong. Both read unsloth/models/llama.py, a checked-in source file, with the platform default encoding -- cp1252 on Windows.

Latent rather than live: llama.py is 177,788 bytes and currently all ASCII, so nothing breaks today. Failing at the point the read is added is precisely what this gate is for. Without it, the breakage surfaces months from now, on Windows only, the first time someone puts a non-ASCII character in llama.py.

Verification

tests/test_source_read_encoding.py and the file's own 20 tests: 21 passed.

The gate's own effectiveness needs no separate mutation check here -- it demonstrably caught this on #10034's CI before the merge.

main is red on Repo tests (CPU):

  FAILED tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding
  offenders: tests/test_offload_frozen_module_device.py:40, :254

#10034 added that file with two bare read_text() calls, and its own CI caught
them. It merged at 02:54:14 on head 14c6f0b; the fix I pushed to that branch
landed a few minutes later and so is not in the squash. Same change, against main.

The gate is right and the reads were wrong. Both read unsloth/models/llama.py, a
checked-in source file, with the platform default encoding, which is cp1252 on
Windows. Latent rather than live: llama.py is 177,788 bytes and currently all
ASCII, so nothing breaks today. Failing at the point the read is added is exactly
what the gate is for -- otherwise this surfaces months from now, on Windows only,
when someone puts a non-ASCII character in llama.py.

test_source_read_encoding and the file's own 20 tests pass: 21 passed.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 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-08-31T03:03:57.726902Z 244f2b9 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 da3c85c into main Aug 31, 2026
16 checks passed
@danielhanchen
danielhanchen deleted the fix/encoding-offload-frozen-module-test branch August 31, 2026 04:04
lonexreb added a commit to lonexreb/unsloth that referenced this pull request Sep 16, 2026
…f-closing issue

Main has no PR gate for the team, so Backend CI going red on a direct
push is routine -- and the cost is never the fix, it is the noticing. A
red main sits until someone happens to look, every branch cut meanwhile
inherits the failure families into its own PR runs, and the eventual
fixer starts by re-deriving which push since the last green broke it.
Aug 29-31 ran that cycle three times, once with the same two-line fix
built twice in parallel (unslothai#10039/unslothai#10041) because nothing said the break
was known.

When a Backend CI run on main completes red, look up the last green main
run, list the commits between the two heads -- the complete suspect set,
usually one or two pushes -- and open ONE labeled issue carrying the
range, the failing jobs, and the run link. Repeat reds update the same
issue; the first green closes it, so the issue's lifetime IS main's red
window.

Ships inert per ci-capacity.yml's convention: writes are gated on the
MAIN_RED_GUARD_ENABLED repository variable, and until it is set the
workflow prints the issue it would have filed to the job summary on
every real red, so its output can be judged before it is allowed to
speak.
lonexreb added a commit to lonexreb/unsloth that referenced this pull request Sep 16, 2026
…f-closing issue

Main has no PR gate for the team, so Backend CI going red on a direct
push is routine -- and the cost is never the fix, it is the noticing. A
red main sits until someone happens to look, every branch cut meanwhile
inherits the failure families into its own PR runs, and the eventual
fixer starts by re-deriving which push since the last green broke it.
Aug 29-31 ran that cycle three times, once with the same two-line fix
built twice in parallel (unslothai#10039/unslothai#10041) because nothing said the break
was known.

When a Backend CI run on main completes red, look up the last green main
run, list the commits between the two heads -- the complete suspect set,
usually one or two pushes -- and open ONE labeled issue carrying the
range, the failing jobs, and the run link. Repeat reds update the same
issue; the first green closes it, so the issue's lifetime IS main's red
window.

Ships inert per ci-capacity.yml's convention: writes are gated on the
MAIN_RED_GUARD_ENABLED repository variable, and until it is set the
workflow prints the issue it would have filed to the job summary on
every real red, so its output can be judged before it is allowed to
speak.
lonexreb added a commit to lonexreb/unsloth that referenced this pull request Sep 16, 2026
…f-closing issue

Main has no PR gate for the team, so Backend CI going red on a direct
push is routine -- and the cost is never the fix, it is the noticing. A
red main sits until someone happens to look, every branch cut meanwhile
inherits the failure families into its own PR runs, and the eventual
fixer starts by re-deriving which push since the last green broke it.
Aug 29-31 ran that cycle three times, once with the same two-line fix
built twice in parallel (unslothai#10039/unslothai#10041) because nothing said the break
was known.

When a Backend CI run on main completes red, look up the last green main
run, list the commits between the two heads -- the complete suspect set,
usually one or two pushes -- and open ONE labeled issue carrying the
range, the failing jobs, and the run link. Repeat reds update the same
issue; the first green closes it, so the issue's lifetime IS main's red
window.

Ships inert per ci-capacity.yml's convention: writes are gated on the
MAIN_RED_GUARD_ENABLED repository variable, and until it is set the
workflow prints the issue it would have filed to the job summary on
every real red, so its output can be judged before it is allowed to
speak.
lonexreb added a commit to lonexreb/unsloth that referenced this pull request Sep 16, 2026
…f-closing issue

Main has no PR gate for the team, so Backend CI going red on a direct
push is routine -- and the cost is never the fix, it is the noticing. A
red main sits until someone happens to look, every branch cut meanwhile
inherits the failure families into its own PR runs, and the eventual
fixer starts by re-deriving which push since the last green broke it.
Aug 29-31 ran that cycle three times, once with the same two-line fix
built twice in parallel (unslothai#10039/unslothai#10041) because nothing said the break
was known.

When a Backend CI run on main completes red, look up the last green main
run, list the commits between the two heads -- the complete suspect set,
usually one or two pushes -- and open ONE labeled issue carrying the
range, the failing jobs, and the run link. Repeat reds update the same
issue; the first green closes it, so the issue's lifetime IS main's red
window.

Ships inert per ci-capacity.yml's convention: writes are gated on the
MAIN_RED_GUARD_ENABLED repository variable, and until it is set the
workflow prints the issue it would have filed to the job summary on
every real red, so its output can be judged before it is allowed to
speak.
lonexreb added a commit to lonexreb/unsloth that referenced this pull request Sep 27, 2026
…f-closing issue

Main has no PR gate for the team, so Backend CI going red on a direct
push is routine -- and the cost is never the fix, it is the noticing. A
red main sits until someone happens to look, every branch cut meanwhile
inherits the failure families into its own PR runs, and the eventual
fixer starts by re-deriving which push since the last green broke it.
Aug 29-31 ran that cycle three times, once with the same two-line fix
built twice in parallel (unslothai#10039/unslothai#10041) because nothing said the break
was known.

When a Backend CI run on main completes red, look up the last green main
run, list the commits between the two heads -- the complete suspect set,
usually one or two pushes -- and open ONE labeled issue carrying the
range, the failing jobs, and the run link. Repeat reds update the same
issue; the first green closes it, so the issue's lifetime IS main's red
window.

Ships inert per ci-capacity.yml's convention: writes are gated on the
MAIN_RED_GUARD_ENABLED repository variable, and until it is set the
workflow prints the issue it would have filed to the job summary on
every real red, so its output can be judged before it is allowed to
speak.
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