tools/ab_control_flow: handle UTF-8-SIG/CRLF inputs, subprocess encoding and atomic outcomes.tsv #1853
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1853
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1853/head"
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?
@kirigayakazima on GitHub · 2026-11-25 13:11 UTC · original
kirigayakazima:fix/ab-control-flow-safety→main· +128 −11 · 2 files · 1 commits · merged 2026-11-25 17:31 UTCClaimed in the coordination issue as: AB-CONTROL-FLOW-CRLF-BOM-AND-ATOMIC-TSV (#1608)
What and why
--namesandindex.jsonintools/ab_control_flow.pywithencoding="utf-8-sig"and parse--nameslines viasplitlines()+.strip()so UTF-8 BOMs and Windows CRLF endings do not corrupt shader names.outcomes.tsvatomically inwrite_outcomes()(tempfile.mkstempbesideos.path.realpath(...),os.fsync,published_mode, andreplace_retry.replace), preserving any existing file and cleaning up staging files on failure.encoding="utf-8", errors="replace"tosubprocess.run(..., capture_output=True, text=True)inrender_targets()andmain()for safe decoding underpython -I.tests/test_ab_control_flow.py.Tested
python -I tests/test_ab_control_flow.py -v->Ran 70 tests in 1.849s,OK (skipped=1)(Windows skipschmod 000test).upstream/main(98c2f777) baseline worktree with updatedtests/test_ab_control_flow.py->Ran 70 tests in 1.733s,FAILED (failures=2, errors=2, skipped=1).python -I tests/test_ci_registration.py->Ran 16 tests in 7.338s,OK.python -I tests/test_text_write_line_endings.py->Ran 3 tests in 14.354s,OK.python -I scripts/check_no_game_data.py tools/ab_control_flow.py tests/test_ab_control_flow.py,python -I -m compileall -q tools/ab_control_flow.py tests/test_ab_control_flow.py, andgit diff --check-> exit0.GPUs tested: n/a (CPU/stdlib Python tests on Windows 11 x64)
AI-assisted: yes
Checklist
needs rebase).@madvillain91 on GitHub · 2026-11-25 13:31 UTC · original · reviewed
Independent Windows 11 26H2 (26300.9711) check at
3a84ae7aaagainst main384abe5b0(PR base98c2f7777), using CPython 3.12.3 (python -I) and Git for Windows 2.56.0.windows.2. Passed test_ab_control_flow.py (69 passed, 1 skipped on Windows mode-000 test, 3.226s) and test_text_write_line_endings.py (3/3 in 19.435s), with check_no_game_data.py and compileall clean. Verified UTF-8-SIG/CRLF handling for names files and index.json, encoding="utf-8", errors="replace" on subprocess.run calls under Windows python -I, and atomic outcomes.tsv publishing via replace_retry with staging cleanup on failure. LGTM.@GeorgiyDemo on GitHub · 2026-11-25 14:21 UTC · original
Tested
3a84ae7aaon Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmain71a769d7d(Python shader tool; no GPU):tests/test_ab_control_flow.py: 70 passed, 31 subtests passed at this head.main: 4 failed, 66 passed — the UTF-8-SIG/CRLF names reading and the atomic TSV write are the new cases.index.json/--namespair from a translation; the tests build them synthetically.AI-assisted; synthetic fixtures only, no game data.
@DeadlyChirp on GitHub · 2026-11-25 15:37 UTC · original
Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.
python -m pytest -q tests/test_ab_control_flow.py:mode 000 does not stop root or Windowstest. The new tests pass.(AI-assisted test run; output checked by hand.)
@aslan2142 on GitHub · 2026-11-25 17:31 UTC · original
Merged. Thank you, @kirigayakazima. UTF-8-SIG and CRLF inputs and subprocess encodings are handled, and the TSV is written atomically.
mainand pass here; the docs, line-ending and CI/ctest registration checks pass, and so does the game-data check.main863c1616a+3a84ae7aa: the semantic suite passes (490 files, 6,292 tests, 0 files failed);test_ab_control_flowpass; the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 2 changed files.AI-assisted (Claude Code, Claude Opus 5.5).