Repository navigation
tools: pin LF on the two text writes that keep test_text_write_line_endings red (EGEN-TEXTWRITE-TOOLS) - #8335
Open
evilclanker9000 wants to merge 2 commits into
Conversation
open() with no newline= turns every \n into \r\n on Windows, so the .s case the fuzzer hands the translator was byte-different per platform. It is the first of the two writes that keep tests/test_text_write_line_endings.py red at HEAD.
…tform StageConsole appends to the on-disk log of each build stage; without newline= Windows writes CRLF, so the same build gives byte-different logs per platform. With this the second and last write that keep test_text_write_line_endings.py red at HEAD is pinned.
evilclanker9000
force-pushed
the
deepseek/2-write-newlines-tools
branch
from
November 23, 2026 18:30
c52ad51 to
4c96d18
Compare
Contributor
|
Independent verification on Windows 11 x64 (Python 3.14.0rc2, CPU-only, zero game data). Verification & Negative Controls
LGTM. Approved. AI-assisted. |
leoleahy
reviewed
Nov 23, 2026
leoleahy
left a comment
Contributor
There was a problem hiding this comment.
AI-assisted.
Independently verified 4c96d185 on Windows 11 (Python 3.14.8, CPU-only, no game data):
- Clean merge check against
upstream/main(dde82f27):git merge-tree --write-treeexit 0,git diff --checkexit 0,python -I -m compileall -q tools/leonida_tui.py tools/wave_diff.pyexit 0. python -I tests/test_text_write_line_endings.py: 3/3 OK on HEAD4c96d185(fails on basedde82f27with those exact 2 sites).- Triage note for maintainers: these exact two
newline="\n"additions are already covered by open PR #8094 (which also resolvestests/test_tool_stdout_encoding.py) as well as #7819 / #7857 / #7967 / #8010.
|
Tested
AI-assisted (Claude Code). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests/test_text_write_line_endings.pyis red onmain: it names two text writes that pass nonewline=.tools/wave_diff.py:373-_write()builds the.scase the differential fuzzer hands the translator.tools/leonida_tui.py:753-StageConsole.__init__opens the on-disk log of one build stage.open()with nonewline=turns every\ninto\r\non Windows, so the same input gives a byte-different file (and a different checksum) there than on Linux and macOS - exactly what the repository rule inAGENTS.mdforbids. Both writes addnewline="\n": the two files are the whole diff, and the repository's own check goes green again.ID: EGEN-TEXTWRITE-TOOLS
Test
python -I tests/test_text_write_line_endings.pyBefore (
upstream/mainat67d877390):After (this branch, rebased on
upstream/main47428cc22):The two tools still run and now write LF on Windows:
python -I tools/wave_diff.py --programs 2 --max-ops 8 --seed 1->2 programs (seed 1, wave both): 2 pass, 0 mismatch, 0 skipped, 0 harness errorswave_diff._write()into a temp path, read back as bytes -> beginsb'; wave_diff case code 0x0..0x1000\n\tv_mov_b32 v0, 1\n'and contains nob"\r"StageConsole("s", path).write_line("hello")-> file bytesb'hello\n'python -m compileall -q tools/wave_diff.py tools/leonida_tui.pyclean;python -I scripts/check_no_game_data.py tools/wave_diff.py tools/leonida_tui.pycleanNo GPU needed.
Notes
newline="\n"rather thannewline="": both writers emit plain"\n"themselves, so pinning to LF is the smallest change and matches the other writers fixed for BUILD-468.leonida_tuilog is opened in append mode: a log started before this change keeps its old CRLF lines and only new lines are LF. Reopening withnewline=""would preserve CRLF, which is the behaviour we want to stop.tests/test_text_write_line_endings.pyto test_text_write_line_endings: scan viewer/ and all of runtime/, not only runtime/test/shaders (EGEN-TEXTWRITE-RUNTIMETEST) #7690, which widens the scan toviewer/andruntime/.AI-assisted.