test(docs): make the UTF-8 pipe fixture portable on Windows #493

Open
monsterlag wants to merge 2 commits from monsterlag/Longshot:fix/catalogue-pipe-newlines into main
First-time contributor

Why

The catalogue's UTF-8 pipe check fails on Windows because its authored text stream translates LF into CRLF while the assertion expects LF bytes. That makes the full contributor suite report an encoding failure even though UTF-8 reconfiguration works.

What changed

  • tests/test_tested_configurations.py: give the authored TextIOWrapper an explicit LF newline policy. Its initial ASCII encoding, arrow-containing input and byte-for-byte UTF-8 assertion are unchanged. Product output is unchanged.
  • Four self-contained docs/tested/ files record the interleaved, game-free comparisons under the current contribution format.

Flags and settings

None.

Measurements

main: 9c9d69ed09 (2026-11-14)
this PR: fix/catalogue-pipe-newlines @ 5a7d656a03
Hardware: Ryzen7 9800X3D, 96GiB RAM, Windows11 build26300, native Python3.14.7; no GPU used.
Scene: the authored stream and catalogue fixtures, not a game scene.
Method: two sequential interleaved main/PR/main/PR runs of the whole25-case file on the same PC, with native Windows newline behavior. No performance claim. The source fix measured at07d7b7a0 is unchanged in the final record-only commit.
How to reproduce: run python -I -B tests/test_tested_configurations.py on both checkouts using native Windows Python. The encoding test constructs an ASCII stream, invokes production UTF-8 setup, flushes it and compares its bytes with the rendered source.

Check main @ 9c9d69ed this PR @ 5a7d656a
Cases, each run 25 25
Failures, run1 / run2 1 / 1 0 / 0
Median failures 1 0
Exit status, run1 / run2 1 / 1 0 / 0
main, each run: Ran25tests; FAILED(failures=1)
this PR, each run: Ran25tests; OK
main assertion: actual bytes contain CRLF; expected render bytes contain LF

Testing

Tested: two native Windows full-file pairs above (all25 cases pass here); independent read-only review confirmed the original assertion/ASCII input remain intact; final25-case check also validates the added run fragments. Full python -I -B tests/run_all.py --jobs8: 534 passed, 2 failed, 34 skipped in159s. Both remaining groups also fail on untouched main9c9d69ed in fresh focused runs: test_oot_state_tap.py (Windows bridge connection race, issue481) and test_walk_key.py (missing stand-in after Skip-title merged, already claimed by mooki). No assertions were weakened or skips added. git diff --check passes.

Not tested: native Linux/macOS execution or actual OS pipe/console integration. This fixture deliberately uses an in-memory stream; issue481 is separate. The one-line test-only change does not run in the game.

Needs other testers: None for this authored-fixture portability correction.

Screenshots

Nothing on screen.

Risk and rollback

Only the stand-in's newline conversion changes; the byte assertion still requires production UTF-8 output. Reverting the one-line change restores the platform-dependent test behavior.

Reviewer notes

Read line272 beside line276. Setting the stand-in's newline policy makes its existing byte contract explicit; normalizing or weakening the assertion was unnecessary. The four run records contain CPU-only tool results and make no GPU/gameplay claim.

Issues

Fixes #482

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main.
  • python -I -B tests/run_all.py run and passing (any failure that also fails on main is named above).
  • Tested in the game, or what wasn't is named under Testing.
  • Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests).
  • Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

If applicable

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md; no appended row or assembled view).
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.
## Why The catalogue's UTF-8 pipe check fails on Windows because its authored text stream translates LF into CRLF while the assertion expects LF bytes. That makes the full contributor suite report an encoding failure even though UTF-8 reconfiguration works. ## What changed - `tests/test_tested_configurations.py`: give the authored `TextIOWrapper` an explicit LF newline policy. Its initial ASCII encoding, arrow-containing input and byte-for-byte UTF-8 assertion are unchanged. Product output is unchanged. - Four self-contained `docs/tested/` files record the interleaved, game-free comparisons under the current contribution format. ## Flags and settings None. ## Measurements main: 9c9d69ed09e2c24965d35f1696aa5c8dd8fe6e40 (2026-11-14) this PR: fix/catalogue-pipe-newlines @ 5a7d656a0336720e9c48aa51c5304812183fd4c8 Hardware: Ryzen7 9800X3D, 96GiB RAM, Windows11 build26300, native Python3.14.7; no GPU used. Scene: the authored stream and catalogue fixtures, not a game scene. Method: two sequential interleaved main/PR/main/PR runs of the whole25-case file on the same PC, with native Windows newline behavior. No performance claim. The source fix measured at07d7b7a0 is unchanged in the final record-only commit. How to reproduce: run `python -I -B tests/test_tested_configurations.py` on both checkouts using native Windows Python. The encoding test constructs an ASCII stream, invokes production UTF-8 setup, flushes it and compares its bytes with the rendered source. | Check | main @ 9c9d69ed | this PR @ 5a7d656a | |---|---|---| | Cases, each run | 25 | 25 | | Failures, run1 / run2 | 1 / 1 | 0 / 0 | | Median failures | 1 | 0 | | Exit status, run1 / run2 | 1 / 1 | 0 / 0 | ```text main, each run: Ran25tests; FAILED(failures=1) this PR, each run: Ran25tests; OK main assertion: actual bytes contain CRLF; expected render bytes contain LF ``` ## Testing **Tested:** two native Windows full-file pairs above (all25 cases pass here); independent read-only review confirmed the original assertion/ASCII input remain intact; final25-case check also validates the added run fragments. Full `python -I -B tests/run_all.py --jobs8`: **534 passed, 2 failed, 34 skipped in159s**. Both remaining groups also fail on untouched main9c9d69ed in fresh focused runs: `test_oot_state_tap.py` (Windows bridge connection race, issue481) and `test_walk_key.py` (missing stand-in after Skip-title merged, already claimed by mooki). No assertions were weakened or skips added. `git diff --check` passes. **Not tested:** native Linux/macOS execution or actual OS pipe/console integration. This fixture deliberately uses an in-memory stream; issue481 is separate. The one-line test-only change does not run in the game. **Needs other testers:** None for this authored-fixture portability correction. ## Screenshots Nothing on screen. ## Risk and rollback Only the stand-in's newline conversion changes; the byte assertion still requires production UTF-8 output. Reverting the one-line change restores the platform-dependent test behavior. ## Reviewer notes Read line272 beside line276. Setting the stand-in's newline policy makes its existing byte contract explicit; normalizing or weakening the assertion was unnecessary. The four run records contain CPU-only tool results and make no GPU/gameplay claim. ## Issues Fixes #482 ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` run and passing (any failure that also fails on `main` is named above). - [x] Tested in the game, or what wasn't is named under Testing. - [x] Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests). - [x] Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### If applicable - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`; no appended row or assembled view). - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated.
Use LF in the authored TextIOWrapper so its byte-for-byte UTF-8 assertion
does not depend on Windows translating LF into CRLF. Keep the assertion
and the product's output behavior unchanged.

Assisted-by: OpenAI Codex
Co-Authored-By: OpenAI Codex <[email protected]>
docs(tested): record current game-free regression comparisons
Some checks are pending
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 5s
Website / Website on Cloudflare (pull_request_target) Has been skipped
5a7d656a03
Keep each measured native regression run self-contained under docs/tested
using the current contribution format. These are CPU-only tool checks;
they make no gameplay, GPU compatibility or performance claim.

Assisted-by: OpenAI Codex
Co-Authored-By: OpenAI Codex <[email protected]>
monsterlag changed title from WIP: test(docs): make the UTF-8 pipe fixture portable on Windows to test(docs): make the UTF-8 pipe fixture portable on Windows 2026-11-14 16:34:57 +00:00
futondestroyer left a comment

Reviewed head 5a7d656a0336720e9c48aa51c5304812183fd4c8; no correctness issue found in the complete five-file diff.

Independent native Windows 11 build 26300 / Python 3.14.7 validation, two interleaved control/PR pairs: the unchanged catalogue check fails 1 of 25 cases on both controls, while all 25 pass on both PR runs. The control was 5765a767 on main 7ff5256e; both catalogue source files are identical to the PR's named main 9c9d69ed. The real catalogue renderer also accepts the branch's four new three-line run fragments.

The explicit LF policy fixes platform newline translation in the authored stream. It retains the initial ASCII encoding, the arrow-containing source, production UTF-8 reconfiguration and exact UTF-8 byte assertion; it does not relax the encoding check or change production output. The frozen catalogue is untouched. This is approval of the small game-free fixture/docs change; no game-runtime or fresh full-suite run is claimed for this review.

Reviewed head `5a7d656a0336720e9c48aa51c5304812183fd4c8`; no correctness issue found in the complete five-file diff. Independent native Windows 11 build 26300 / Python 3.14.7 validation, two interleaved control/PR pairs: the unchanged catalogue check fails 1 of 25 cases on both controls, while all 25 pass on both PR runs. The control was `5765a767` on main `7ff5256e`; both catalogue source files are identical to the PR's named main `9c9d69ed`. The real catalogue renderer also accepts the branch's four new three-line run fragments. The explicit LF policy fixes platform newline translation in the authored stream. It retains the initial ASCII encoding, the arrow-containing source, production UTF-8 reconfiguration and exact UTF-8 byte assertion; it does not relax the encoding check or change production output. The frozen catalogue is untouched. This is approval of the small game-free fixture/docs change; no game-runtime or fresh full-suite run is claimed for this review.
Some checks are pending
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 5s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/catalogue-pipe-newlines:monsterlag-fix/catalogue-pipe-newlines'
git switch 'monsterlag-fix/catalogue-pipe-newlines'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!493
No description provided.