Skip to content

feat(pyxlog): compile resolved module entrypoints - #287

Open
levi770 wants to merge 1 commit into
codex/pyxlog-symbol-bridgefrom
codex/pyxlog-file-compile
Open

feat(pyxlog): compile resolved module entrypoints#287
levi770 wants to merge 1 commit into
codex/pyxlog-symbol-bridgefrom
codex/pyxlog-file-compile

Conversation

@levi770

@levi770 levi770 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Context

Mistaber production Pyxlog integration must execute the same XLOG frontend and module resolver as the CLI route. The existing Python binding only accepted one source string, which would force consumers to concatenate modules and thereby bypass canonical import resolution, source identity, and normal compiler ownership.

This is a stacked PR on #286 because the downstream production worker also needs the symbol registry bridge introduced there.

Changes

  • add LogicProgram::compile_file(entry_file, search_paths) in xlog-gpu
  • resolve the entrypoint with xlog_logic::compile::load_modules
  • merge imports through the canonical resolver AST and compile through the existing compiler
  • expose LogicProgram.compile_file(entrypoint, module_paths, device, memory_mb) in Pyxlog
  • share compiled-provider construction between string and file entrypoints
  • keep pre-parse memory_mb > 0 validation
  • add PathLike-aware type stubs
  • add a transitive main -> rules -> facts CUDA integration test

No consumer-side concatenation or alternate parser is introduced.

TDD evidence

Before implementation, the new integration test failed with:

AttributeError: LogicProgram has no attribute compile_file

After implementation, the focused test resolves all three modules, compiles the canonical merged program, evaluates it on CUDA, and returns the expected query value.

Verification

Local checkout at 6e9fca079b882fdf3cb8d53ed9c3d73eeb7afc70:

  • cargo fmt --all -- --check
  • cargo check -p pyxlog --locked
  • Python syntax compilation
  • Ruff
  • git diff --check

All passed.

Exact-commit GPU verification was performed on the authorized Mistaber RunPod host:

  • GPU: NVIDIA RTX PRO 4500 Blackwell, 32 GB
  • driver: 580.167.08
  • CUDA: 13.0
  • fresh remote clone of codex/pyxlog-file-compile
  • confirmed HEAD: 6e9fca079b882fdf3cb8d53ed9c3d73eeb7afc70
  • built release CPython 3.12 wheel from that checkout
  • force-installed the wheel
  • ran with XLOG_REQUIRE_CUDA=1:
    • python/tests/test_pyxlog_compile_file.py
    • python/tests/test_pyxlog_symbol_registry.py

Result: 3 passed in 1.21s.

Scope and dependency

  • depends on feat(pyxlog): expose canonical symbol registry #286
  • this PR adds the canonical file/module compilation surface only
  • production subprocess isolation, Mistaber protocol framing, full-route parity, and hot-loop transfer qualification remain downstream Mistaber work
  • this PR makes no standalone ZERO TRANSFER claim

Stack topology

This PR is the second layer of the Pyxlog/runtime stack. It depends on #286; review and merge order is #286 -> #287 -> #288 -> #289.

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