Skip to content

Multi-LoRA cold compile test: read the source as utf-8 - #16531

Merged
danielhanchen merged 1 commit into
mainfrom
dh/multi-lora-test-utf8
Nov 3, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
dh/multi-lora-test-utf8

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Repo tests (CPU, rest-2) is red on main since #16415 (bf38ae0ac6). On staging CI it hit #16423, #16182 and #16523 in the last hour:

tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding
AssertionError: 1 file reads in the test trees touch a checked-in file with the platform default encoding,
so they break on Windows as soon as that file gains a non-ASCII byte. Pass encoding = "utf-8":
['tests/test_multi_lora_cold_compile_cpu.py:33: read_text()']

#16415's new test parses a checked-in source file with path.read_text(). On Windows that decodes with the ANSI codepage, so it breaks as soon as the source file gains a non-ASCII byte. The guard is right.

Change

tests/test_multi_lora_cold_compile_cpu.py: read_text() becomes read_text(encoding = "utf-8"). Nothing else changes.

Testing

  • tests/test_source_read_encoding.py and tests/test_multi_lora_cold_compile_cpu.py:
    • main: the encoding guard fails as above;
    • this branch: 20 passed.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 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-11-03T07:20:37.646705Z b462001 Manual request
ℹ️ 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. Another round soon, please!

Reviewed commit: b462001e54

ℹ️ 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 7f0620d into main Nov 3, 2026
@danielhanchen
danielhanchen deleted the dh/multi-lora-test-utf8 branch November 3, 2026 07:24
danielhanchen added a commit that referenced this pull request Nov 3, 2026
## Summary

Since #16414 (`9a8b229714`), `Repo tests (CPU, rest-2)` has been failing
on unrelated PRs. It reproduces on current main, and it hit #16540 and
#16509 in runs created after #16531 merged:

```
tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding[2]
E   AssertionError: 1 file reads in the test trees touch a checked-in file with the platform default encoding, so they break on Windows as soon as that file gains a non-ASCII byte. Pass encoding = "utf-8": ['tests/test_multi_lora_scale_overflow_cpu.py:20: read_text()']
```

The new test from #16414 parses `unsloth/kernels/multi_lora.py` with a
bare `read_text()`. That is the same pattern #16531 fixed in
`test_multi_lora_cold_compile_cpu.py`. The guard is right: on Windows, a
bare read uses the locale code page, so this test would break as soon as
the kernel file gains a non-ASCII character. The kernel change in #16414
is fine.

## Change

`tests/test_multi_lora_scale_overflow_cpu.py` line 20: `read_text()`
becomes `read_text(encoding = "utf-8")`.

## Testing

- `tests/test_source_read_encoding.py`:
  - main: 1 failed, 15 passed (the case above);
  - this branch: passes.
- This branch, `tests/test_source_read_encoding.py` plus
`tests/test_multi_lora_scale_overflow_cpu.py`: 28 passed.
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