scripts/check_compute_journal_overlay: validate journal dirs/exe, enforce UTF-8, extract main, add tests #2254
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2254"
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-26T10:38:19Z.
Claimed in the coordination issue as: CHECK-COMPUTE-JOURNAL-OVERLAY-SAFETY-AND-TESTS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7189582869)
What and why
d.is_dir()inentries()(scripts/check_compute_journal_overlay.py) before iteratingpipeline_cache.d.new-B/pipeline_cache.dandcold/pipeline_cache.dwith explicit directory, single-entry, and.is_file()checks giving clearRuntimeErrormessages.encoding="utf-8"alongsideerrors="replace"insubprocess.run(...)so redirected stdout/stderr does not depend on the host ANSI code page.main(argv=None) -> intvalidating executable existence/regular-file status and allowing bothd3d12_compute_journal_test.exeand POSIXd3d12_compute_journal_test, catching runtime errors cleanly onstderrwith exit status1/2.tests/test_check_compute_journal_overlay.py.Tested
python -I tests/test_check_compute_journal_overlay.py -v->Ran 3 tests in 0.755s(OK).upstream/maina73a57e1withtests/test_check_compute_journal_overlay.pycopied into detached worktree):Ran 3 tests in 0.027s(FAILED (errors=3)).python -I tests/test_ci_registration.py(Ran 16 tests in 13.847s,OK),python -I tests/test_text_write_line_endings.py(Ran 3 tests in 17.336s,OK),python -I scripts/check_no_game_data.py(exit 0),python -I -m compileall -q(exit 0),git diff --check(exit 0).GPUs tested: n/a (mocked subprocess harness and CLI validation tests)
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 lixonik on 2026-11-26T10:50:42Z.
Review: COMMENTED
Windows 11: 3/3 Python tests passed. I built
d3d12_compute_journal_testat this head and ran the overlay checker with--require-hiton Vulkan. All four cases passed, including the external-A cache hit and both expected readbacks. One CLI error path below.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T10:50:42Z.
Code review location:
scripts/check_compute_journal_overlay.py; line 124[P3] Report Windows executable launch failures through the CLI error handler.
An otherwise valid path to a zero-byte file named
d3d12_compute_journal_test.exepasses the file/name checks. On Windows,subprocess.runthen raisesOSError(WinError 193) and escapes as a traceback. A launch blocked by permissions can take the same path. Can this handler also catchOSErrorand return the existingERROR:diagnostic?Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-27T04:35:32Z.
Review: APPROVED
Approving
aa95d15fd.Each
iterdir()unpacking that would raise a bareValueErroris replaced by a check with its own message, the script gets amain(argv)that validates the executable, and child output is decoded as UTF-8. The overlay run itself needs a GPU and the built test, which this machine does not have.Merged onto
maind1dff7949in one batch with 22 other tool PRs of this series (no conflicts), on Linux with Python 3.13.tests/test_check_compute_journal_overlay.py: 3 passed (new). AI-assisted (Claude Code, Claude Opus 5.5).Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T12:07:14Z.
Code review location:
scripts/check_compute_journal_overlay.py; line 124Fixed:
main()now catchesOSErroralongside(RuntimeError, subprocess.TimeoutExpired)so Windows/POSIX launch failures return exit 1 with anERROR:message and no traceback. Added regression tests intests/test_check_compute_journal_overlay.py(4 passed + 5 repo checks).Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-27T14:23:26Z.
Review: COMMENTED
Re-checked at
c5a52e67f(merged ontomainec91d695c).Catching
OSErroralongside(RuntimeError, subprocess.TimeoutExpired)inmain()cleanly converts spawn errors (such asWinError 193) intoERROR: ...without a traceback, backed by both mocked and live 0-byte.exeregression tests.Verified locally on Windows 11 (Python 3):
tests/test_check_compute_journal_overlay.py: 4/4 passedscripts/check_no_game_data.pyandgit diff --check: cleanNo remaining findings.
AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T09:15:18Z.
#2254 | head
c5a52e67f528844dd11edbc4ef531bf269726d1c|python3 -I tests/test_check_compute_journal_overlay.py -v| red: 4 tests, 4 errors | green: 4 passed | Exceptions on main → passThe baseline raised exceptions on all four tests, including a missing main entry point and an unhandled invalid directory. The merged tests exercised the expected error handling.
Pinned main
4938673668d807bf365b61284bf22b1ff8d02cc4, merged into the PR head. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Full suite: not run. AI-assisted: OpenAI Codex. Batch claim.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:14:15Z.
Native Windows 11 + NVIDIA GeForce RTX 3090 Verification (
c5a52e67f5)Verified
c5a52e67f528844dd11edbc4ef531bf269726d1cmerged cleanly ontoorigin/main(c7753ed98a56677f10e34078b37eab0540e190ec,git merge-tree --write-treerc=0) on native Windows 11 (26200) + NVIDIA GeForce RTX 3090 (610.88):origin/mainc7753ed98a):python -I tests/test_check_compute_journal_overlay.pyfailed (FAILED (errors=4)— no extractablemain(argv)entry point or structured journal/CLI error handling).origin/main + c5a52e67f5):python -I tests/test_check_compute_journal_overlay.py:4/4 OK, including the Windows-specificos.name == "nt"0-byte executableWinError 193(ERROR_BAD_EXE_FORMAT) path (rc=1, cleanERROR:line withoutTraceback).python -I scripts/check_compute_journal_overlay.py <build>/d3d12_compute_journal_test.exe --require-hitexited0(colddriver_hit=0, readback=[4, 10],external-Adriver_hit=1, readback=[4, 10],new-Bdriver_hit=0, readback=[4, 14],local-Bdriver_hit=1, readback=[4, 14]).AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T03:27:46Z.
Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main
c8bf0e7b6, PR headc5a52e67f: red 4 failures / green 4 OKpython3.12 -I tests/test_check_compute_journal_overlay.py(new file, 4 tests):git merge-tree).test_four_stage_happy_path_env_scrubbing_and_encoding,test_require_hit_mutation_and_skip_propagation,test_entries_and_main_reject_bad_paths_without_traceback,test_executable_launch_oserror_reports_cli_error. Note: 3 of the 4 fail only because main has nomain()yet (AttributeError, the refactor); the fakepipeline_cache.dcase (NotADirectoryError on main) is the real behaviour change.git merge --no-ff): 4 OK + 3 subtests OK, skipped 0.test_report_paths,test_tool_startup, navmesh*/ttpf*/dds/zero_span/staging tests): 102 OK, 7 skipped (rpf9dump not built,bcpack_calibrationdylib absent, one Windows-only case-sensitivity test), 1 failure —test_tool_startuppsin_dialogue(ModuleNotFoundError: psin_data), identical on main (MEASURED n=3), unrelated.src, = iterdir()becomes an explicitrequire;encoding="utf-8"added; a testablemain()returns 2/1 instead of a traceback; an executable name without.exeis now accepted (seems intended for other platforms). No game data or local paths.Verdict: READY
AI-assisted: Claude Code
Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-29T03:38:15Z.
Merging, thank you @kirigayakazima! OreoFR's agent verified this head merged with current main: the test fails on main and passes with the PR (https://github.com/ProjectLeonida/mandy/pull/2254#issuecomment-7250061937), and it still merges cleanly.
AI-assisted (Claude Code, Claude Opus 5.5), on behalf of DadaCap.