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
This commit is contained in:
aiongg committed 2026-11-22 19:29:06 +00:00
1 parent b69ad02ccc
commit 519a0c22a3
36 files changed
+530 -345

No files matched your search

+4 -11
View File
@@ -2,7 +2,7 @@
"""Move a branch's added or removed command tables into the engine's install list.
The engine's command tables are listed, in registry order, in `TABLES` in
`crates/engine/src/install.rs`. Before that, `crates/engine/src/cmd.rs` listed them: first as
`crates/engine-core/src/install.rs` (`crates/engine/src/install.rs` before the crate split). Before that, `crates/engine/src/cmd.rs` listed them: first as
`v.extend(<module>::specs());` lines in `fn build()`, later as `("<name>", <path>),` entries in
`SPECS`. A branch that added or removed a table carries that edit in `cmd.rs`. This script applies
it to `TABLES`:
@@ -22,8 +22,8 @@ inline commands are `table_fragments.py`'s; run both.
import argparse, re, subprocess, sys
CMD = "crates/engine/src/cmd.rs"
INSTALL = "crates/engine/src/install.rs"
LIB = "crates/engine/src/lib.rs"
INSTALL = "crates/engine-core/src/install.rs"
INSTALL_BEFORE_SPLIT = "crates/engine/src/install.rs"
EXTEND_RE = re.compile(r"^\s*v\.extend\(((?:crate::)?(?:cmd::)?)([a-z0-9_:]+?)::([a-z0-9_]+)\(\)\);", re.M)
ENTRY_RE = re.compile(r'^\s*\("([^"]+)",\s*([A-Za-z0-9_:]+)\),', re.M)
@@ -65,7 +65,7 @@ def main():
ap.add_argument("--base", required=True, help="the branch's merge-base with the old main")
ap.add_argument("--head", required=True, help="the branch")
a = ap.parse_args()
if git_show(a.head, INSTALL) is not None:
if git_show(a.head, INSTALL) is not None or git_show(a.head, INSTALL_BEFORE_SPLIT) is not None:
print(
f"warning: {a.head} is already on the install.rs layout; if you rebased, pass the "
"pre-rebase commit as --head (a rebased branch has lost its added tables)",
@@ -98,13 +98,6 @@ def main():
pred = "the last table fragment"
rows.insert(at, f' ("{name}", {path}),')
report.append(f"added {name} ({path}) after {pred}")
module = path.split("::")[-2]
lib = git_show(a.head, LIB) or ""
if not re.search(rf"^pub (?:use cmd::{module}|mod {module})\b", lib, re.M):
report.append(
f"WARNING module `{module}` of {name} is private in {LIB}; task 3 moves install.rs "
"to the top crate and needs it public"
)
for name in base:
if name not in head_names and name in names():
rows = [r for r, n in zip(rows, names()) if n != name]
+3 -3
View File
@@ -2,7 +2,7 @@
"""Move a branch's edits of the old inline command table into the table fragments.
Before the table was split, `crates/engine/src/cmd.rs` held every core command in one `vec![...]`
inside `fn build()`. The entries now live in `crates/engine/src/cmd/table/<owner>/<menu>.rs`, and
inside `fn build()`. The entries now live in `crates/engine-core/src/cmd/table/<owner>/<menu>.rs`, and
`install/command_ids.txt` pins the registry order. A branch that edited the old table carries its
edits in `cmd.rs`. This script applies them to the fragments:
@@ -29,8 +29,8 @@ Edits outside `build()` (imports in cmd.rs, helper fns, test modules) are not to
import argparse, os, re, subprocess, sys, tempfile
CMD = "crates/engine/src/cmd.rs"
TABLE = "crates/engine/src/cmd/table"
IDS = "crates/engine/src/install/command_ids.txt"
TABLE = "crates/engine-core/src/cmd/table"
IDS = "crates/engine-core/src/install/command_ids.txt"
ID_RE = re.compile(r'"([a-zA-Z]+\.[A-Za-z0-9.]+)"')