Skip to content

Prepare shared native row execution once for anchor batches - #281

Open
Victsm wants to merge 2 commits into
codex/shared-scalar-ir-20261110from
codex/prepared-scalar-execution-20261110
Open

Victsm wants to merge 2 commits into
codex/shared-scalar-ir-20261110from
codex/prepared-scalar-execution-20261110

Conversation

@Victsm

@Victsm Victsm commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Move reusable row/window/group execution below PyO3 and prepare its relation handles, projections, compatible window groups and numeric operations once. Subsequent chunks pass only anchor IDs/cutoffs, without reconstructing DGTTPlan or converting it through another JSON aggregate program. Most of the large native diff relocates the existing temporal evaluator; Python bindings retain conversion/iterator glue. Native anchor/history hooks are consumed by the following slice.

Stack slice 3/5. Targets the preceding stack branch; merge in dependency order.

Change map

#281 (comment)

Testing

Matching release native build; 567 bounded native compiler/clock/aggregate/custom-TT/iterator tests passed. The native source inputs match the verified combined build.

Dependency order: #279 → #280 → #281 → #282 → #283.

@Victsm

Victsm commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

Change map

User-requested aggregation consolidation, slice 3/5.

Observed requirement and smallest sufficient change: Move reusable row/window/group execution below PyO3 and prepare its relation handles, projections, compatible window groups and numeric operations once. Subsequent chunks pass only anchor IDs/cutoffs, without reconstructing DGTTPlan or converting it through another JSON aggregate program. Most of the large native diff relocates the existing temporal evaluator; Python bindings retain conversion/iterator glue. Native anchor/history hooks are consumed by the following slice.

Focused verification / stopping condition: Matching release native build; 567 bounded native compiler/clock/aggregate/custom-TT/iterator tests passed. The native source inputs match the verified combined build. Stop at this slice’s verified behavior; fitting redesign, new temporal/LP capabilities and live sweeps are separate.

File Function / scope What changed Why
packages/diskgraph/Cargo.lock Workspace dependency graph Record the train-table crate dependency edges Share execution below PyO3 without introducing dependency-version upgrades
packages/diskgraph/diskgraph-pybind/README.md API and workflow documentation Describe supported routes, preparation boundaries and explicit limitations Keep usage and performance claims aligned with the implementation
packages/diskgraph/diskgraph-pybind/python/diskgraph/__init__.py Native helper exports Export explicit-file custom-TT batch reading Make the shared reader available to materialization callers
packages/diskgraph/diskgraph-pybind/python/tests/test_aggregate_program.py Focused regression coverage Verify numerical, clock, identity, lifecycle or route behavior of this slice Catch wrong answers and unintended fallback/reconstruction, not merely successful calls
packages/diskgraph/diskgraph-pybind/python/tests/test_native_event_merge.py Focused regression coverage Verify numerical, clock, identity, lifecycle or route behavior of this slice Catch wrong answers and unintended fallback/reconstruction, not merely successful calls
packages/diskgraph/diskgraph-pybind/python/tests/test_temporal_sequence_limit.py Focused regression coverage Verify numerical, clock, identity, lifecycle or route behavior of this slice Catch wrong answers and unintended fallback/reconstruction, not merely successful calls
packages/diskgraph/diskgraph-pybind/src/lib.rs SamplerEngine / PreparedAggregateQuery bindings Expose shared scalar preparation/execution and register native helpers Bind prepared state to its owning index/pool and pass only chunk data later
packages/diskgraph/diskgraph-pybind/src/runtime_batch_iterator.rs Native runtime iteration / history result batches Carry anchor columns and history/component results through native iteration Avoid Python batch-to-anchor-to-batch reconstruction
packages/diskgraph/diskgraph-pybind/src/temporal_query.rs Temporal query evaluation / Python conversion Reuse native execution and retain thin Python conversion/merge glue Share row/reduction work without making TT depend on PyO3
packages/diskgraph/diskgraph-pybind/src/token_stream.rs event_stream_order visibility Expose the existing native component-order helper inside the crate Merge components before returning iterator results to Python
packages/diskgraph/diskgraph-pybind/src/tt_builder.rs Python TT builder serialization Keep the established PQL plan format and inline enum representation Existing compiler/forecasting readers remain compatible after the larger shared IR variant
packages/diskgraph/diskgraph-pybind/src/tt_executor.rs Custom-TT source reader binding Expose the existing projected reader for explicit input files Reuse reading/scheduling without inventing an epoch for precomputation
packages/diskgraph/diskgraph-pybind/src/tt_executor/tests.rs Focused regression coverage Verify numerical, clock, identity, lifecycle or route behavior of this slice Catch wrong answers and unintended fallback/reconstruction, not merely successful calls
packages/diskgraph/diskgraph-train-table/Cargo.toml Train-table dependencies Reuse existing workspace engine/Arrow/regex crates The shared executor must not depend on Python bindings
packages/diskgraph/diskgraph-train-table/src/batch_aggregate.rs PreparedAggregatePlan / prepared frames / shared execution Relocate the native evaluator; prepare common operations and shared windows once Remove per-chunk plan rebuilding/reparsing while retaining projection/window reuse
packages/diskgraph/diskgraph-train-table/src/custom_tt_chunk_processor.rs Projected custom-TT input reader Accept an explicit source file with selected columns Reuse bounded Parquet reading outside published-TT discovery
packages/diskgraph/diskgraph-train-table/src/lib.rs Component integration Connect the shared plan/execution contract Preserve the existing caller boundary
packages/diskgraph/diskgraph-train-table/tests/ttgen_e2e.rs Focused regression coverage Verify numerical, clock, identity, lifecycle or route behavior of this slice Catch wrong answers and unintended fallback/reconstruction, not merely successful calls
packages/diskgraph/third_party/artifact-manifest.json Generated license input Refresh Cargo.lock SHA using the checked-in generator Keep licensing metadata bound to the actual lockfile

Verified repair — 2026-11-11

Head: b59d2994f5f7a62170e229b1ccf410f3bbc27f57. Regenerated the DiskGraph artifact lock hash using the checked-in generator; the notice inventory and THIRD-PARTY output remain unchanged.

Validation: repaired combined stack passed 146 Rust TT integration tests and 579 Python native/conformance tests with a freshly rebuilt extension. Public Python suite: 1,951 passed; optional-native import checks: two modules skipped as expected without DiskGraph. Generated artifact manifest and 403-component notice checks passed. No live sweeps or merges.

@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@Victsm
Victsm force-pushed the codex/prepared-scalar-execution-20261110 branch from eccadec to b59d299 Compare November 11, 2026 03:47
@Victsm
Victsm force-pushed the codex/shared-scalar-ir-20261110 branch from e27f36a to 3ea9810 Compare November 11, 2026 03:47
@Victsm
Victsm had a problem deploying to gha-kumo-workflow-tests November 11, 2026 03:47 — with GitHub Actions Error
@Victsm
Victsm deployed to gha-kumo-workflow-tests November 11, 2026 03:47 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
gha-kumo-workflow-tests — b59d2994 Deployed Nov 11, 2026 by Victsm via import #2041
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