Skip to content

feat(experimental): add deterministic GPU graph shortest paths - #2942

Merged
ibgreen-openai merged 1 commit into
masterfrom
codex/lugraph-breadth-first-search
Aug 6, 2026
Merged

feat(experimental): add deterministic GPU graph shortest paths#2942
ibgreen-openai merged 1 commit into
masterfrom
codex/lugraph-breadth-first-search

Conversation

@ibgreen-openai

@ibgreen-openai ibgreen-openai commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Goals

Changes

  • Add LuGraphBreadthFirstSearch, LuGraphBreadthFirstSearchProps, and directional traversal types exclusively to @luma.gl/experimental/lugraph.
  • Compute bounded BFS distances and deterministic lowest-stable-vertex-ID predecessors directly from caller-owned CSR adjacency using integer atomicMin and explicit per-depth GPU passes.
  • Preserve arbitrarily chunked multi-seed vectors, invalid/duplicate seed handling, directed outgoing/incoming/bidirectional traversal, undirected deduplication, and a 1,024-hop compile-time ceiling.
  • Support optional GPU-resident active seed counts and active depth controls that change between encodings without recompilation.
  • Publish an optional source-aligned zero/one reachability mask; roots and unreachable predecessors use the explicit 0xffffffff sentinel.
  • Fail closed when any required adjacency overflow flag is set: all distances/predecessors remain unreachable and masks remain clear.
  • Avoid frontier/transient allocations by expanding only vertices whose current atomic distance equals the active hop.
  • Use bounded three-dimensional dispatch for every seed and vertex pass while remaining within the portable eight-storage-binding limit.
  • Reject physically aliased outputs and preserve all caller-owned source chunks/buffers without concatenation, readback, submission, or destruction.
  • Add 63 focused Node contracts and 25 real-WebGPU CPU-oracle scenarios covering deterministic diamond ties, dynamic chunked controls, reverse/both directions, overflow matrices, byte offsets, repeated encoding, and actual [2,2,2] dispatch.

Verification

  • nvm use: passed (Node v22.22.1).
  • yarn install: attempted normally and with escalation; configured registry denies unavailable dependencies with HTTP 403. Verification uses an isolated APFS-cloned compatible dependency tree and ignored Yarn state with no package or lockfile changes.
  • yarn lint fix: passed (1,540 files).
  • Final yarn build: passed across every workspace after final code and formatting changes.
  • Focused Node BFS tests: 63 passed.
  • Focused real Chromium/WebGPU BFS tests: 25 passed.
  • Complete CI=1 yarn test: 707 Node tests and 1,607 real Chromium/WebGPU tests passed; existing skips only.
  • yarn website:build: passed.
  • (cd website && yarn build): passed.
  • yarn examples:typecheck: all 46 example workspaces passed.
  • yarn bundle-size: all seven bundle-size budgets passed.
  • Built ESM and CommonJS package-subpath smoke checks: passed; LuGraphBreadthFirstSearch remains absent from the experimental root.
  • Normal commit hooks: lint and all 707 Node tests passed.

Risks and follow-up

  • Each compiled hop scans all vertices; the existing 1,024-hop ceiling prevents unbounded graph recording, while no CPU-side convergence polling occurs.
  • Truncated adjacency deliberately publishes no partial traversal; the topology overflow flag remains GPU-resident and caller-visible.
  • Deterministic predecessors choose the numerically smallest stable parent vertex ID among equal-length paths.
  • Stacked on feat(experimental): compute GPU-resident vertex degrees #2940; target codex/lugraph-degree-metrics until prerequisites land.

@ibgreen-openai
ibgreen-openai marked this pull request as ready for review August 5, 2026 01:22
@ibgreen-openai
ibgreen-openai force-pushed the codex/lugraph-degree-metrics branch from c603aa9 to b349cb0 Compare August 6, 2026 00:28
Base automatically changed from codex/lugraph-degree-metrics to master August 6, 2026 01:16
@ibgreen-openai
ibgreen-openai force-pushed the codex/lugraph-breadth-first-search branch from d04afa1 to 4e68a80 Compare August 6, 2026 13:57
@ibgreen-openai
ibgreen-openai merged commit 6c7c944 into master Aug 6, 2026
5 of 6 checks passed
@ibgreen-openai
ibgreen-openai deleted the codex/lugraph-breadth-first-search branch August 6, 2026 14:02
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