Skip to content

Make the tests and data tools work on Windows, and run CI there - #71

Merged
AvnehSBhatia merged 4 commits into
exea-labs:mainfrom
Aadi-Tiwari:aadi/windows-support
Nov 22, 2026
Merged

AvnehSBhatia merged 4 commits into
exea-labs:mainfrom
Aadi-Tiwari:aadi/windows-support

Conversation

@Aadi-Tiwari

Copy link
Copy Markdown
Contributor

I'm on Windows, and the test suite didn't run for me. Plain pytest crashed while collecting tests, and with PYTHONUTF8=1 five tests still failed. This PR fixes both and adds a Windows job to CI so it stays fixed.

What was broken

  • About 90 text reads and writes had no encoding, so Windows fell back to cp1252. tests/test_benchmarks.py was the one that broke collection.
  • test_decontam rewrote tokens.bin while a memory map of it was still open. Windows doesn't allow that (Errno 22).
  • test_harness and both test_auto_eval tests put the datasets cache inside the pytest temp folder. The cache's lock file name repeats that path and went past the 260-character limit (WinError 206).
  • The data walkthrough expects the shell to expand data/raw/*.jsonl.gz. PowerShell and cmd don't.

What changed

  • Text files are read and written as UTF-8 with \n line endings. Binary reads and writes are unchanged.
  • test_decontam copies the tokens and closes the map before writing. The harness and auto-eval tests get a short cache folder from a new fixture in tests/conftest.py. No test was skipped or loosened.
  • quality, dedup, tokenizer and pack expand file patterns themselves (exealm/data/files.py, with 2 tests). exealm.chat prints UTF-8.
  • A new pytest-windows job in .github/workflows/tests.yml runs the same steps as the Ubuntu job. The README and CONTRIBUTING have a short Windows note.

How I tested it

Windows 11, Python 3.13, CPU torch.

  • python -m pytest -q with no environment variables: 236 passed, 1 skipped. Before, it crashed at collection.
  • PYTHONUTF8=1 python -m pytest -q: 236 passed, 1 skipped. Before, 229 passed, 5 failed, 1 skipped.
  • The README quickstart training command runs on CPU in about 25 seconds, and the data tools take a quoted *.jsonl.gz pattern.
  • The branch merges cleanly with every open PR (Train swarm SFT through the shared board #63 to Add Jasraj Tulsi to CONTRIBUTORS.md #70).
  • I couldn't run the new Windows CI job myself, so its first run here is the real check. It installs the same extras as Ubuntu (faiss, eval, board). If one of them has no Windows wheel, I'll fix the job.

Left out on purpose

open(), read_text() and write_text() fell back to the locale encoding, which is cp1252 on Windows, so reading a UTF-8 file or collecting tests/test_benchmarks.py failed there. Text I/O now names its encoding and writes \n line endings, so the files a run produces are the same on every OS. Binary I/O is unchanged. Not touched yet: exealm/train/pretrain.py, grpo.py and sft.py, which open pull requests are editing.
test_decontam rewrote tokens.bin while a memory map of it was still open, which Windows refuses with Errno 22. It now copies the tokens and releases the map first. The harness and auto-eval fixtures put the datasets cache inside the pytest temp directory; the lock file name repeats that whole path and went past the 260 character limit (WinError 206). They now use a short cache directory from a shared fixture.
The data walkthrough passes data/raw/*.jsonl.gz to quality, dedup, tokenizer and pack, and relies on the shell to expand it. PowerShell and cmd do not, so those four tools now expand patterns themselves. exealm.chat switches stdin and stdout to UTF-8, because model output can contain characters the Windows console code page cannot encode.
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.

2 participants