17 Commits
Author SHA1 Message Date
aiongg 722cb812ef Split scripts: whole use trees in the trait check, re-exported traits through globs, inner attributes nest, mod.rs unit names, inline modules named from other files, assigned .ok() results count (review on #16587) 2026-11-24 02:41:56 +00:00
aiongg 4653c2a2a3 Engine split scripts: step 8 crate map, review fixes, move_tests appends and copies only what moved tests use
crates.tsv: the vector cut moves 13 command modules; the 11 shared engines
(float, frame, slice, symmetry, transform, type, type_extra, type_spell, warp,
smart, vector) map to model and stay in core until step 12; notes'
stored-values tests move with notes.

engine_cut.py: super:: paths are rewritten only at a moved file's own depth;
trait imports are added per module scope; import names come from whole use
trees; branch moves TABLES entries into the crate's install.rs before removing
them from core and finishes the moved files at their new paths; a widened name
keeps its use statement's cfg; single-name groups widen as whole imports;
re-exports from lib.rs resolve from the crate root.

move_tests.py: an existing target module gets the new tests appended (in a
module of their own when a name would clash or the file is organised by
source file); helpers are copied as written, and only those the moved tests
name unqualified; trait imports stay only when a method of the trait is
called; path rewrites skip string literals; ci-test-times remaps only this
run's tests, without duplicate rows; list reads the crate's spec functions for
its ids, ignores ids whose result is dropped, and lists test functions at the
top of production files, which move without their production siblings;
test-module parents are found inside inline modules; cleanup touches only the
modules the move emptied and keeps those other code names; --previous needs
--old-ref.

install_tables.py matches a table's full module path to its crate;
table_fragments.py reports a branch-added entry whose handler is in a crate the
predecessor's fragment can't reach.
2026-11-23 22:41:12 +00:00
aiongg a7fd5975a5 Engine split step 7: core tests that run paint commands move to the top crate's tests/it (move_tests.py and its output) 2026-11-23 15:06:31 +00:00
aiongg 850e73c5fb Engine split step 7: the paint crate (installs per crate, registry order from command_ids.txt, helpers moved down, paint-only helpers moved up, live-stroke traits, admit hook, tooling) 2026-11-23 14:16:34 +00:00
aiongg 1086d71fd9 Engine split step 7: engine_cut.py and its paint split (paint modules to crates/engine-paint/src) 2026-11-23 14:06:43 +00:00
aiongg ec81d5e5b3 Engine split scripts: only crate roots and mod.rs hold children beside them; children of a cfg(test) inline module are test code 2026-11-23 05:25:57 +00:00
aiongg 5cc65b5b6a Engine split scripts: imports keep their attributes; module paths from crate roots and inline #[path]
add_import inserts before the first import's outer attributes and after multi-line inner
attributes; fix mode moves inline-module offsets past the edits it applied above them.
module_file resolves a crate root's children beside it whatever the file's name, and
inline_mods takes an enclosing module's #[path] as its directory.
2026-11-23 04:44:15 +00:00
aiongg 62263bc7b8 Engine split step 6: rewrite only files a crate target compiles
compiled_files walks each crate's targets (standard paths and Cargo.toml target paths) through
mod lines, inline modules included. tools/analysis_ui.rs, which no module reaches, keeps main's text.
2026-11-23 03:38:36 +00:00
aiongg 3cbd7b155a Engine split step 6: slot_access.py and its rewrite (slot fields to accessors, trait imports, doc links)
scripts/engine_split/slot_access.py rewrites the slot fields to their accessors
(Tracked presets deref through one more *), adds the trait imports, turns
s.presets_changed() into presets::presets_changed(s) and points Session::method doc
links at the trait methods. Its fix mode applies what cargo check reports; branch
mode serves open branches and lists their edits to the moved methods. The
definition-span helpers session_state.py uses move to rust_source.py so both
scripts share them (session_state.py's output is unchanged).

This commit is split plus the fix rounds against cargo check of engine-core,
engine, ui-egui and automation (lib and tests). Part of #15710.
2026-11-23 03:28:27 +00:00
aiongg 601d576033 session_state.py: report edits inside a moved definition's body
The relocation check matched only the definition's name in the changed
lines, so a branch that changed a line inside builtin() got no report.
It also compares each hunk's old-side line range with the definition's
lines (doc comments and attributes included) in the base version.
2026-11-23 02:11:31 +00:00
aiongg 30bb60592b Engine split step 5: session_state.py and its rewrite (recording fields to s.recording, Clip::from_svg callers, preset store reads) 2026-11-23 01:05:50 +00:00
aiongg 519a0c22a3 Engine split step 3: top crate with the wrapper Session
crates/engine keeps the package photocraft-engine: src/facade.rs re-exports
photocraft-engine-core, and its Session wraps core's and installs every engine
command. Core's Session::new() installs nothing; core gets install() and session().
The command registry keeps main's behaviour (empty before an install).

The top crate's dev-dependencies cover tests/ and examples/, including
craft-develop-model (camera raw baseline test) and photocraft-testkit (the
corpus-gated Photoshop oracle test). Dependents that need the core type or
borrowed two fields through the wrapper are fixed at the call site, and tests
that reach the registry before any session install first.

Tooling follows the package: workspace dependency, cl selection, xtask layers,
i18n report, scorecard and corpus paths, nextest overrides, ci-test-times rows,
display-names roots, prefs_usage paths, the engine split scripts, docs, and the
two release-perf steps in ci.yml.

Corpus .atn paths, the layer_menu registry read and the craft-develop-model
dev-dependency are FredApps' fixes from #16431.

Part of #15710
2026-11-22 19:29:06 +00:00
aiongg b69ad02ccc Engine split step 3: move the engine sources to crates/engine-core
python3 scripts/engine_split/crate_shell.py split, then rustfmt on the files it edited.
The sources and the manifest move to crates/engine-core; core's tests start from
crate::session() (1,673 sites), 32 tests that read the registry first install with
crate::install(), and 12 Session imports the rewrite left unused are dropped.
2026-11-22 19:19:11 +00:00
aiongg 9406da9c6f engine_split: codemod usage says --head is pre-rebase, reports command_ids and private modules; contributing names TABLES 2026-11-19 20:22:30 +00:00
aiongg 71e84351e0 Engine install registry (#15710)
The command registry moves to `registry.rs`: `CommandSpec`, the `Install`
record, `install()`, `find`, `spec`, `command_specs` and the command-list
helpers. A process installs its command tables once; installing the same
tables again does nothing, and different tables are refused with
`InstallConflict`, which every later command then reports. A session that
runs a command before any install gets `NotInstalled`.

`install.rs` holds the full table list in today's order, `install()`, and
the `command_specs`/`find` wrappers that install first, which the public
`commands::` paths name. `Session::new()` installs. The order test and
`command_ids.txt` move with the list and read the ids from it.

The tables `install.rs` lists are public: the table fragments and seven
command modules that were private.

`scripts/engine_split/install_tables.py` moves a branch's added or removed
command tables (the old `v.extend(...)` lines or `SPECS` entries) into the
install list.
2026-11-19 18:15:14 +00:00
aiongg 7bffc1d271 Name the fragment type; codemod handles the ADJ table, single-entry fragments and rustfmt
The codemod three-way merges the adjustment table into table/image/adjustments.rs,
reports other build() edits as unhandled, compares entries without comments and
whitespace, adds the comma after a single-entry fragment, checks removals and
duplicate ids, and adds the imports new entries need. The order test's failure
message names the regeneration variable.
2026-11-19 17:02:37 +00:00
aiongg 1c97abb475 Split the command table into per-owner fragments
Fragments live in cmd/table/<owner>/<menu>.rs, one directory per future crate
(core, model, store, paint, image). SPECS names each fragment so the order test
can say which one a misplaced command comes from. scripts/engine_split/table_fragments.py
moves a branch's edits of the old inline table into the fragments.
2026-11-19 16:35:19 +00:00