Fix reach: prepass snapshots, ordered target iteration, mid-A* live checks#14
Open
Deathtanium wants to merge 7 commits into
Open
Fix reach: prepass snapshots, ordered target iteration, mid-A* live checks#14Deathtanium wants to merge 7 commits into
Deathtanium wants to merge 7 commits into
Conversation
…outes Enables reconstructing the heart-to-goal-adjacent BFS chain for staleness checks without re-running the search. Co-authored-by: Deathtanium <mishouro08@gmail.com>
Node.partialPathApply flags path apply that should skip goal rewards. Config: astar_mid_prepass_sanity_interval (default 4096, 0 disables). Co-authored-by: Deathtanium <mishouro08@gmail.com>
- tryBuildPrepassSnapshot captures ordered prepass cells + states - Periodic live vs snapshot comparison (same thread as A*); refresh prepass on drift; if refresh fails, enqueue best open node as partial path - Prepass failure no longer prunes seek caches; volatile map option only orders targets (no longer passed into calculatePath) - Partial apply: dig costs and container routing; no light/ore goal rewards (beacon still routes star without energy grant) Co-authored-by: Deathtanium <mishouro08@gmail.com>
Iterate ordered light/ore goals (merge by distance; material hunger prefers ores). Run prepass per candidate until one succeeds then call calculatePath with snapshot. Unreachable prepass leaves cache entries intact. Co-authored-by: Deathtanium <mishouro08@gmail.com>
- In SYNC_BATCHED, mid-A* prepass refresh runs as incremental BlockBfs steps, each debiting the same job tick budget (and total expansion cap) as A*. - Async mode still runs refresh BFS to completion inline on the worker. - Removed Node.partialPathApply; partial tip uses normal goal rewards (material hunger ores still credit material; others use fortune/container path). - Factored startPrepassBfs / completePrepassSnapshotFromBfs for reuse. Co-authored-by: Deathtanium <mishouro08@gmail.com>
…consume - Light energy/soul and beacon energy apply when breaking lights anywhere on the path. - Ores: material-hunger adds material on any break; else fortune+containers, including solid opaque ores that used to store only the block item. - removeSeekTargetConsumedFromCache removes broken light/ore positions from caches when in seek box and caches enabled (beacon counts as light for cache trim). Cache lifecycle (unchanged): rebuild after clamReSize/repair chains and wake; delta via block-change mixin; cleared on kill, long heart-chunk unload, and seekEphemeral refresh after unload expiry—dormant shells keep caches until unload/kill unless ice-thaw triggers wake rebuild. Co-authored-by: Deathtanium <mishouro08@gmail.com>
Co-authored-by: Deathtanium <mishouro08@gmail.com>
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
Implements the reach flow described in the issue: distance-ordered target caches (lights and ores separately, merged by Euclidean unless material hunger prioritizes ores), per-goal BFS prepass until one succeeds, snapshot of prepass route + block states for mid-search staleness detection, and configurable periodic live-world checks on the same thread as A* (sync batched = server thread, async = worker). Unreachable prepass does not remove entries from light/ore caches.
Mid-A* behavior
astar_mid_prepass_sanity_interval(default4096;0disables).Node.partialPathApply). Path apply uses normal stamina/dig rules but skips goal rewards (light energy/soul, ore material/fortune routing still runs for ores but without the material-hunger +1; beacon routes star without light energy).Volatile reach map (
clam_reachability_volatile_map)Still builds the flood for target ordering only (BFS depth then distance); it is no longer passed into
calculatePath, so A* reads the normal chunk cache/live world again.Commits
BlockBfs: parent chain + goal-adjacent cell for prepass reconstructionPrepassBfsSnapshot,Node.partialPathApply, configPathfinder: snapshot build, mid-A* checks, partial enqueue, buildPath partial rewardsCommandToolbox.clamReach: ordered iteration + prepass per goalTesting
./gradlew build