OLD-9905: navmesh: rule out stream lengths as the 4 KiB boundary selector (ASSET-445) #1763
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1763"
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 ubiquitarianism/leonida. Originally posted by potatoe0100 on 2026-11-25T11:37:58Z.
Claimed in the coordination issue as: OLD-9905 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161295097)
What and why
Carries on old PR 9905 by @cdomergue (draft #170, branch
old-pr/9905, listed in #17), rebased on currentmainwith the author's commit kept.docs/navmesh.mdleft open what decidesu16@0x4e(storedpgor zero) on the 307 two-stream pages whose runtime data ends exactly on Stream 0's last 4 KiB boundary. The author's measurement rules out the obvious candidates: the ordered pair of inflated stream lengths, the 24-byte block map, and the distance fromdata_endto the end of Stream 0 all give both values. The doc now says so, with the steps to repeat it.tools/navmesh_decode.py --csvgains two columns,first_stream_bytesandruntime_data_end(the latter only when the block map check passes), which the repeat steps use;tests/test_navmesh_decode.pychecks them. The selection rule stays open.Tested
python -I tests/test_navmesh_decode.py: 17 tests OK. The othertests/test_navmesh*.pyand alltests/test_docs*.pypass (two navmesh tests skip without game files).python -m compileall -q make_game.py tools tests: clean. Python 3.13, Linux.GPUs tested: n/a (no GPU code)
AI-assisted: yes (Claude rebased and tested; the original commit says AI-assisted too)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by klikso on 2026-11-25T16:37:25Z.
Re-measured on a second copy, as the description says the page counts had not been: my own 1.0.2.1 (
navmeshes.rpf), this branch at04f3f5094, Windows 11, Python 3.13. I ranpython -I tools/navmesh_decode.py navmeshes.rpf --csv pages.csv(2 min 13 s; 9,6030drpresources, all complete) and followed the repeat steps in the new doc text.docs/navmesh.mdruntime_data_endpopulated, rounded up to 4 KiB =first_stream_bytes)pg/ store zero(first_stream_bytes, inflated - first_stream_bytes)pgdata_endto the end of Stream 0 with both valuesEvery number I could check matches. Not re-checked: that the two pages in the mixed group have the same 24-byte block map, and the 23 / 72 split of the 95 pages where all three tables start in Stream 1. The CSV doesn't carry either.
python -I tests/test_navmesh_decode.py: 17 tests OK.navmeshes.navmesh-decode.jsoninto the current folder. That file is tracked at the repository root, so running it from a checkout leaves a modified file. I restored it withgit checkout.Only counts and the one 16-byte difference are quoted here; the CSV stays on my machine.
AI-assisted: yes (Claude Code; run on the machine above)
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T18:32:33Z.
Reviewed
04f3f50: addsfirst_stream_bytes/runtime_data_endcolumns to navmesh_decode's CSV, updates the boundary measurement docs (93 pg vs 214 zero on the 307 pages) and pins the columns in tests. Ran tests/test_navmesh_decode.py: 17/17 OK on the PR; with the PR's test file copied onto main it fails at the first new assertion (KeyError), so the new tests are differential; neighbours navmesh_links/nodes/tile_obj/zero_span/report_paths/report_path_case all pass and compileall is clean. A probe on both trees confirms the summary stats and checks are identical to main (purely additive change) and the columns match the documented recipe (4096/776 boundary, empty for non-0drp and bad block maps). No finding. Two notes: a complete two-stream row with a failing block_map check is counted in the summary's pages_4k_boundary but gets no runtime_data_end, so the doc's CSV recipe would drop such rows (fine if block_map passes corpus-wide); and the 307/93/214 corpus counts are not re-verifiable without game files.AI-assisted review.
Recommendation: Merge
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:28:56Z.
Red/green: tests/test_navmesh_decode.py fails on main (KeyError: 'first_stream_bytes') and passes with the PR merged, on GitHub Actions Linux and natively on Windows.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
7daa4a4a5in GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)