feat(pyxlog): expose canonical symbol registry - #286
Open
levi770 wants to merge 1 commit into
Open
Conversation
This was referenced Aug 30, 2026
levi770
force-pushed
the
codex/pyxlog-symbol-bridge
branch
from
August 31, 2026 19:26
e5ee140 to
247c10f
Compare
This was referenced Aug 31, 2026
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.
Context
LogicProgram declares symbol columns as physical u32 values at the DLPack boundary. XLOG already owns the process-wide symbol registry in xlog_core::symbol, but Pyxlog did not expose a supported way for an external consumer to encode strings before CUDA upload or decode query results afterward.
Without this boundary, consumers either cannot submit real symbol-valued relations or must reproduce private registry behavior outside XLOG. Mistaber's isolated production worker needs XLOG itself to own both directions of that conversion.
Change
Boundary and semantics
The returned IDs belong to the XLOG symbol registry in the current worker process. Consumers must intern input strings and resolve output IDs through the same isolated worker; this PR does not define a portable persisted-ID format and does not alter logical or CUDA execution semantics.
No CUDA kernel, evaluator, parser, or resolver behavior changes in this PR.
TDD evidence
The new runtime test was first run against Pyxlog 0.12.0 without this API and failed because intern_symbols and resolve_symbols were absent. After implementation, the branch wheel passed the focused runtime test.
Verification
Local checkout, commit 247c10f:
RunPod upmqk0ltyhijt6, NVIDIA RTX PRO 4500 Blackwell, CUDA 13.0, Python 3.12, Torch 2.9.1+cu130:
Observed:
{ "cuda_device": "NVIDIA RTX PRO 4500 Blackwell", "hot_loop_d2h_violations": 0, "hot_loop_stats": { "dtoh_bytes": 0, "dtoh_calls": 0, "htod_bytes": 0, "htod_calls": 0 }, "output_symbols": ["dairy", "meat", "neutral"], "query_relation_name": "__xlog_query_0", "rows": 3 }The zero-transfer statement above is scoped only to the measured post-upload evaluation hot loop. Final deterministic result export is outside that scope.
Stack topology
This PR is the root of the Pyxlog/runtime stack. Review and merge order is #286 -> #287 -> #288 -> #289.