Repository navigation
Conversation
Reject invalid numeric cell coordinates before they alias valid storage. Preserve existing flattened-index checks and None behavior.
Cover invalid numeric coordinates, row-major storage, and expansion without cross-edge aliasing.
Explain per-axis cell bounds and clipping expanded neighbors at map edges.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference issue
No matching issue or competing fix found for GridMap's per-axis index bounds. The open polygon comparison change in #1350 touches a different operation.
What does this implement/fix?
GridMap currently checks only the flattened storage index. This permits invalid x/y cell coordinates to alias a valid cell: for a 3-column, 2-row grid, writing to
(3, 0)changes(0, 1), and reading(-1, 1)reads(2, 0). Neighbor updates inexpand_gridcan consequently mark cells across the opposite edge of the map.Check each numeric cell index against its own axis bounds in the cell-value getter and setter, in addition to the existing flattened storage bounds. Out-of-bounds reads return the documented
None, occupancy checks therefore treat them as occupied, and rejected writes returnFalsewithout changing storage. Existing behavior forNoneinputs is unchanged.No parameter, dependency, animation, or CI configuration changes. Separate position-conversion and polygon issues are outside this fix.
Additional information
Linux / Python 3.14.8, with the repository-pinned runtime and development requirements and BLAS/OMP threads limited to one:
git diff --check: passed.bash runtests.sh: 169 passed in 158.40s, including changed-file Ruff, all configured mypy checks, and warnings as errors.make htmlwith-W -E -a(warnings as errors and full rebuild): passed. Generated boundary paragraph and parent navigation link verified. The pinned IPython emits its existing Python 3.14 SyntaxWarning during import.AI assistance was used for implementation and test preparation; no human review is claimed.
CheckList