Repository navigation
fix: cached paths skip the start cell and are no longer shared between maps (2.1.1) - #334
Merged
Merged
Conversation
…n maps (2.1.1) A fresh JPS path starts at the first step, but the entries cached along it started at the cell itself, so a cache hit made the walker spend a step on its own cell. The path caches were also static and keyed only by coordinates, so one map's path could be served on another map. Both caches are now keyed by grid too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
JumpPointSearchPathfinder.FindPathpath starts at the first step, butFindPathcachedpath.Skip(i)under(path[i], end), which starts at the cell itself. On a cache hit the walker spent a step standing on its own cell. Nowpath.Skip(i + 1).Cache(JPS) andBrushFirecache(goal-based) are static and were keyed only by coordinates. NosCore creates one pathfinder per map, so a path or brushfire from one map could be served on another. Both keys now include the grid. The static fields are kept, so this is a patch release.Needed by NosCoreIO/NosCore#2445, which drops the server's
.Skip(1)now that fresh paths are known to exclude the start.Test plan
dotnet test test/NosCore.PathFinder.Tests: 9/9🤖 Generated with Claude Code