tools/ab_control_flow.py: upfront out/harness/names guards and spvasm OSError handling #2289
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2289"
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 ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-26T12:49:42Z.
Claimed in the coordination issue as: AB-CONTROL-FLOW-UPFRONT-OUT-AND-NAMES-EMPTY-GUARD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7192453000)
What and why
_validate_out_dir()intools/ab_control_flow.pyand run upfront CLI checks before openingindex.json: reject empty/whitespaceoutdirectories, non-directoryouttargets/parents (with"cannot create"messages matching existing CLI conventions), empty/directory--harnessvalues (still allowing mocked harness names), and empty/missing--namesfiles..spvasmfiles withencoding="utf-8-sig"inside atry/except OSErrorblock so a missing or unreadable assembly records a per-shadernote()outcome instead of aborting the batch with an unhandled traceback.tests/test_ab_control_flow.py.Tested
python -I tests/test_ab_control_flow.py -v: 72 tests (71 passed, 1 skipped on Windows:test_mode_000_output_folder). Detachedupstream/mainbaseline with only the updated test file fails with 8 failures and 1 error (1 skipped).python -I tests/test_ci_registration.py: 16 passed.python -I tests/test_text_write_line_endings.py: 3 passed.python -I scripts/check_no_game_data.py,python -I -m compileall -q tools/ab_control_flow.py tests/test_ab_control_flow.py, andgit diff --cached --check: passed.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-27T04:40:34Z.
Review: APPROVED
Approving
56e5b9a3f.The output folder,
--harnessand--namesare checked before any work, and a translated.spvasmthat cannot be read is noted for that shader instead of ending the run (read asutf-8-sig, so a BOM is harmless).Merged onto
maind1dff7949in one batch with 15 other tool PRs of this series (no conflicts), on Linux with Python 3.13.tests/test_ab_control_flow.py: 71 passed, 1 skipped (main: 69). AI-assisted (Claude Code, Claude Opus 5.5).Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T10:23:51Z.
#2289 | head
56e5b9a3f0(merged cleanly with main901b6c1bf) |python -I tests/test_ab_control_flow.py| red on main:FAILED (failures=8, errors=1, skipped=1)(index.jsonread attempted before validatingout/--harness/--names, and unhandledFileNotFoundErrorwhen a translated.spvasmfile is missing) | green on PR+main:72 tests OK (skipped=1)| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
_validate_out_dir, upfront--harness/--nameschecks, andutf-8-sig+OSErrorhandling when reading translated.spvasmfiles intools/ab_control_flow.py. Exercised all 8 invalid path/blocker/directory cases on Windows 11 NTFS plus UTF-8 BOM and missing.spvasmreporting intooutcomes.tsv. Also passedtests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK),tests/test_runner_calls_all_tests.py(3 OK), andscripts/check_no_game_data.pyon the merged tree.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T15:10:24Z.
Red/green: classified READY by cloud-6 (red on main
09c153948, green on head merged with main); head56e5b9a3f0unchanged since 2026-11-26, before that run.Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
d48a957bbin GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)