scripts/check_compute_journal_overlay: validate journal dirs/exe, enforce UTF-8, extract main, add tests #2254
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2254
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/check-compute-journal-overlay-safety"
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?
Pull request successfully merged and closed
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.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).#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.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.
Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main c8bf0e7b6, PR head c5a52e67f : red 4 failures / green 4 OK
python3.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
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.