Commit Graph

22 Commits

Author SHA1 Message Date
dbd6ccc2ba tests: end the file with one newline, not two
No content change.
2026-11-30 15:47:21 +01:00
b3b064bb79 tests: keep swizzle_search coverage when the user site is isolated
Applied from merzleckeier's follow-up (f9456e020), unchanged: the two render()
calls use the parent's numpy and Pillow, and the three CLI validation checks
finish before the child needs numpy, so all five should run rather than skip.
The two PNG preview subprocesses need Pillow in the child, which the isolated
probe now checks.

Written with an AI assistant.
2026-11-30 14:55:47 +01:00
aa51a9693e tests: swizzle_search's CLI gates ask the way the tool runs too
The same in-process numpy check, in the file whose CLI tests spawn
`python -I`: HAVE_NUMPY stayed for the tests that call numpy here, and the
nine CLI gates now use NUMPY_VISIBLE_TO_TOOL, the isolated probe.

Measured on main b8bd37111, Windows 11, Python 3.13: 3 failed, 23 passed,
5 skipped before; 21 passed, 10 skipped after. Where -I sees numpy the probe
returns true and every gate opens as before.

Written with an AI assistant.
2026-11-30 14:55:47 +01:00
e61aadda9f swizzle_search, tex_mode_probe: say numpy is missing in one line, as tile_probe does 2026-11-24 16:11:23 +01:00
78af5fd4b4 Merge pull request #268 from kotekompotek/work/build-1526-swizzle-search
rdna2spirv: guard out-of-bounds swizzle search offsets
2026-11-23 22:14:39 -05:00
77c6843825 swizzle_search: report empty candidate searches even without --out (BUILD-1526) 2026-11-23 12:42:56 +05:00
0af07f09b1 Merge pull request #4217 from Alpaca-exe
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:12:27 -05:00
5948c690b8 tests: skip the hard-link cases where hard links are unavailable
Guard the remaining unguarded os.link() calls in test_awc_names.py, test_gamedata_graph.py, test_navmesh_decode.py, test_restofworld_index.py, test_rtti_scan.py, test_save_keys.py, test_swizzle_search.py, and test_tex_headers_report_paths.py with try/except (OSError, NotImplementedError) so only the hard-link subtest/check is skipped when hard links are unavailable and the rest of each test still runs.
2026-11-23 01:01:33 +01:00
d16a99b1a6 Merge pull request #3697 from Leo Leahy 2026-11-22 17:03:27 -05:00
a8157d08cc Merge pull request #3364 from klarnet2009 2026-11-22 17:01:41 -05:00
487568a1e8 tile_probe, swizzle_search: pack DDSCAPS_TEXTURE before copy, guard layout None and bpe 2026-11-22 18:22:56 -03:00
6fc0263446 fix(swizzle_search): catch ValueError from render on unknown image extension 2026-11-22 23:12:40 +02:00
087ddd9e16 fix(swizzle_search): validate --out path and guard render OSError 2026-11-22 22:15:13 +02:00
d8e4a8442d Merge pull request #2921 from Vonsek 2026-11-22 15:13:12 -05:00
b10b4e3252 fix(assets): preview short complete swizzle samples
The search target may require more rows than a valid sample contains. Scoring available complete rows lets short samples reach the PNG preview.
2026-11-22 19:45:29 +01:00
c18b4cd4a3 fix(tools): score thin swizzle candidates using available edges
An axis one block wide contains no edges. Its empty mean produced NaN and could keep a higher-cost preview ahead of a finite candidate.
2026-11-22 18:15:53 +01:00
8dc1604e9d fix: prevent swizzle preview from overwriting input 2026-11-22 12:07:02 -03:00
d4d8e7d7f2 swizzle_search: reject unusable numeric arguments as usage errors 2026-11-21 23:48:32 -06:00
4db2a20db4 swizzle_search: a missing input is one ERROR line, not a traceback
main() opened the blob unguarded, so a path that does not exist, or any other
file I/O failure, escaped as a FileNotFoundError traceback and exited 1. Every
other tool in tools/ reports a missing input as one ERROR line and exits 2, and
#948 fixed the same thing in world_index.py; this was the last one left.

Read the blob inside a try/except OSError and name the file that failed. Nothing
is written before the input is read.

Test: tests/test_swizzle_search.py runs the CLI on a missing path and asserts
exit 2, the ERROR line naming it, and no traceback.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-21 23:17:20 -06:00
d3e073608a tests: skip the swizzle_search no-layout CLI test without numpy
test_preview_with_no_fitting_layout_reports_the_problem runs the tool,
which imports numpy before it parses its arguments, so without numpy the
test sees a ModuleNotFoundError traceback instead of "no layout" and
fails. Its neighbours that run the CLI already skip without numpy. CI's
Windows check job has no numpy, so this is its next failure once the
mem_diff one (#533) is fixed. The pytest wrapper of the same test skips
too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:41:56 +01:00
2df4c70f7a test(tools): add unit tests for swizzle_search permutation matching 2026-11-22 01:04:56 +01:00
73e1bf79bb swizzle_search.py: explain why an empty search cannot produce a preview 2026-11-22 00:23:40 +01:00