Skip to content

feat(rust): opt-in in-process Rust graph queries for existing control room - #36

Closed
New1Direction wants to merge 14 commits into
mainfrom
feat/rust-inprocess-graph-backend
Closed

New1Direction wants to merge 14 commits into
mainfrom
feat/rust-inprocess-graph-backend

Conversation

@New1Direction

@New1Direction New1Direction commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Experimental Rust PyO3 alternative — NOT a default backend

Important update: PR #37 was merged to main while this branch was in development, and already provides opt-in Rust-backed local HTTP graph queries via a bounded, credential-scrubbed subprocess bridge. Do not merge this PR as a competing runtime path without deciding which architecture to retain.

This branch demonstrates a separate in-process Rust PyO3 adapter and an immutable native GraphIndex that can reuse a parsed graph across repeated view queries. The live Python HTTP server remains Python by default, and this branch is not deployed.

Existing verified results (before latest GraphIndex change)

  • Rust PyO3 ABI3 wheels compiled and worked on Python 3.11 and 3.13.
  • Python/native parity and actual Chrome local control-room tests passed.
  • End-to-end page query benchmark on 405-node graph: Python median ~0.27ms, uncached Rust extension ~4.3–4.5ms because it marshals the full state each request. Not faster.
  • Strict source evidence, no native credentials, no network or infrastructure writes.

Latest unverified addition

  • Frozen native GraphIndex class for amortizing JSON parsing and reuse across multiple queries, with parity tests and build + per-query benchmark.
  • Do not claim its CI is green until tests run on the latest head. It must be rebuilt on any source-state/observation/evaluation-time change.

Decision

Keep draft / do not merge until indexed native performance, cache invalidation semantics, and the overlap with merged PR #37 are resolved. This research should inform a single long-lived Rust graph runtime, not duplicate providers or game repository language percentages.

Lean 4 remains the verification layer. Bend 2 only on proven independent graph-kernel speedups.

Copy link
Copy Markdown
Owner Author

Closing during cleanup, as the owner asked. The subprocess bridge from #37 already gives opt-in Rust graph queries, and this branch's own benchmark shows the in-process path is slower (~4.3 ms vs ~0.27 ms in Python). The branch stays available if the indexed GraphIndex idea is picked up later.


Generated by Claude Code

@New1Direction
New1Direction deleted the feat/rust-inprocess-graph-backend branch October 28, 2026 16:00
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