Skip to content

Share SQL stages and dispatch validated numerical kernels - #302

Draft
cromwellian wants to merge 3 commits into
xqlsystems:mainfrom
cromwellian:codex/shared-kernel-execution
Draft

cromwellian wants to merge 3 commits into
xqlsystems:mainfrom
cromwellian:codex/shared-kernel-execution

Conversation

@cromwellian

@cromwellian cromwellian commented Nov 2, 2026 •

Copy link
Copy Markdown

🛠️ Codex

Evaluate reachable shared CTEs once per invocation and reuse their stage programs while keeping ddx differentiation of the original SQL/views. Add session-local EinFold numerical dispatch for explicit float64 CPU or float32 MLX GPU execution, deterministic function eligibility, fresh physical state, ordered Arrow providers and bounded coordinate reuse. Ordinary SQL remains the fallback for unsupported semantics.

Depends on CPU setup/preparation #301 and EinFold’s kernel-backend PR. Incremental review: cromwellian/xarray-sql@codex/training-plan-reuse...codex/shared-kernel-execution . GitHub requires fork PRs to target upstream main, so the default diff includes the predecessor until it merges.

Measured tiny-model shared CPU/GPU warm steps improved 314→206 ms (1.53×) and 371→224 ms (1.66×), with fewer repeated kernel dispatches. GPU alone did not solve large-model backward/Arrow overhead. The separate compact-array and resident-training PRs address those remaining costs. The performance/evidence PR retains the detailed workloads and raw results.

The optional installer builds a pinned commit from the separate EinFold fork; native sources and patches are not duplicated here. Validation of the full contribution stack: 714 non-integration tests passed against rebuilt dependency wheels, including SQL masks/NULLs, custom-function overrides, changing inputs, coordinates and snapshots. Rust formatting and changed-file Ruff checks passed. GPU arithmetic remains explicit float32.

Ray and others added 3 commits November 1, 2026 23:24
Support prepared SQL gradients, arithmetic chunk-grid counts and direct Arrow registration. Preserve Context metadata through extension installation, expose target partitions and guard physical reuse against value-dependent filters.

Co-Authored-By: GPT-6 <noreply@openai.com>
Materialize shared reachable CTEs once, reuse stage programs with fresh physical state, and retain ddx differentiation of original views. Add optional session-local float64 CPU and float32 MLX kernel execution with SQL validation and fallback, using the separately maintained EinFold feature build.

Co-Authored-By: GPT-6 <noreply@openai.com>
Build the upstream-compatible feature commit from the contribution fork.

Co-Authored-By: GPT-6 <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
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