Skip to content

Fix reach: prepass snapshots, ordered target iteration, mid-A* live checks#14

Open
Deathtanium wants to merge 7 commits into
masterfrom
cursor/reach-functionality-regression-adb7
Open

Fix reach: prepass snapshots, ordered target iteration, mid-A* live checks#14
Deathtanium wants to merge 7 commits into
masterfrom
cursor/reach-functionality-regression-adb7

Conversation

@Deathtanium
Copy link
Copy Markdown
Owner

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

  • New config: astar_mid_prepass_sanity_interval (default 4096; 0 disables).
  • On discrepancy vs snapshot: rerun prepass; if it succeeds, replace snapshot and continue; if it fails, enqueue the best open A node* as a partial path (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 reconstruction
  • PrepassBfsSnapshot, Node.partialPathApply, config
  • Pathfinder: snapshot build, mid-A* checks, partial enqueue, buildPath partial rewards
  • CommandToolbox.clamReach: ordered iteration + prepass per goal

Testing

./gradlew build

Open in Web Open in Cursor 

cursoragent and others added 7 commits April 7, 2026 13:49
…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>
@Deathtanium Deathtanium marked this pull request as ready for review April 7, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants