Skip to content

Decouple live pulse plot: emit pulse-data frames, render client-side (Freeze-2 protocol change) #71

Description

@jack-champagne

Substantial extension-plumbing carve-out (per the UX ownership policy, #50) — @Rchari1. The design side is Kate's native plot component (UX4 #49); this is the emit + protocol plumbing. This is the Freeze-2 protocol change (contract owner: #58).

What

Replace the per-iter PNG frame with a pulse-data frame the webview renders natively:

  • Host→webview protocol (Freeze 2): setImageSource(fsPath) / refresh{url}postPulseData(runId, iter, pulse, isFinal) → a pulseframe message. The other messages (iteration stats · completed · warming · runlabel) are unchanged and stay runId-keyed.
  • Emit side: the per-iter callback (the LivePulsePlotCallback path from 0.2c — Route per-iter PNGs through LivePulsePlotCallback (AbstractIntermediateCallback) #43) emits the pulse array + metadata instead of saving a PNG for the live view. plot_pulse/PNG stays for publication export only (final.png), out of the live loop.
  • CSP: the live path drops the per-iter img-src PNG grant (keep it only if a final PNG is shown).
  • Contract test: update inspector_view_contract.test.ts to pin the pulseframe data message (+ relax img-src) atomically with the impl — do not red the test standalone.

Gating question — answer before building

plot_pulse parity: what does Piccolo's plot_pulse compute that the client plotter must replicate — bounds shading, embedded-operator handling, unit/axis scaling? The emitted pulse schema (control array + times + the metadata for faithful rendering) follows from this. And: mid-solve iterates are infeasible/unconverged — the client must auto-scale for wild values and label "iter N, not converged" so an iterate is never mistaken for a deliverable.

Why (not just perf)

Correct MVC separation (solver = model, inspector = view; Julia rendering per-iter is a layering violation) + native theme-aware/resizable plots. Scales to multi-run (N data streams vs N synchronous PNG streams). The solver-stall perf win is a bonus, mostly on small/fast solves.

Links

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions