Repository navigation
test_text_write_line_endings: scan viewer/ and all of runtime/, not only runtime/test/shaders (EGEN-TEXTWRITE-RUNTIMETEST) - #7690
Conversation
…e's line ending The `vk_layer_settings.txt` the test hands the Vulkan loader was written with `Path.write_text` and no `newline=`, so the same run gave CRLF on Windows and LF on Linux and macOS. AGENTS.md asks every text writer to name its line ending for that reason. `newline="\n"` makes it LF everywhere; the loader reads both.
…nly runtime/test/shaders The guard only walked `runtime/test/shaders`, so the Python checks that write the loader's settings file, logs and reports for the runtime tests were never scanned: `runtime/test/check_sparse_queue_family.py` could write a CRLF settings file and this test stayed green. `SCAN` now covers the whole `runtime/` tree and `viewer/`; the one writer the wider scan finds was pinned in the previous commit.
|
Tested 401749c on Arch Linux, Python 3.14.10, CPU only: the widening itself is clean, but the suite is red through base drift. The widened runtime/+viewer scan adds zero new findings; the 1 failure names 2 pre-existing violations (leonida_tui.py:753 from #1797, wave_diff.py:373 from #3592), reproduced identically on current main with the old test. Negative control both directions: new test + base check_sparse_queue_family.py catches runtime/test/check_sparse_queue_family.py:83; base narrow test misses the runtime file. So the pin is correct and the scan gap is real — but this branch needs a rebase past #1797/#3592 to go green. No game files. AI-assisted. |
|
Checked on Linux: merged onto main dde82f2 (merges cleanly).
So this change is fine; it goes green once #7033 and #7188 are in ( |
|
Tested head 401749c merged onto main dde82f2 (tree a89235203). test_text_write_line_endings on the PR tree: Ran 3, FAILED (1) — and on a clean-main worktree the same Ran 3, FAILED (1) with the identical entry list [tools/leonida_tui.py:753, tools/wave_diff.py:373]; both are main-side known-reds, so your widened scan adds zero new entries on current main. The pin commit is non-vacuous: removing newline="\n" from check_sparse_queue_family.py:90 makes the widened scanner newly flag :83; restored md5-verified. The one-line pin is correct and the vk_layer_settings.txt CRLF bug on Windows is genuinely fixed. CI pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
Summary
tests/test_text_write_line_endings.py(BUILD-468) is the guard that keeps every text writer in the repository naming its line ending, so the same input gives the same bytes on Windows, Linux and macOS. It walkedtools/,scripts/,make_game.pyand onlyruntime/test/shaders, which left the other Python checks underruntime/test— the ones that write the Vulkan loader's settings file, logs and reports — outside the guard. One of them already broke the rule:runtime/test/check_sparse_queue_family.py:83wrotevk_layer_settings.txtwithPath.write_text(..., encoding="utf-8")and nonewline=, so it was CRLF on Windows and LF elsewhere.Two commits: pin that write (
newline="\n"), then widenSCANtoruntime/andviewer/so a new writer in either tree is caught instead of passing silently.docs/testing.md/AGENTS.md already state the convention; nothing else changes.Test
CPU only, Windows 11, CPython 3.14.3. No GPU, no game files.
Red without the fix — this branch with the writer's
newline=reverted (so only theSCANchange is in play):Green with it —
runtime\test\check_sparse_queue_family.py:83is gone from the list:The two
tools/entries are not mine:mainis red for them today and #7589 pins both. With those two lines applied on top of this branch, locally and uncommitted, the whole test passes:The flag changes the bytes it is there to change (CPython on Windows):
The touched script still runs and its test is green (
python -I runtime/test/check_sparse_queue_family.py --helpprints its usage;python -I tests/test_check_sparse_queue_family.py→ 20 tests, OK).python -m compileallon both files andpython -I scripts/check_no_game_data.py <both files>are clean.Notes
SCANnamesruntimerather thanruntime/testso the C++ side's Python helpers are covered too;python_files()already skips__pycache__,buildand dot-directories, andruntime/is the only place the wider scan found a writer (it checks out already forruntime/test/shaders/build.py).viewer/has no writers today; naming it costs nothing and coversserve.pyif it ever writes one.tests/stays out of the scan on purpose: those files write throwaway fixtures.tools/leonida_tui.pyortools/wave_diff.py; tools, workflows: reconfigure stdout error handling and pin text write newlines #7589 owns those two lines and I left them alone to avoid the conflict.Depends on: #7589
No GPU needed; no game files.
AI-assisted.