gbuffer_census, navmesh_cell_fit, root_spill_census: a wrong input is one ERROR line, not a traceback #952
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/952"
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 barkodr on 2026-11-24T15:37:14Z.
Claimed in the coordination issue as: claiming: tools/gbuffer_census.py, navmesh_cell_fit.py and root_spill_census.py stop with a traceback on a wrong input (a file for the carve folder, a non-RPF archive, a non-UTF-8 index); print one ERROR line and exit 2 like the other tools. Tools only. AI-assisted.
What and why
tools/gbuffer_census.pygiven a file instead of ashader_carvefolder stopped withNotADirectoryError, and itsmain()never returned an exit code.tools/navmesh_cell_fit.pygiven a file that is not an RPF archive raised the rightValueErrormessage, but as a traceback.tools/root_spill_census.pygiven a JSON index that is not UTF-8, or a folder, stopped withUnicodeDecodeErrororIsADirectoryError.All three now follow
tools/navmesh_nodes.py:except (OSError, ValueError)printsERROR: ...and exits 2.Tested
On macOS 26.6.2 with Python 3.12.16, from the checkout root with
python -I:tests/test_gbuffer_census.py,tests/test_navmesh_cell_fit.py,tests/test_root_spill_census.py,tests/test_tool_startup.py,tests/test_text_write_line_endings.pyandtests/test_docs_python_deps.pypass. On Ubuntu 26.04 (WSL2) with Python 3.14.4 the first five of those pass;test_docs_python_deps.pywas not run there. Each new wrong-input test fails against the tool onmainand passes with the fix. Not run on real game files; the normal output is unchanged.tests/test_tool_stdout_encoding.pyfails on this branch as it does onmain, on both systems, listing onlytools/native_pso_hashes.py, which this pull request does not touch.GPUs tested: none (no GPU code changed)
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 KernelSmoker on 2026-11-24T15:43:29Z.
Review: APPROVED
Verified on exact head
40f2414d47df58ad0dd578edf41d085ced0ada55. Focused Linux tests passed:test_gbuffer_census.py4/4,test_navmesh_cell_fit.py5/5,test_root_spill_census.py21/21,test_tool_startup.py2/2,test_text_write_line_endings.py3/3, andtest_docs_python_deps.py3/3 (38 total). Python compile,check_no_game_data.py, andgit diff --checkpassed. Synthetic wrong inputs only; no game data/GPU. The reported unrelatedtest_tool_stdout_encoding.pyfailure was not treated as part of this change and was not independently rerun.Imported from ubiquitarianism/leonida. Originally posted by kurrutako on 2026-12-01T08:47:55Z.
Tested on Windows 11, Python 3.14.6, head
40f2414.The four test files: 32 passed.
I ran each tool by hand on wrong input:
--carve.Each case gives one
ERROR:line and exit 2. On main each one is a traceback with exit 1.Minor: on Windows, a folder given as the index reports "[Errno 13] Permission denied" rather than "is a directory".
Merging current main conflicts only in
tools/navmesh_cell_fit.py: main (#2446) added an--outguard insideif a.common:. Moving those two lines into the newtryresolves it. After that the tests give 34 passed, and the manual checks are unchanged.AI-assisted (Claude Code)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:53:31Z.
Review: DISMISSED
Reviewed against current
main: normalizing wrong-input handling to a single ERROR line intools/gbuffer_census.py,tools/navmesh_cell_fit.py, andtools/root_spill_census.pylooks good, but this branch currently conflicts withmain. Please rebase onto currentmainso CI runs cleanly.(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T17:44:45Z.
Rebased onto current
main(d2a564b66, new head51f94c885), preserving the--outoverwrite guard intools/navmesh_cell_fit.pyinside the newtryblock (AI-assisted).Local Linux verification (synthetic inputs, no game data):
scripts/check_no_game_data.py: passgit diff --check origin/main..HEAD: passpython3 -m compileall -q make_game.py tools tests: passtests/test_gbuffer_census.py(4/4),tests/test_navmesh_cell_fit.py(7/7),tests/test_root_spill_census.py(21/21),tests/test_tool_startup.py(2/2),tests/test_tool_stdout_encoding.py(4/4),tests/test_text_write_line_endings.py(3/3),tests/test_docs_python_deps.py(3/3): 44/44 pass