Skip to content

refactor: move the plan layer of the Python bindings into sqlbuild-python-planner - #1523

Merged
kvlonge merged 7 commits into
mainfrom
refactor/python-planner
Nov 16, 2026
Merged

kvlonge merged 7 commits into
mainfrom
refactor/python-planner

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Why

sqlbuild-python is still over the crate size limit. This slice moves the plan layer into its own crate.

Changes

  • New crate sqlbuild-python-planner, above sqlbuild-python-project, holds the planner areas (entries, phases, changes, migrations, resolution, scenarios, strategy, warehouse) plus freshness, consumption, microbatches, observations, lifecycle events and plan output. Old paths are deleted and callers updated; there are no re-exports.
  • Planner scope resolution moves down into sqlbuild-python-project and the cost context into sqlbuild-python-front, so the plan layer depends only downward.
  • main/ entries hold the bodies they forwarded to; 39 still forward because their bodies are over the entry size budgets. Imports are regrouped where the source grouped them.
  • fensu: the sqlbuild-python cap drops to 115,238 code lines; XSB072/XSB073 budgets are re-keyed with unchanged totals. [dupes] entries cover clusters main already had whose members moved. The native field fallback list follows the moved read sites.

Code-line growth of the sqlbuild-python* crates:

before fold after
this PR vs main +3,373 +2,080
main/ entry functions +1,672 +3,318
use lines +1,279 +1,110
mod lines +334 +334
other item code +87 -2,672

The fold adds 245 main/ entry files, each with its own signature, use and mod lines.

No DuckShop case: this is a behaviour-neutral Rust move with no new project shape, value or lifecycle.

Verification

  • The _native surface is identical to main's build.
  • A dense 3,000-model compile gives identical JSON and identical files (11,175) to main.
  • Dense timing vs main, 7 alternating runs: cold 8.25→7.98 s wall, warm 0.54 s both, edit 1.60→1.63 s.
  • make check-ci passed; after merging main, fensu and clippy pass. make test: 12,297 passed; the 14 failures need Docker or an installed sqb, or are interrupt timings that pass alone, as on main.

…e plan layer

The plan layer moves into its own crate next. Two pieces it uses sat in
sqlbuild-python although their layer is lower: the planner scope
resolution (project layer) and the cost attribution context (front
layer). They now live in sqlbuild-python-project and
sqlbuild-python-front, and their callers import them from there.
…thon-planner

Work in progress: the move itself. main/ forwarders are not folded yet,
and the field-fallback list, duplicate allowlist and crate README are
not updated.
@kvlonge
kvlonge enabled auto-merge November 16, 2026 19:34
@kvlonge
kvlonge added this pull request to the merge queue Nov 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 16, 2026
# Conflicts:
#	crates/sqlbuild-python/src/bindings/_helpers/build_command/command.rs
#	crates/sqlbuild-python/src/bindings/_helpers/build_command/execution.rs
#	crates/sqlbuild-python/src/bindings/_helpers/sql_test_command/test_command.rs
#	fensu.toml
@kvlonge
kvlonge enabled auto-merge November 16, 2026 20:34
@kvlonge
kvlonge added this pull request to the merge queue Nov 16, 2026
@kvlonge
kvlonge removed this pull request from the merge queue due to a manual request Nov 16, 2026
@kvlonge
kvlonge added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit e350e72 Nov 16, 2026
33 checks passed
@kvlonge
kvlonge deleted the refactor/python-planner branch November 16, 2026 21:52
kvlonge added a commit that referenced this pull request Nov 17, 2026
Moves the plan layer from the bindings crate into the new
sqlbuild-python-planner crate, as the slice did, keeping the
large-project tree's behaviour.

Where the large-project tree had modules the slice never saw:
- the planner warehouse reads, synced reads and plan timings moved into
  the planner crate (planner_warehouse and planner_phases);
- the live warehouse reads moved into their own planner-crate module,
  live_reads, outside the planner paths XSB080 guards, as native_host
  kept them before;
- the rayon compile pool moved to sqlbuild-python-base native_threads.
fensu.toml keeps the tree's XSB079 and XSB080 entries at their new paths.

Validation: cargo check --workspace --all-targets passes with no
warnings, and the layout matches the slice. Nothing is built or tested
yet. fensu reports 346 faults (287 after the previous slice); the new
ones are path-keyed budgets, layout and visibility faults for the final
pass.
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