Scripts: keep Unicode separators inside coverage JSON lines #2643

Open
luckyteagirl wants to merge 1 commit from upstream-pr/2653 into main
luckyteagirl commented 2026-11-26 05:05:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T05:05:30Z.


The coverage gate selects the last JSON record with Python splitlines(), which also treats Unicode NEL and line/paragraph separators as line breaks. XCL can include these characters in a shader program name inside one valid JSON record, causing the gate to parse a fragment and fail. Split only at physical LF boundaries so report strings stay intact.

What is in it

  • Select records using split("\n"); the existing trim still handles CRLF output.
  • Add cases for U+0085, U+2028, and U+2029 inside a report example name.

Tested

  • On current main b49be183, the new regression failed for all three separators (9 tests passed, 1 test failed with 3 JSON errors). On this branch, full Python script discovery passed 26/26 on Windows Python 3.11.9 and Ubuntu under WSL Python 3.14.4.
  • git diff --check passed. This patch applies cleanly over the separate coverage baseline and UTF-8 decoding changes in PRs #2645 and #2650.

Regression run

  • Not applicable. This changes only the Python coverage script and its test.

Not tested

  • A real shader pack sweep, Rust workspace tests, GPU tests, and retail title smoke.

AI use

  • Codex (GPT-6.2 Sol) implemented and tested the change; a separate Codex Sol agent independently reviewed it.
<!-- greyfinch-sync:ivall/xcl:issue:5504338975 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2653). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T05:05:30Z. --- The coverage gate selects the last JSON record with Python `splitlines()`, which also treats Unicode NEL and line/paragraph separators as line breaks. XCL can include these characters in a shader program name inside one valid JSON record, causing the gate to parse a fragment and fail. Split only at physical LF boundaries so report strings stay intact. **What is in it** - Select records using `split("\n")`; the existing trim still handles CRLF output. - Add cases for U+0085, U+2028, and U+2029 inside a report example name. **Tested** - On current main `b49be183`, the new regression failed for all three separators (9 tests passed, 1 test failed with 3 JSON errors). On this branch, full Python script discovery passed 26/26 on Windows Python 3.11.9 and Ubuntu under WSL Python 3.14.4. - `git diff --check` passed. This patch applies cleanly over the separate coverage baseline and UTF-8 decoding changes in PRs #2645 and #2650. **Regression run** - Not applicable. This changes only the Python coverage script and its test. **Not tested** - A real shader pack sweep, Rust workspace tests, GPU tests, and retail title smoke. **AI use** - Codex (GPT-6.2 Sol) implemented and tested the change; a separate Codex Sol agent independently reviewed it.
github-actions[bot] commented 2026-12-01 02:32:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:32:19Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7298723764 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2653#issuecomment-7298723764). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:32:19Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 08:34:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:34:54Z.


Triage (#1607) – head fe5fe6c

No open or merged PR changes how sweep_json splits lines; the other open coverage_gate.py PRs (#2650, #2669, #2202, #2536, #2099) touch decoding, validation or the baseline, not this.
str.splitlines() also breaks on U+0085/U+2028/U+2029, which serde_json emits unescaped inside strings, so splitting on \n and stripping keeps the report line whole; the test covers all three with CRLF output. No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305506740 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2653#issuecomment-7305506740). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:34:54Z. --- **Triage (#1607)** – head fe5fe6c No open or merged PR changes how `sweep_json` splits lines; the other open coverage_gate.py PRs (#2650, #2669, #2202, #2536, #2099) touch decoding, validation or the baseline, not this. `str.splitlines()` also breaks on U+0085/U+2028/U+2029, which serde_json emits unescaped inside strings, so splitting on `\n` and stripping keeps the report line whole; the test covers all three with CRLF output. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Decodere commented 2026-12-02 09:05:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T09:05:15Z.


merge-check
base: 1c8b551475
head: fe5fe6c75a
merge: clean (git merge --no-edit onto 1c8b5514, git diff --check clean; scripts/coverage_gate.py and scripts/test_coverage_gate.py, +10/-1)
build: not run (Tier 0 Python script diff; no Rust code changed)
tests: python -m unittest discover -s scripts -p "test_coverage_gate.py" -v -> 10 passed, 0 failed (base 1c8b5514: 9 passed; new test_unicode_line_separators_in_report_strings passed with 3 subtests); python -m unittest discover -s scripts -p "test_*.py" -> 66 passed, 1 error (test_discord_mirror.py on Windows, same failure on base 1c8b5514). Rust workspace tests not run (Tier 0).
review: Read the full diff (+10/-1). Switching stdout.splitlines() to stdout.split("\n") in sweep_json (scripts/coverage_gate.py:27-28, followed by line.strip()) prevents Python from breaking JSON lines at embedded Unicode separators (U+0085, U+2028, U+2029) while still handling CRLF line endings cleanly. The new test covers all three separators with CRLF output. No problems found.
performance: none (offline script in scripts/; zero runtime impact)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7340355665 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2653#issuecomment-7340355665). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T09:05:15Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: fe5fe6c75a279dad918e3005c04e72a862eb92f7 merge: clean (`git merge --no-edit` onto `1c8b5514`, `git diff --check` clean; `scripts/coverage_gate.py` and `scripts/test_coverage_gate.py`, +10/-1) build: not run (Tier 0 Python script diff; no Rust code changed) tests: `python -m unittest discover -s scripts -p "test_coverage_gate.py" -v` -> 10 passed, 0 failed (base `1c8b5514`: 9 passed; new `test_unicode_line_separators_in_report_strings` passed with 3 subtests); `python -m unittest discover -s scripts -p "test_*.py"` -> 66 passed, 1 error (`test_discord_mirror.py` on Windows, same failure on base `1c8b5514`). Rust workspace tests not run (Tier 0). review: Read the full diff (+10/-1). Switching `stdout.splitlines()` to `stdout.split("\n")` in `sweep_json` (`scripts/coverage_gate.py:27-28`, followed by `line.strip()`) prevents Python from breaking JSON lines at embedded Unicode separators (`U+0085`, `U+2028`, `U+2029`) while still handling CRLF line endings cleanly. The new test covers all three separators with CRLF output. No problems found. performance: none (offline script in `scripts/`; zero runtime impact) verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2653:upstream-pr/2653'
git switch 'upstream-pr/2653'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2653'
git switch 'upstream-pr/2653'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2653'
git switch 'upstream-pr/2653'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2653'
git switch 'main'
git merge --squash 'upstream-pr/2653'
git switch 'main'
git merge --ff-only 'upstream-pr/2653'
git switch 'main'
git merge 'upstream-pr/2653'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2643
No description provided.