Scripts: decode coverage sweeps as UTF-8 #2640
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2650"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T05:04:10Z.
The direct coverage gate decodes XCL's redirected output with the Windows process locale. XCL writes UTF-8, so a shader name containing characters that are invalid in a local code page can raise
UnicodeDecodeErrorbefore the gate reads the JSON report. Decode the sweep output as UTF-8 explicitly.What is in it
encoding="utf-8"to the live sweep subprocess.Łunder a simulated CP1252 default.Tested
b49be183, the new regression raisedUnicodeDecodeError(9 passed, 1 error in the coverage gate tests). On this branch, full Python script discovery passed 26/26 on Windows.xcl.exe, a nonexistentŁ.rpf, and CP1252 reproduced the old traceback. The fixed gate returned exit 2 and printed the Unicode path in the diagnostic without a decoding traceback. This was an error-path check, not a real shader sweep.git diff --checkpassed. The patch applies cleanly alongside the separate atomic baseline change in PR #2645. PR #2099 wraps the same subprocess call for OS errors and may need a small rebase if merged first.Regression run
Not tested
AI use
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:32:07Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:34:06Z.
Triage (#1607) – head
cfc5192No open or merged PR makes the same change. #2653 (Unicode line separators in
sweep_json) and #2669 (--run-jsonread as bytes) fix other decoding paths ofcoverage_gate.py; #2253 is about empty sweeps.No problems found in the diff: the mocked
subprocess.rundecodes with cp1252 unlessencodingis passed, so the test would fail without the fix.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T09:00:58Z.
merge-check
base:
1c8b551475head:
cfc5192219merge: clean (
git merge --no-editonto1c8b5514,git diff --checkclean;scripts/coverage_gate.pyandscripts/test_coverage_gate.py, +22/-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 (base1c8b5514: 9 passed; newtest_live_sweep_decoding_ignores_system_encodingpassed);python -m unittest discover -s scripts -p "test_*.py"-> 66 passed, 1 error (test_discord_mirror.pyon Windows, same failure on base1c8b5514). Rust workspace tests not run (Tier 0).review: Read the full diff (+22/-1). Switching
subprocess.run(..., text=True)toencoding="utf-8"(scripts/coverage_gate.py:71) stopscoverage_gate.pyfrom decodingxcl shaders --jsonstdout with Windowscp1252when output contains non-ASCII UTF-8 characters. The new unit test mockssubprocess.rundefaulting tocp1252and fails without the fix. 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)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.