shader: reject a non-positive --limit in extract_shaders #639
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/645"
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 R0Y00/Xbox2Windows. Originally posted by louisdibiasi on 2026-11-22T17:16:34Z.
Change
tools/extract_shaders.pytested the--limitcount only after it had written a record, and accepted any integer.--limit 0and--limit -1therefore extracted the first record, wrote a manifest and exited 0, as if the limit were 1. This rejects a limit below 1 withparser.errorbefore the archive is read.Independent problem, no linked issue.
Verification
Commit under test:
f8d4dabonb03f754, Windows 11, Python 3.12.10.Two-record synthetic archive,
python -B tools/extract_shaders.py limit.rpf --output-dir out --stage pixel --limit N:PS_First), exit 0.error: --limit must be at least 1, exit 2, no output directory; N=1 still extracts exactly one record.New
TestRdna2Extractor.test_cli_limit_must_be_positivecovers 0, -1 and 1.python -B tests/rdna2_tools_check.py->Ran 51 tests ... OK (skipped=1). The skip istest_llvm_comparison(LLVM_LIBnot set on my machine).Evidence and follow-up
Synthetic archive built by the test; no game files. LLVM-backed comparison not run here; it is unrelated to the extractor CLI.
Checklist
AI-assisted: I used Claude to find the bug and draft the change. I ran the reproductions and tests above myself.