Repository navigation
Fix FlowField bounds and unreachable navigation vectors - #1488
Open
huxiaoyi-ovo wants to merge 6 commits into
Open
huxiaoyi-ovo wants to merge 6 commits into
huxiaoyi-ovo wants to merge 6 commits into
Conversation
huxiaoyi-ovo
marked this pull request as ready for review
October 30, 2026 09:07
Exercise every cell on an unpadded free grid and keep test formatting consistent. Co-authored-by: ChatGPT (OpenAI GPT-6) <noreply@openai.com>
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.
Summary
FlowFieldassumes every cell has valid neighbors in the 3×3 neighborhood. On unpadded maps, both integration-field propagation and direction assignment can index cells outside the grid and raiseKeyError.It also attempts to choose a navigation direction for goal-disconnected regions even though all reachable-cost values there are infinite. These cells should not point toward an arbitrary invalid neighbor.
Fix
integration_field(the traversable cells within map bounds).(None, None)to cells disconnected from the goal, allowing path following to terminate rather than follow an undefined direction.(None, None)termination marker after reaching the goal or encountering an unreachable cell.Regression tests
Added four focused cases:
Scope: two files; no new dependencies.
Validation: The four focused edge cases pass in an isolated local reproduction of the updated FlowField methods (4/4). Full cross-platform repository CI is still pending: the fork validation PR #11 has not produced Actions runs yet, and the upstream checks require maintainer action.
AI disclosure: ChatGPT assisted with code analysis, the fix, and regression tests.