Skip to content

Reuse scalar query templates within each engine snapshot - #34

Merged
prrao87 merged 5 commits into
codex/issue-14-prerequisitesfrom
codex/issue-14-curated
Oct 26, 2026
Merged

prrao87 merged 5 commits into
codex/issue-14-prerequisitesfrom
codex/issue-14-curated

Conversation

@stugorf

@stugorf stugorf commented Oct 26, 2026

Copy link
Copy Markdown
Member

Problem and change

Issue14. Proposed branch codex/issue-14-curated at 74dd1e5d9ad680b79da40428e2f7e2cc18eb6671; actual comparison base codex/issue-14-prerequisites at 248def899cea569f57e44fa447ad9ccf5f8f5eab.

Repeated compatible scalar queries now reuse parsing, semantic analysis, graph logical planning and an unoptimized DataFusion logical template. Each execution binds its current values before optimization and physical planning. A bounded128-entry cache belongs to the engine snapshot; successful refresh creates a new cache and active readers retain the old snapshot. Concurrent executions keep parameter bindings separate.

Validation

Head 74dd1e5d9ad680b79da40428e2f7e2cc18eb6671; frozen parent 248def899cea569f57e44fa447ad9ccf5f8f5eab. Focused checks and regression details record commands, results, documentation and compatibility. The release receipt pins wheel/archive identity and 57 installed tests.

Both complete workloads pass unchanged goldens in memory and lazy modes. Retained first-pass geometric mean speedups are below (greater than one is faster). Per-query results and paired investigations remain in the audit archive.

Workload/mode Main Actual parent
Q30 memory 1.029 1.056
Q30 lazy 0.990 1.051
IC memory 1.015 0.999
IC lazy 1.042 1.012

Measurements use the same Apple M4 Max (16 cores, 128 GiB), macOS 26.6.2 arm64 and Python 3.13.17, with Q30 revision 6260689 and IC revision c185123. Reproduction instructions pin settings, data checksums, locks and commands. The frozen main baseline is code-identical to current main 90114f3; the equivalence check also verifies clean prospective main-target merges.

Individual review gates pass under the recorded repeat/controlled-investigation rules. Initial failed measurements remain intact in the audit record.

User impact

Each immutable snapshot keeps at most 128 unoptimized logical templates; parameters bind before optimization and refresh starts an empty cache. No public prepared-query API is added. Cache guides and examples are updated.

Review ledger · Current contribution guide

Audit archive: 47,675,190 bytes; SHA-256 b3486fb30a34639c830b5d49353b3838f96369f95df959ac35f85511f7f8b2de. The small current-main supplement preserves the documentation update. Original absolute paths in receipts map to included records through the archive index.

Submitted by David Hughes (@stugorf), with AI Collaboration.

Reuse unoptimized plans in the engine, binding fresh scalar values before optimization. Bound the cache to 128 templates and retain ordinary planning for containers and value-dependent output names. Include result, schema, refresh and concurrency regressions and scoped timing harnesses.

Part of #14. Isolated core Rust suite: 344 passed, 1 optional timing diagnostic ignored. Formatting, focused Ruff and strict docs passed. Python runtime, bridge test linking, benchmark and Clippy evidence remain pending.

Submitted by David Hughes (@stugorf), with AI Collaboration.
SKIP and LIMIT parameters determine graph plan shape, including chained WITH limits. Keep these queries on ordinary planning and document the boundary. Add a regression for every row-count scope.

Part of #14, dependent on #20. Submitted by David Hughes (@stugorf), with AI Collaboration.
Release the GIL during template lookup/build, cover repeated parameterized limits, and document exact local stage measurements and benchmark proof. Coordinated Python, benchmark and SF1 validation remain pending.

Part of #14. Submitted by David Hughes (@stugorf), with AI Collaboration.
Keep the existing refresh test array downcast in scope after sharing its real snapshot fixture with cache tests. Submitted by David Hughes (@stugorf), with AI Collaboration.
Source and runtime checks confirm literals and arithmetic already use the stable expr column name. Remove the unnecessary fallback and correct its regression expectation and docs. Fresh-versus-cached Arrow schema/result tests pass for unaliased scalar parameters.

Part of #14. Submitted by David Hughes (@stugorf), with AI Collaboration.
@prrao87
prrao87 marked this pull request as ready for review October 26, 2026 16:49
@prrao87
prrao87 merged commit a5fa13a into codex/issue-14-prerequisites Oct 26, 2026
8 checks passed
@prrao87
prrao87 deleted the codex/issue-14-curated branch October 26, 2026 16:52
@prrao87

prrao87 commented Oct 26, 2026

Copy link
Copy Markdown
Member

This change merged into an intermediate branch, not main. It reached main through #55, which brought in the final integrated version of this work with every original commit kept on its branch. Follow-up fixes from review are listed there.

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.

2 participants