[PR #870] OLD-7536: navmesh_nodes: bound tally_tile grid insertion to occupied node cells #908

Open
opened 2026-11-26 20:19:27 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/870
Author: @narekshaghoyandev
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: ubiq-navmesh-nodes-bounded-grid-cells


📝 Commits (1)

  • 79a758e navmesh_nodes: bound tally_tile grid insertion to occupied node cells

📊 Changes

2 files changed (+28 additions, -3 deletions)

View changed files

📝 tests/test_navmesh_nodes.py (+13 -0)
📝 tools/navmesh_nodes.py (+15 -3)

📄 Description

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 @senyurah and Windows verification by @rideinstead), cleanly rebased onto main:

  • Bound tally_tile grid insertion to occupied node cells: Previously tally_tile inserted 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 finite ext (e.g. 1e10) to hang/OOM Python. Since polygon_under only ever queries the cells occupied by mine nodes, inserting only into (gx, gy) cells that actually hold a node in mine produces 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 on main hangs/OOMs on test_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)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/870 **Author:** [@narekshaghoyandev](https://github.com/narekshaghoyandev) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `ubiq-navmesh-nodes-bounded-grid-cells` --- ### 📝 Commits (1) - [`79a758e`](https://github.com/ubiquitarianism/leonida/commit/79a758ef9f203d1b75390757a127da493059e62c) navmesh_nodes: bound tally_tile grid insertion to occupied node cells ### 📊 Changes **2 files changed** (+28 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_navmesh_nodes.py` (+13 -0) 📝 `tools/navmesh_nodes.py` (+15 -3) </details> ### 📄 Description 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 `@senyurah` and Windows verification by `@rideinstead`), cleanly rebased onto `main`: - **Bound `tally_tile` grid insertion to occupied node cells**: Previously `tally_tile` inserted 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 finite `ext` (e.g. `1e10`) to hang/OOM Python. Since `polygon_under` only ever queries the cells occupied by `mine` nodes, inserting only into `(gx, gy)` cells that actually hold a node in `mine` produces 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 on `main` hangs/OOMs on `test_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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#908
No description provided.