Skip to content

feat(examples): add EngineDeck flagship rendering real benchmark data#197

Merged
DemchaAV merged 9 commits into
developfrom
feature/flagship-showcase-document
Jun 16, 2026
Merged

feat(examples): add EngineDeck flagship rendering real benchmark data#197
DemchaAV merged 9 commits into
developfrom
feature/flagship-showcase-document

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

GraphCompose had no example that makes the engine's case for itself end to end — what it is, how it composes, how it performs. EngineDeck is that artifact: a landscape deck the engine renders about itself, doubling as a brand sheet.

What changed

New flagship EngineDeckExample (examples module, canonical lane) — four landscape pages:

  • Banner — the SVG wordmark + version, a four-step flow (DSL code panel → engine capability grid → output backends → real rendered-document thumbnails) and a capability strip. Feature icons are bundled SVGs (light recolours for the dark cards); thumbnails are real example PDFs (CV / invoice / report) rasterised once into resources.
  • How it works — the AUTHOR → MEASURE → PAGINATE → RENDER pipeline plus a "why it's solid" row.
  • Benchmarked / Scaling — the comparative benchmark (GraphCompose vs iText 9 vs JasperReports). A snapshot of the suite's comparative/latest.json is bundled under resources/benchmarks/ and loaded at render time; the engine draws the table and every chart straight from it, with run metadata and a refresh note.

Data is separated from rendering: an EngineDeckData layer holds the benchmark loader and the structured content as records, and EngineDeckExample only composes. Registered in GenerateAllExamples; CHANGELOG (Documentation) updated; the PDF Producer credits PDFBox 3.0.

Verification

EngineDeckLayoutSnapshotTest locks the layout against a committed baseline (LayoutSnapshotAssertions); the data-layer refactor is proven byte-identical by that baseline still matching un-reblessed.

./mvnw -f examples/pom.xml test → BUILD SUCCESS — Tests run: 2, Failures: 0 (snapshot + GenerateAllExamples smoke).

No public API or engine surface touched. Out of scope here: the examples/README.md gallery row and a committed assets/readme/** preview (the README has unrelated in-progress edits in the working tree).

DemchaAV added 7 commits June 15, 2026 22:53
No example showed the engine making the end-to-end case for itself.
EngineDeck is a multi-page landscape deck GraphCompose renders about
itself, doubling as a brand sheet.

- Page 1: a full-page banner — the SVG wordmark and version, a four-step
  flow (DSL code panel -> engine capability grid -> output backends ->
  real rendered-document thumbnails) and a capability strip. Feature
  icons are bundled SVGs (with light recolours so they read on the dark
  panel); the thumbnails are real example PDFs (CV / invoice / report)
  rasterised once into resources.
- Page 2: the authoring pipeline (AUTHOR -> MEASURE -> PAGINATE ->
  RENDER) and a short "why it's solid" row.
- Pages 3-4: the comparative benchmark (GraphCompose vs iText 9 vs
  JasperReports). A snapshot of the suite's result file is bundled under
  resources/benchmarks/ and loaded at render time; the engine draws the
  table and every chart straight from it. The page carries the run
  metadata and a refresh note (re-run the suite, recopy latest.json).

Registered in GenerateAllExamples so GenerateAllExamplesSmokeTest
exercises it on CI.

Verified: ./mvnw -f examples/pom.xml test -Dtest=GenerateAllExamplesSmokeTest
-> BUILD SUCCESS.
Extract compose(DocumentSession) from generate() so a test can drive the
composition before buildPdf, then assert the resolved geometry against a
committed baseline via LayoutSnapshotAssertions. A layout regression now
shows up in a PR instead of a silently-changed PDF.

Re-bless after a deliberate layout change, or after refreshing the bundled
benchmark data (chart bar geometry is data-driven), with
-Dgraphcompose.updateSnapshots=true.

Verified: ./mvnw -f examples/pom.xml test -Dtest=EngineDeckLayoutSnapshotTest
-> BUILD SUCCESS.
Adapt the cv/v2 layered separation for the one-off deck: move the benchmark
loader (BenchRun + loadBench) and the deck's structured content — capability
chips, engine capabilities, output backends, pipeline steps, proof points —
into a new EngineDeckData as plain records. EngineDeckExample now reads WHAT to
show from the data layer and only decides HOW to draw it; the inline content
lists are gone.

Pure refactor — the rendered layout is byte-identical, proved by the existing
EngineDeck snapshot still matching its (un-reblessed) baseline.

Verified: ./mvnw -f examples/pom.xml test -> BUILD SUCCESS (2 tests, snapshot
baseline unchanged).
The deck renders through PDFBox, so the PDF Producer metadata now reads
"GraphCompose (PDFBox 3.0)" instead of "GraphCompose" — honest about the
backend that writes the bytes. Layout is unchanged (snapshot still matches).
- Class Javadoc now matches the shipped banner — light-recoloured icons on
  dark cards, not "monochrome icons on light chips".
- CHANGELOG v1.8.0 Documentation lists the new EngineDeck flagship.
- EngineDeckData.BenchRun reports "no benchmark row: <label>" instead of an
  NPE when a scenario label is absent (e.g. after a data refresh renames one).

Layout unchanged — snapshot still matches.
Commit the EngineDeck preview (assets/readme/examples/engine-deck.pdf), link it
from the gallery row, and bring the counts up to date (63 example programs, 39
committed previews). Also lands the Engine Showcase gallery row, which was
pending in the tree.
EngineDeckExample carried its 21-colour palette and every benchmark
table/chart builder inline, at 862 lines. Move the palette to
EngineDeckTheme and the table + chart specs to EngineDeckCharts, both
package-private and statically imported — completing the
data/theme/widgets split the deck began with EngineDeckData.

EngineDeckExample drops to 659 lines and now only composes pages. The
layout snapshot stays byte-identical, proving the move changed no output.
DemchaAV and others added 2 commits June 16, 2026 08:18
…EngineDeck scaling page

The scaling-page narrative described the time story only around iText, where the lead widens, and left out that JasperReports closes to roughly the same render time at 1000 rows — which the line chart on the same page already plots. Add the clause so the prose matches the chart, keeping the memory-advantage point. Regenerate the layout snapshot for the reworded paragraph.
@DemchaAV DemchaAV merged commit 4d642c9 into develop Jun 16, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feature/flagship-showcase-document branch June 16, 2026 20:58
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