Repository navigation
fog_volumes: refuse a --jobs below 1 instead of silently scanning single-threaded (EGEN-FOGVOL-JOBS) - #6321
Open
evilclanker9000 wants to merge 2 commits into
Open
fog_volumes: refuse a --jobs below 1 instead of silently scanning single-threaded (EGEN-FOGVOL-JOBS)#6321evilclanker9000 wants to merge 2 commits into
evilclanker9000 wants to merge 2 commits into
Conversation
…gle-threaded max(1, a.jobs) turned --jobs 0 and --jobs -4 into one worker with no diagnostic, while awc_shorts and the other worker-count tools reject a non-positive count. Report it as a usage error, the way the other argument guards in this tool do.
Red on the tree before the guard: AssertionError: SystemExit not raised (Ran 5 tests, FAILED failures=1); green after it (Ran 5 tests, OK). Synthetic 64-byte input, no game files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tools/fog_volumes.py --jobs 0(or--jobs -4) was accepted and silently ran with one worker:summarize(a.path, jobs=max(1, a.jobs))attools/fog_volumes.py:425clamped the count with nodiagnostic, so a run that asked for parallelism got none and exited 0. The sibling tools refuse a
non-positive
--jobs(tools/awc_shorts.py:100printserror: --jobs must be at least 1and exits 2),and the other argument guards in this tool already report a usage error through
ap.error.The tool now refuses a
--jobsbelow 1 with--jobs must be at least 1: <n>and exit status 2, andits
--helptext states the range.Test
Synthetic 64-byte input, standard library only, no game files, no GPU:
python -I tests\test_fog_volumes.pyBefore the change (
AssertionError: SystemExit not raisedon the new assertion):After:
python -m compileall -q tools/fog_volumes.py tests/test_fog_volumes.pyis clean, andpython -I tools/fog_volumes.py --helpnow printsworker processes for RPF9 scanning (at least 1).GPU and driver
No GPU needed; CPU-only argument handling.
Notes
_scan_rpf_offsets(max(1, jobs)) is left in place:summarize()anditer_fog_resources()are also called from code with their ownjobsargument, and the new guardonly covers the command line.
--jobs 0could have been read as "auto", but the default already picksmin(16, os.cpu_count() or 4), and a silent single-threaded run is the behaviour the other tools intools/reject, so this follows them instead.AI-assisted.