OLD-7536: navmesh_nodes: bound tally_tile grid insertion to occupied node cells #870
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/870"
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 narekshaghoyandev on 2026-11-24T14:51:46Z.
Reopening my original upstream PR #7536 (previously approved by
@leoleahy, verified bit-exact across all 63,806 retail nodes and 27,644 retail navmesh resources by@Kev-Ball, plus 300-tile differential equivalence by@senyurahand Windows verification by@rideinstead), cleanly rebased ontomain:tally_tilegrid insertion to occupied node cells: Previouslytally_tileinserted every polygon into every(gx, gy)cell across its full[floor(min_x/CELL)..floor(max_x/CELL)] x [floor(min_y/CELL)..floor(max_y/CELL)]bounding box, allowing a single crafted tile with large finiteext(e.g.1e10) to hang/OOM Python. Sincepolygon_underonly ever queries the cells occupied byminenodes, inserting only into(gx, gy)cells that actually hold a node inmineproduces 100% identical tallies in bounded time and memory.Verification
python3 -I tests/test_navmesh_nodes.py -v: 18/18 pass in 0.66s (negative control onmainhangs/OOMs ontest_huge_finite_extent_does_not_exhaust_grid_memory).python3 -I scripts/check_no_game_data.py tools/navmesh_nodes.py tests/test_navmesh_nodes.py: clean.python3 -m compileall -q tools/navmesh_nodes.py tests/test_navmesh_nodes.py: clean.Claimed in the coordination issue as: OLD-7536 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135050591)
AI-assisted: yes (Gemini)
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:55:53Z.
Review: APPROVED
Audited and verified. Bounds polygon grid insertion in ools/navmesh_nodes.py:tally_tile to
eeded_cells occupied by nodes in the tile, switching iteration strategies based on bounding box cardinality to prevent out-of-memory loops on corrupt tiles with large float extents. Unit tests in ests/test_navmesh_nodes.py pass cleanly. Approved.
Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T03:57:11Z.
Review: APPROVED
Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Only cells occupied by this tile's nodes are ever queried, so inserting into those alone keeps the same lookups while a damaged tile with a huge finite extent no longer tries to build billions of grid entries.
AI-assisted (Claude).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:26:27Z.
Red/green: tests/test_navmesh_nodes.py is killed with rc 137 on main by the huge-extent tile and passes with the PR merged, on GitHub Actions Linux.
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)