From 88cf18a3caa43a104bc74737aec97243e85f2531 Mon Sep 17 00:00:00 2001 From: evilclanker9000 <45567075+evilclanker9000@users.noreply.github.com> Date: Mon, 23 Nov 2026 14:55:21 +0100 Subject: [PATCH 1/2] fog_volumes: refuse a --jobs below 1 instead of silently scanning single-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. --- tools/fog_volumes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/fog_volumes.py b/tools/fog_volumes.py index 1bce64e908..9a2bdcd5f8 100644 --- a/tools/fog_volumes.py +++ b/tools/fog_volumes.py @@ -412,10 +412,12 @@ def main(argv=None) -> int: ap.add_argument("path", help="RPF9 archive, carved 0x7a file, or folder of carved files") ap.add_argument("--out", help="optional JSON summary output path") ap.add_argument("--jobs", type=int, default=min(16, os.cpu_count() or 4), - help="worker processes for RPF9 scanning") + help="worker processes for RPF9 scanning (at least 1)") a = ap.parse_args(argv) if not os.path.exists(a.path): ap.error(f"no such file or folder: {a.path}") + if a.jobs < 1: + ap.error(f"--jobs must be at least 1: {a.jobs}") if a.out: if os.path.isdir(a.out): ap.error(f"--out is a directory: {a.out}") From f93228e1b9547a183019a8f9c4b254f9aba7c148 Mon Sep 17 00:00:00 2001 From: evilclanker9000 <45567075+evilclanker9000@users.noreply.github.com> Date: Mon, 23 Nov 2026 14:55:23 +0100 Subject: [PATCH 2/2] test_fog_volumes: a --jobs of 0 or -4 exits 2 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. --- tests/test_fog_volumes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_fog_volumes.py b/tests/test_fog_volumes.py index 151de6eb03..30d8e7190c 100644 --- a/tests/test_fog_volumes.py +++ b/tests/test_fog_volumes.py @@ -230,6 +230,11 @@ def test_cli_validation_guards(self): with self.assertRaises(SystemExit) as cm: fv.main([os.path.join(td, "missing.rpf")]) self.assertEqual(cm.exception.code, 2) + # Refuses a worker count the run cannot honour + for jobs in ("0", "-4"): + with self.assertRaises(SystemExit) as cm: + fv.main([fp, "--jobs", jobs]) + self.assertEqual(cm.exception.code, 2) if __name__ == "__main__":