Skip to content

Retain compact arrays across numerical SQL programs - #303

Draft
cromwellian wants to merge 5 commits into
xqlsystems:mainfrom
cromwellian:codex/compact-sql-execution
Draft

cromwellian wants to merge 5 commits into
xqlsystems:mainfrom
cromwellian:codex/compact-sql-execution

Conversation

@cromwellian

@cromwellian cromwellian commented Nov 2, 2026 •

Copy link
Copy Markdown

🛠️ Codex

Add DenseExecutor to retain compact numerical arrays across shared DataFusion/ddx SQL stages through EinFold's optional array-program module. Axis domains, row-presence and NULL masks remain explicit; joins become gathers/contractions and UNION reductions accumulate gradients. Ordinary calls import current inputs afresh and produce independent Arrow snapshots. Bounded intermediates and strict refusal preserve original SQL fallback before caller-visible mutation.

Depends on shared-kernel execution #302 and EinFold compact programs. Incremental review: cromwellian/xarray-sql@codex/shared-kernel-execution...codex/compact-sql-execution . The upstream fork PR's default diff includes predecessors until they merge.

Measured five-step 123.6M/context-16 training improved shared CPU 164.034→4.037 s (40.6×) and shared GPU 163.646→2.434 s (67.2×) per warm loss/update pair. GPU sampled RSS fell 40.0→17.91 GiB on that case. These use batch 1, tanh GELU, SGD and a padded 50,257-class vocabulary; they are separate from the real-character AdamW recipe. All losses/weight updates were checked against JAX outside the API timer. The complete performance/evidence report records first-use and full-context results and failed trials separately.

Full-stack validation: 714 non-integration tests passed on rebuilt ddx/EinFold wheels. Ordinary state still crosses the Arrow boundary; owned GPU state and whole-step compilation follow in the resident-training PR. No model/framework backward pass replaces ddx.

Ray and others added 5 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>
Lower supported DataFusion and ddx stages through EinFold compact programs, importing live inputs on each ordinary query and expanding coordinates only at Arrow snapshot boundaries. Bound computed intermediates, preserve row/NULL masks and retain conservative SQL fallback.

Co-Authored-By: GPT-6 <noreply@openai.com>
Keep the compact executor build reproducible without copying native or array-program sources into this repository.

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