Repository navigation
tools: sandbox_scene refuses a --out in a missing folder before the scan - #5550
evilclanker9000 wants to merge 1 commit into
Conversation
|
Tested 5ddf866 on Windows 11, CPython 3.14.7, CPU only: pass.
I also ran the CLI with an empty synthetic rows file, an empty models folder, and AI-assisted. |
|
Verified locally on Windows 11 (Python 3.14, CPU-only):
LGTM! AI-assisted. |
5ddf866 to
a98b2ad
Compare
|
Rebased on upstream/main: the branch conflicted with the newer ry/except OSError handler in main(). Resolved by keeping both: the --out folder is checked before the scan (same one-line ERROR: form, exit 2), and the OSError handler still covers an unreadable --entities/--models or an unwritable --out afterwards. python -I tests/test_sandbox_scene.py: 11 tests OK. On upstream/main the missing --out folder is only reported after the scan (ERROR: [Errno 2] No such file or directory), so the new assertion still falls without the change. No GPU needed. |
Kam471
left a comment
There was a problem hiding this comment.
Reviewed head 5ddf866.
python -I -m pytest tests/test_sandbox_scene.py -q-> 7 passed.git diff --checkclean.
os.path.dirname(os.path.abspath(--out)) is checked before build(), so the refusal happens before the scan: exit 2, one ap.error line, no traceback, and the new subprocess test covers it. Paths with no directory component resolve to the cwd, which is correct. No blockers.
|
Tested a98b2ad merged with main 561b65a on Linux (WSL2) / Python 3.12.16: pass tests/test_sandbox_scene.py: 11 run, 11 passed, 0 failed. Negative control: with tools/sandbox_scene.py restored from upstream/main the new test_out_folder_missing_is_refused_before_the_scan fails (11 run, 1 failure: the tool only fails after trying the missing --entities, with a different message); fix restored afterwards. The new test runs the tool as a subprocess with |
shayderrr
left a comment
There was a problem hiding this comment.
Review
Reviewed correctness fix in PR #5550: tools: sandbox_scene refuses a --out in a missing folder before the scan.
Scope: tests/test_sandbox_scene.py, tools/sandbox_scene.py
Diff: +20 / -1 across 2 file(s).
The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.
Reviewed by shayderrr via automated batch review.
|
Thanks @evilclanker9000 - I went through tools: sandbox_scene refuses a --out in a missing folder before the scan and the diff around |
…before the scan build() opened --out only at the end, so a missing parent folder ended in a FileNotFoundError traceback after the whole placement scan. odrp_7a, page_index, rbf0_index, restofworld_index, restofworld_model_join and story_index already refuse this up front with one ap.error line and exit 2; sandbox_scene now does the same in main().
a98b2ad to
a3db69a
Compare
|
Rebased onto upstream/main at 1cc6e3c after the conflict with #6204 (which added the --out is a folder\ refusal in the same block). Both checks now stand, cheapest first: a folder named by --out and then a missing parent folder, each one ERROR line and exit 2 before any scan.\n\nTest: \python -I tests/test_sandbox_scene.py\ -> Ran 12 tests, OK (includes test_out_directory_is_one_error_line from #6204, test_out_under_a_regular_file_is_one_error_line and this PR's test_out_folder_missing_is_refused_before_the_scan; the last one asserts the 'is not a folder, so' line that only this change prints). No GPU and no game files.\n\nAI-assisted. |
|
Tested
No game files. AI-assisted (Claude Code). |
tools/sandbox_scene.pyopened--outonly at the end ofbuild(), so an output in a folder that does not exist ended in aFileNotFoundErrortraceback after the whole placement scan, the model manifests and every texture had been read. Six other tools already refuse this before doing any work:odrp_7a.py:1197,page_index.py:461,rbf0_index.py:531,restofworld_index.py:513,restofworld_model_join.py:1194andstory_index.py:384print one line and exit 2.The same check now runs in
main()beforebuild(). Nothing else changes: a valid folder behaves as before.Test (
tests/test_sandbox_scene.py, new case, runs the CLI in a temporary folder):python -I tests\test_sandbox_scene.pyFAILED (failures=1)—AssertionError: 1 != 2 : Traceback (most recent call last): ... FileNotFoundError: [Errno 2] No such file or directory: '...\rows.jsonl'(7 tests, 1 failure).Ran 7 tests in 0.182s / OK.sandbox_scene.py: error: <folder> is not a folder, so <out> cannot be written, exit 2.No GPU and no game files: the test builds its arguments in a temporary folder and the refusal happens before any input is read.
Notes
--outfolder is a typo in the command, not a path to create.--entities/--models, which still fail with a traceback when they do not exist. That is the input contract covered bytests/test_missing_input_exit_codes.py(tests: cover 21 more tools in the missing-input exit-code test #5376 extends its list), so it stays out of this PR.AI-assisted.