Skip to content

sandbox: a bad --radius or --max-props is a usage error before vk_sandbox is looked up, not "unsupported" - #7984

Open
Dacryoserum wants to merge 1 commit into
ItsNotRexed:mainfrom
Dacryoserum:sandbox-radius-max-props-check
Open

Dacryoserum wants to merge 1 commit into
ItsNotRexed:mainfrom
Dacryoserum:sandbox-radius-max-props-check

Conversation

@Dacryoserum

@Dacryoserum Dacryoserum commented Nov 23, 2026 •

Copy link
Copy Markdown

Coordination claim

What changed and why

tools/sandbox.py passes --radius and --max-props straight to sandbox_scene.build(), so it never ran the checks sandbox_scene.main() gained in #6658 (--radius finite and non-negative, --max-props non-negative). --radius nan, --radius inf, --radius -5 and --max-props -1 were accepted and the run ended in exit 77: "vk_sandbox is not built" when the tool is missing, or "no prop near the centre" once it is built, since d <= nan selects nothing. 77 is the code the GPU/Wine runners read as a skip, so a typo looked like missing hardware.

The two checks move into sandbox_scene.check_placement(ap, args). sandbox_scene.main() calls it where the checks used to be (same messages), and sandbox.py calls it right after parse_args, before find_tool, so a bad value is one usage line and exit 2 whether or not vk_sandbox is built. 0 stays valid for both (a radius that keeps only the centre, an empty scene), as in #6658.

Test

python -I tests/test_sandbox_pick.py. The new class is ScenePlacementOptions:

  • test_sandbox_refuses_bad_values_before_looking_for_vk_sandbox: four subtests (nan, inf, -5, --max-props -1) with no vk_sandbox built. Each must exit 2 with the must be message.
  • test_sandbox_scene_refuses_the_same_values: the same values through sandbox_scene.main(), and no scene file is written. Validate sandbox scene radius and prop cap #6658 added those checks without a test.
  • test_zero_is_still_accepted: --radius 0 --max-props 0 still reaches the tool lookup (exit 77, "vk_sandbox is not built").

Before, on main (dde82f27e):

> python -I tools/sandbox.py --work <empty> --entities <empty.jsonl> --models <empty> --check --radius nan
unsupported: vk_sandbox is not built
exit=77

The new test on the unmodified tool fails with 4 failures (SystemExit not raised for each sandbox.py subtest).

After, on this branch:

> python -I tools/sandbox.py --work <empty> --entities <empty.jsonl> --models <empty> --check --radius nan
usage: sandbox.py [-h] --work WORK --entities ENTITIES --models MODELS
                  ...
sandbox.py: error: --radius must be finite and non-negative
exit=2
  • python -I tests/test_sandbox_pick.py: Ran 9 tests, OK
  • python -I tests/test_sandbox_scene.py, python -I tests/test_sandbox_scene_build.py: OK (unchanged)
  • python -m compileall -q make_game.py tools tests: clean
  • python -I scripts/check_no_game_data.py on the three changed files: clean

Tested on Windows 10 Pro 22H2 (19045), Python 3.11.9, AMD Radeon RX 7800 XT, driver 32.0.31019.2002. The change and its tests need no GPU and no game files.

Notes

This pull request was AI-assisted (Claude Code). I reviewed the change and ran the tests above on the machine named in the Test section.

…dbox is looked up, not "unsupported"

tools/sandbox.py hands --radius and --max-props to sandbox_scene.build()
directly, so it skipped the checks sandbox_scene.main() gained in ItsNotRexed#6658.
--radius nan, inf or -5 and --max-props -1 ended in exit 77
("vk_sandbox is not built" or "no prop near the centre"), which the test
runners read as a skip. Both tools now share
sandbox_scene.check_placement(), and sandbox.py runs it right after
parsing: one usage line and exit 2.
@noviw-rblx

Copy link
Copy Markdown

checked: #7984 | with: python -m pytest -q tests/test_sandbox_pick.py | on: Windows 10, CPython 3.13, head 520f7b5, CPU only | result: 9 passed, 8 subtests passed. No game data, no GPU.

@TieruYT

TieruYT commented Nov 23, 2026

Copy link
Copy Markdown

Windows, synthetic inputs. Tested 520f7b5.

Both sandbox entry points rejected the invalid radius and max-props cases in the fixture before looking up vk_sandbox. The zero-value control remained accepted. All three focused CPU-side tests passed, and the parent failed the same suite.

AI-assisted verification · GPT-6.2 Astra Medium

@Dacryoserum
Dacryoserum marked this pull request as ready for review November 23, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants