Skip to content

feat(cli): export completed runtime relations as JSON - #289

Open
levi770 wants to merge 1 commit into
codex/pyxlog-host-row-bridgefrom
codex/runtime-materialization-evidence
Open

feat(cli): export completed runtime relations as JSON#289
levi770 wants to merge 1 commit into
codex/pyxlog-host-row-bridgefrom
codex/runtime-materialization-evidence

Conversation

@levi770

@levi770 levi770 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Context

Mistaber needs dynamic evidence from the exact XLOG run that reached fixpoint. xlog explain --format json is static source diagnostics and cannot establish which relation tuples were actually materialized. Treating static explain output as runtime proof would be unsound.

Changes

  • Adds xlog run --output json.
  • Adds repeatable --materialize-relation <name> selectors.
  • Evaluates through evaluate_with_relation_store_and_cache, preserving XLOG GPU evaluation as the sole source of truth.
  • Emits query rows and only the requested completed relation rows from the same runtime store.
  • Preserves all XLOG scalar types and resolves symbols fail-closed.
  • Canonically sorts rows and relation names and deduplicates repeated selectors.
  • Rejects missing relations, non-finite JSON floats, --materialize-relation without JSON, and --output-dir with JSON.
  • Labels the transfer boundary as post_fixpoint_d2h. This export is outside the resident evaluation hot loop and makes no ZERO TRANSFER claim for serialization.

The structured response schema is xlog.deterministic-run.v1 with execution_engine: xlog-gpu and fixpoint_state: complete.

Runtime semantics

The new route does not implement a host evaluator and does not infer tuples from source text. The CUDA evaluator runs to its normal completed fixpoint, constraints are enforced, and then selected GPU buffers are downloaded for external consumption. Full-store export currently follows the ordinary deterministic plan and fails through the existing capability boundary for unsupported epistemic full-store shapes.

Evidence

Authorized RunPod only: NVIDIA RTX PRO 4500 Blackwell, driver 580.167.08.

Exact commit 6cff2a21d2735fac9e81fd501aa8a7458db8a379, clean detached worktree:

XLOG_REQUIRE_CUDA=1 cargo test -p xlog-cli --test materialized_run_json -- --nocapture
4 passed; 0 failed

The same source content before commit was also checked with:

XLOG_REQUIRE_CUDA=1 cargo test -p xlog-cli --tests -- --nocapture
121 passed; 0 failed

cargo clippy -p xlog-gpu -p xlog-cli --all-targets -- -D warnings
Finished successfully

Coverage includes recursive derivation, source and derived materialization, all eight scalar types, deterministic selector ordering/deduplication, pre-CUDA mode rejection, unknown-relation failure, and the existing CLI run/explain/epistemic regression surface.

Consumer impact

This creates the dynamic materialization bridge required for Mistaber closure evidence. Consumers should verify schema_version, execution_engine, fixpoint_state, requested relation coverage, scalar types, and rows; they must not reinterpret static explain traces as dynamic proof.

Stack topology

This PR is the fourth layer of the Pyxlog/runtime stack. It depends on #288, which depends on #287 and #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