Skip to content

Commit cf840be

Browse files
authored
Merge pull request #148 from DemchaAV/chore/deprecate-legacy-ecs
chore(engine): deprecate the legacy ECS engine packages (F11)
2 parents 468e751 + b213edc commit cf840be

5 files changed

Lines changed: 84 additions & 51 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,22 @@ Open cycle — bug-fix / housekeeping. Entries land here as they merge.
117117
resolved by the layout compiler. The method is kept for binary compatibility and
118118
scheduled for removal in the next major.
119119

120+
- **The legacy ECS engine packages are deprecated.** `com.demcha.compose.engine.core`,
121+
`engine.layout` (and `engine.layout.container`), and `engine.pagination` are the
122+
original `Entity`-based layout/pagination engine — a parallel second engine
123+
whose execution path the canonical pipeline
124+
(`GraphCompose.document() → DocumentSession → LayoutCompiler`) never runs; it
125+
imports nothing from them directly, and the former `GraphCompose.pdf(...)`
126+
entry point has already been removed. The ECS execution engine runs only under
127+
the legacy engine regression tests. (One vestigial coupling remains, tracked as
128+
a follow-up: the canonical `TextMeasurementSystem` still `extends
129+
engine.core.SystemECS` via a no-op `process(...)`.) The
130+
packages are now `@Deprecated` (package level, so no deprecation-warning cascade)
131+
with corrected package docs, to stop misdirecting contributors into optimizing a
132+
dead engine. The genuinely shared engine packages (`engine.components`,
133+
`engine.measurement`, `engine.font`, `engine.render`) are **not** deprecated.
134+
No public API or behaviour change.
135+
120136
### Tests / tooling
121137

122138
- **Benchmark regression gate and measurement probe (benchmarks module, not part
Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
/**
2-
* Core ECS primitives that hold entity/component graphs and shared traversal
3-
* state.
2+
* Core primitives of the <strong>legacy ECS engine</strong> — entity/component
3+
* graphs and shared traversal state for the original {@code Entity}-based
4+
* layout / pagination / render pipeline.
45
*
5-
* <p>This package contains the foundation used by the runtime pipeline. In the
6-
* normal PDF pipeline the high-level flow is:</p>
6+
* <p>This is <em>not</em> the engine behind the public API. The canonical
7+
* pipeline ({@code GraphCompose.document() -> DocumentSession -> LayoutCompiler
8+
* -> LayoutGraph -> PdfFixedLayoutBackend}) in {@code com.demcha.compose.document.*}
9+
* imports nothing from this package directly, and the former
10+
* {@code GraphCompose.pdf(...)} surface that drove the ECS has been removed. The
11+
* ECS <em>execution</em> engine — the {@code EntityManager.processSystems()} loop
12+
* and the layout / pagination / render systems it drives — is dead: it runs only
13+
* under the legacy engine regression tests.</p>
714
*
8-
* <ol>
9-
* <li>builders populate {@code Entity} graphs and attach components</li>
10-
* <li>{@code LayoutSystem} resolves geometry, hierarchy depth, and layer order</li>
11-
* <li>{@code PageBreaker} assigns final page-aware {@code Placement}</li>
12-
* <li>a backend renderer such as {@code PdfRenderingSystemECS} consumes the resolved entities</li>
13-
* </ol>
15+
* <p>One vestigial holdover keeps {@code SystemECS} and {@code EntityManager}
16+
* referenced from live code: the canonical
17+
* {@code engine.measurement.TextMeasurementSystem} still
18+
* {@code extends SystemECS} with a no-op {@code process(EntityManager)}.
19+
* Decoupling that base — so {@code engine.core} becomes genuinely unreferenced by
20+
* the canonical pipeline — is a tracked follow-up.</p>
1421
*
15-
* <p>The package is intentionally split further into subpackages with narrower
16-
* responsibilities:</p>
22+
* <p>The genuinely shared engine packages are elsewhere and are <em>not</em>
23+
* deprecated: {@code engine.components} (value types), {@code engine.measurement}
24+
* (text-measurement contracts), {@code engine.font}, and
25+
* {@code engine.render} (backend-neutral render-pass contracts) are all used by
26+
* the canonical pipeline.</p>
1727
*
18-
* <ul>
19-
* <li>{@code engine.layout}: low-level layout systems</li>
20-
* <li>{@code engine.pagination}: page-breaking helpers</li>
21-
* <li>{@code engine.measurement}: text measurement contracts</li>
22-
* <li>{@code engine.render}: backend-neutral render-pass contracts and dispatch helpers</li>
23-
* </ul>
24-
*
25-
* <p>Project policy is to keep backend-specific lifecycle concerns out of the
26-
* shared engine layer wherever possible. The engine should reason in terms of
27-
* resolved geometry, entity ordering, and render-session seams, while PDFBox,
28-
* DOCX, or PPTX specifics stay in backend-owned packages.</p>
28+
* @deprecated Legacy ECS engine, superseded by the canonical
29+
* {@code com.demcha.compose.document.layout} pipeline. No public entry point
30+
* runs it and it is not on the canonical hot path; it is retained only for the
31+
* legacy engine regression tests (aside from the vestigial {@code SystemECS}
32+
* base of {@code TextMeasurementSystem}, a tracked cleanup) — a candidate for
33+
* removal. Do not extend it or spend optimization effort here.
2934
*/
35+
@Deprecated
3036
package com.demcha.compose.engine.core;
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
/**
2-
* Internal container layout helpers for alignment, expansion, and module width resolution.
2+
* Container layout helpers (alignment, expansion, module-width resolution) of
3+
* the <strong>legacy ECS engine</strong>.
34
*
4-
* <p>Ownership: Owned by the shared engine layout pipeline.</p>
5-
* <p>Extension rules: Extend with deterministic helpers that operate on existing components and traversal snapshots.</p>
5+
* <p>Part of the parallel legacy {@code Entity}-based engine; the canonical
6+
* {@code com.demcha.compose.document.layout} pipeline does not use it.</p>
7+
*
8+
* @deprecated Legacy ECS engine, superseded by the canonical
9+
* {@code com.demcha.compose.document.layout} pipeline. Not reachable from
10+
* any public API; retained only for legacy regression tests and a candidate
11+
* for removal. Do not extend it or spend optimization effort here.
612
*/
7-
package com.demcha.compose.engine.layout.container;
13+
@Deprecated
14+
package com.demcha.compose.engine.layout.container;
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
/**
2-
* Shared layout systems that turn low-level entities into resolved geometry.
2+
* Layout systems of the <strong>legacy ECS engine</strong> — they turn
3+
* low-level {@code Entity} graphs into resolved geometry for the original
4+
* {@code Entity}-based pipeline.
35
*
4-
* <p>Ownership: Owned by the shared engine layout pipeline.</p>
5-
* <p>Extension rules: New layout behavior must preserve deterministic traversal and be covered by layout snapshot tests.</p>
6+
* <p>Despite the former "shared" framing, the canonical pipeline
7+
* ({@code com.demcha.compose.document.layout.LayoutCompiler}) imports nothing
8+
* from this package. It is part of the parallel legacy ECS engine reachable
9+
* only from the legacy engine regression tests.</p>
10+
*
11+
* @deprecated Legacy ECS engine, superseded by the canonical
12+
* {@code com.demcha.compose.document.layout} pipeline. Not reachable from
13+
* any public API; retained only for legacy regression tests and a candidate
14+
* for removal. Do not extend it or spend optimization effort here.
615
*/
7-
package com.demcha.compose.engine.layout;
16+
@Deprecated
17+
package com.demcha.compose.engine.layout;
Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
/**
2-
* Pagination and page-placement helpers for resolved GraphCompose entities.
2+
* Pagination and page-placement helpers of the <strong>legacy ECS engine</strong>.
33
*
4-
* <p>This package owns the logic that runs after layout has produced
5-
* {@code ComputedPosition} and size metadata but before the renderer writes the
6-
* final document. Its responsibilities include:</p>
4+
* <p>This package paginates the resolved {@code Entity} graph for the original
5+
* {@code Entity}-based pipeline ({@code PageBreaker} for the pagination walk,
6+
* {@code PageLayoutCalculator} for page-coordinate math, {@code TextBlockProcessor}
7+
* for block-text fragmentation, {@code ParentContainerUpdater} for upward
8+
* size/position propagation). It is renderer-neutral, but it is part of the
9+
* parallel legacy ECS engine: the canonical pipeline
10+
* ({@code com.demcha.compose.document.layout}) does its own pagination and
11+
* imports nothing here.</p>
712
*
8-
* <ul>
9-
* <li>choosing a child-first pagination order for the resolved hierarchy</li>
10-
* <li>mapping resolved Y coordinates into page-relative {@code Placement}</li>
11-
* <li>splitting breakable content such as block text across pages</li>
12-
* <li>propagating child-driven size and page-shift updates into parent containers</li>
13-
* </ul>
14-
*
15-
* <p>The package is intentionally renderer-neutral. It does not open PDF
16-
* streams, create pages directly, or decide backend drawing policy. Instead it
17-
* mutates the entity graph so later renderers can consume one deterministic,
18-
* page-aware layout result.</p>
19-
*
20-
* <p>Key classes in this package are {@code PageBreaker} for the pass-level
21-
* pagination walk, {@code PageLayoutCalculator} for page-coordinate math,
22-
* {@code TextBlockProcessor} for block-text fragmentation, and
23-
* {@code ParentContainerUpdater} for upward size/position propagation.</p>
13+
* @deprecated Legacy ECS engine, superseded by the canonical
14+
* {@code com.demcha.compose.document.layout} pipeline. Not reachable from
15+
* any public API; retained only for legacy regression tests and a candidate
16+
* for removal. Do not extend it or spend optimization effort here.
2417
*/
18+
@Deprecated
2519
package com.demcha.compose.engine.pagination;

0 commit comments

Comments
 (0)