Commit Graph

22 Commits

Author SHA1 Message Date
04f3f50941 Measure the 4 KiB boundary cases in navmesh directories
ASSET-445

AI-assisted: 6.2 Astra High
2026-11-25 11:15:54 +00: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
7bb0cdad05 Merge pull request #4096 from Marco Luzzaro
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:11:14 -05:00
40aaf73645 Merge pull request #3991 from bbareth
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:10:13 -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
886bc79a03 Report navmesh decoder output I/O failures 2026-11-23 00:25:41 +01:00
053b349c1e Protect navmesh carve manifests from JSON and CSV reports 2026-11-22 23:48:06 +01:00
5a57053e09 Merge pull request #3622 from Ewann
# Conflicts:
#	docs/navmesh.md
2026-11-22 17:03:03 -05:00
16ec4ee103 Merge pull request #3609 from eyyun 2026-11-22 17:02:59 -05:00
002cd455a3 navmesh_decode: keys_octree also requires one slot per key
Two occupied slots with the same key and distinct payload indices passed
values_bijective, then folded into one dict entry in _grid_slots, so the
octree check passed and the depth and leaf counts lost an entry
(reported by Oblyterium on #3622). Require len(keys) == entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:45:35 +01:00
63c566231b navmesh_decode: merge volume counters only after full tile validation 2026-11-23 00:15:31 +03:00
9be689c67f navmesh_decode: Band-3 grid keys are linear octree keys, inner nodes hold 0xff00 (ASSET-287)
--deep now checks that every grid key is a sentinel-bit octree key (root 1,
child = parent << 3 | octant, every parent present) and that every inner
node's u32 word is 0x0000ff00, and reports key depths, the inner-node count
and leaf words by low byte. docs/navmesh.md records the measured layout;
the x/y order of octant bits 0/1 and the leaf fields' meaning stay open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:08:13 +01:00
f0a6adb034 tools: decode navmesh +0xB8 paired obstacle footprint records (ASSET-281) 2026-11-23 00:05:42 +03:00
3e105eba3a navmesh_decode, navmesh_index: a --out that is a folder is a usage error
Both tools validate --out and --csv against the input (they must not overwrite
it) but never against the filesystem object itself, so pointing --out at an
existing directory opened it for writing and ended the run in a
PermissionError traceback after the scan was already done:

    Traceback (most recent call last):
      ...
    PermissionError: [Errno 13] Permission denied: '../reports'

Refuse it up front with the flag name, like the neighbouring checks do, so it
costs one line and the scan never starts.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 14:09:43 -06:00
7e16d3ad03 fix(tools): protect carved navmesh inputs from report writes
The archive guard cannot see individual inputs in a carved directory. Use the same file selection for scanning and report validation so an output cannot replace a carved stream under either name.
2026-11-22 16:43:52 +01:00
ab6b7ac8ed navmesh_decode: --limit carver counts match navmesh_index
A stream that starts inside a --limit window but ends past it was counted in carver_streams with
all its stored bytes, so stored + zero_padding + unread could exceed the span (up to 122% on a
2 MiB window of navmeshes.rpf). navmesh_index.py (#766) does not count such a stream; its bytes
inside the window are left to the tail. navmesh_decode now does the same and reports those
streams under past_window / past_window_stored instead of dropping them. Decoding is unchanged: a
resource that starts inside the window is still read to its end.

Real data (counts only), four 2 MiB windows of navmeshes.rpf: byte classes now add up to exactly
the span (main: 121.97%, 119.01%, 100.23%, 103.64%), and streams, stored, inflated, zero_padding
and unread equal navmesh_index.py's on every window.

Tests: the window-limit test now expects 1 carved stream + 1 past_window (main: 2); a new test
ends the window inside a stream and checks nothing is carved and the classes sum to the span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:29:13 -03:00
a3f0d910f1 navmesh_decode: refuse a report path that is the input
`--out <the archive>` (and `--csv <the archive>`) opened the input for
writing after the scan and replaced it with the JSON summary, exit 0, no
warning. Refuse the combination up front, as the --out/--csv collision
already is, so the archive is never touched.
2026-11-22 03:37:40 -06:00
fe953bf831 navmesh_decode: create the --out and --csv folders instead of losing the run
The scan finished, then a report path in a folder that did not exist ended
the run in a FileNotFoundError traceback and threw away the summary. Create
the parent folder at write time, as navmesh_index.py already does.
2026-11-22 03:22:14 -06:00
9f3ec1ab46 navmesh_decode: reject colliding JSON and CSV reports 2026-11-22 05:04:30 -03:00
36e63f11dc navmesh_decode.py: a header-only PSIN doesn't take the next stream (review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:41:11 +01:00
6c8337c4f9 navmesh_decode.py: a PSIN header with no section is incomplete
_psin_state() walked the section list and reported a resource complete when
the walk ended exactly at the end of the data. A PSIN header with no section
at all ends there too, so it was counted complete with 0 sections. At least
one section is now required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:29:25 +01:00
2a41e7a44c Navmesh: decode 0DRP cover-point pages, 0x00010015 tiles and Band-3 grids (ASSET-22) 2026-11-21 22:03:23 -03:00