Skip to content

feat(pathfinder): prepare and publish endpoint batches in explicit phases - #64

Draft
apotema wants to merge 2 commits into
feat/serial-endpoint-preparationfrom
feat/endpoint-preparation-phase
Draft

apotema wants to merge 2 commits into
feat/serial-endpoint-preparationfrom
feat/endpoint-preparation-phase

Conversation

@apotema

@apotema apotema commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

The rotating selector now feeds a serial controller preparation phase. It snapshots the selected entities after movement, computes their nearest nodes, and publishes CMNs only at an explicit barrier. Moving an entity/ancestor, replacing the graph, destroying an entity or replacing the controller before publication rejects obsolete results. Completed off-graph results stay completed until their inputs change.

Stacked on #63 and requires the position revision API from labelle-toolkit/labelle-engine#916. Preparation is opt-in; no gameplay distance query is migrated or enabled by this PR.

  • Graph-input validation detects node movement, stairs and authored-link edits even when node count is unchanged; the next advance rebuilds when needed. MovementNode entities are excluded from ordinary CMN preparation.
  • Epoch invalidation retains old CMNs for debugging after opt-in. Legacy targetPosition cannot reuse stale/off-graph debugging records as a live navigation cache.
  • Allocation failures expose no partial batch. Explicit cancellation leaves the cursor unchanged; processed but discarded stale results consume their turn. Scratch capacity is retained, and stats report discovery, pending entries, selection, searches and publication outcomes.
  • CI now covers stacked PRs and runs the new integration suite against the exact engine#916 commit. Published library dependencies remain unchanged; the test-only build owns the engine dependency.

Validation: 13 unit tests, 81 navigation specs, 13 new controller/engine integration tests, and all 20 Flying Platform test targets passed locally. Integration tests use the actual engine/controller with the engine's headless ECS backend. They cover the publication boundary, ancestor movement, fairness, cancellation, two allocation-failure stages, world/controller replacement, graph changes, destruction, node zero and off-graph completion.

Remaining before rollout: generation-qualified read-only entity queries, remaining legacy CMN writers/known-node updates, raw mutation and participant audits, the game's preparation driver and query/retry migration. Discovery and graph validation are not bounded by the search budget; no default budget, threading, WASM measurement or FPS claim is included. See rfc/prepared-endpoint-implementation.md and tests/integration/README.md.

WASM review fix: reproduced the unsupported u64 atomic in the real controller lifecycle, then replaced it with a simulation-thread-owned u64 identity counter. Controller construction/destruction remain simulation-thread operations; future workers consume snapshots. Added zig build wasm-check and a CI step targeting wasm32 with atomics enabled, without requiring Emscripten. The check fails before the fix and passes afterward. Native unit/spec and engine integration tests pass. This fixes the reported compiler blocker; it is not a full web build or performance measurement.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

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.

1 participant