Skip to content

P2 follow-up: native c[R]→c[p] bake + drop the report's last c[p]/kateri dependency#32

Open
drserajames wants to merge 3 commits into
p2-render-spikefrom
p2-bake
Open

P2 follow-up: native c[R]→c[p] bake + drop the report's last c[p]/kateri dependency#32
drserajames wants to merge 3 commits into
p2-render-spikefrom
p2-bake

Conversation

@drserajames

Copy link
Copy Markdown
Owner

Native semantic→legacy bake + eliminate the report's last c["p"] dependency

Stacked on #31 (base p2-render-spike). Three commits that remove the final reason a report run needs kateri.

Background

The report stores styling two ways: semantic named styles (c["R"]) and a flat per-point legacy plot spec (c["p"]). Resolving c["R"]c["p"] ("baking") was kateri-only, so prestyle launched kateri just to bake it. The native map renderer and tree/signature pages already read c["R"] directly and ignore c["p"]; the only remaining c["p"] reader was multiple_circles.

Changes

  1. chart/v3: native Chart.semantic_style_to_legacy(style_name) — implements the stubbed C++ bake (c["R"]c["p"]), the in-process reproduction of kateri's plotSpecLegacy().setFrom(...). Verified 21/21 report charts exact vs the kateri-baked golden c["p"] (0 per-antigen fill diffs, 0 per-point palette-index diffs, after colour-string normalisation).
  2. report/multiple_circles: resolve fills from c["R"], not stored c["p"]legacy_fills() now resolves the clades-v10 semantic style in-process via the native bake instead of reading a pre-baked legacy spec. Verified 0-diff fills across the report's charts. multiple_circles was the last c["p"] consumer.
  3. report/prestyle: drop the now-dead kateri bake — with nothing consuming c["p"], prestyle's export_to_legacy + get_chart round-trip is dead weight. Removed; the prestyled chart is serialised natively and prestyle is now @no_kateri (no kateri launch in any render mode).

Effect

Combined with #31 (native default renderer + native styled.ace write), a batch report run now needs no kateri process for its headless generation steps. Kateri remains the interactive viewer (drag/Relax) and an opt-in render fallback.

Notes

  • No pre-publication data in the diff; the WHO-data gate passes on the full tree and on all three commit messages. Charts referenced read-only from outside the repo; verification used synthetic comparisons.

drserajames and others added 3 commits July 10, 2026 13:49
…le_to_legacy)

Implements the stubbed Chart::semantic_style_to_legacy natively, reproducing
kateri's plotSpecLegacy().setFrom(currentPlotSpec): resolve a named c["R"]
semantic style to a concrete per-point spec (kateri PlotSpecSemantic.activate/
apply), then collapse to a unique-spec palette + per-point index list written
into the legacy plot spec (c["p"] = {"d","p","P"}). This makes native export
self-contained — the report no longer needs kateri to bake c["p"].

Resolution mirrors the validated native renderer (cc/map-draw/styled-draw.cc)
but tracks colours as kateri's ColorAndModifier (base string + deferred :pale)
rather than resolving to RGB, because the legacy F/O fields carry the colour
string, not a paled hex. Reference antigens use kateri's name-only + has-coord
rule; egg shape uses kateri's raw-passage regex for byte-exact fidelity.

Adds cc/chart/v3/semantic-to-legacy.cc (registered in meson.build) and a
Chart.semantic_style_to_legacy Python binding in cc/py/chart-v3.cc.

Verified against 21 kateri-baked golden charts (self-rebake): 0 per-antigen
legacy-fill diffs, 0 per-point palette-index diffs (mod colour normalisation
#CCCCCC->gray80 / hex case). Serum circles / serum coverage are not baked
(absent from the report's clades legacy styles, so lossless there).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…c["p"]

legacy_fills() now resolves the clades-v10 SEMANTIC style (c["R"]) in-process
via Chart.semantic_style_to_legacy instead of reading a pre-baked legacy plot
spec (c["p"]). That stored c["p"] could only be produced by kateri (baked in
prestyle), so multiple_circles was the last thing tying the report to a
kateri-baked c["p"]. Resolving c["R"] removes that dependency — verified
byte-equal fills (0 diffs across the report's charts).

Downstream: prestyle no longer needs to bake c["p"] for multiple_circles, so a
report run can skip that kateri step (separate follow-up in commander/prestyle).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
prestyle launched kateri solely to bake c["p"] (export_to_legacy + get_chart).
Nothing consumes c["p"] anymore — multiple_circles resolves clade fills from
c["R"] directly — so the bake is dead weight. Remove it: serialise the in-memory
prestyled chart natively and mark prestyle @no_kateri, so it no longer launches
kateri in any render mode. (export's kateri-branch bake at commander.py is
likewise now vestigial, but is already skipped by the native default.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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