Skip to content

trace: render_traces / render_trace notebook bundles (#62) - #71

Merged
0xErgod merged 2 commits into
masterfrom
trace/62-render
Jul 5, 2026
Merged

0xErgod merged 2 commits into
masterfrom
trace/62-render

Conversation

@0xErgod

@0xErgod 0xErgod commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Phase 5 — notebook rendering. Builds on #59 (Trace) and #60 (traces).

What

crates/stratum-notebook/src/render.rs, mirroring render_lts/render_run (always text/plain; text/latex only in Repr::Latex):

  • render_traces(&[Trace], truncated, aliases, repr) — the indexed trace-set list. ASCII: Traces: N traces (complete|truncated …) then one tr[i] k events <SP form> row each. LaTeX: \begin{array}{rll} of \mathsf{tr}_i & k & <SP> rows.
  • render_trace(&Trace, aliases, repr) — a single trace as a listing: its series-parallel form, one line per event (chan⟨message⟩, alias-folded), one per covering (Hasse) edge. Empty trace → (empty) / \varnothing.

Both re-exported from the crate root alongside the other render_*.

Supporting change in stratum-lts

Adds Trace::to_latex — the LaTeX sibling of to_ascii — by parameterizing the SP renderer with its separators (\cdot / \parallel). No behaviour change to to_ascii.

Tests

render.rs unit tests over real parsed protocols: race lists two tr[] rows; truncated flag surfaces; diamond detail shows the parallel form (ASCII ∥, LaTeX \parallel); empty trace is marked in both modes.

fmt / clippy -D warnings / cargo test --workspace green locally.

Closes #62

0xErgod and others added 2 commits July 5, 2026 02:47
Phase 5. Notebook rendering for the trace toolkit, mirroring render_lts /
render_run (always text/plain; text/latex only in Latex mode):

- render_traces — the indexed trace-set list: one `tr[i]` row per trace with
  its event count and series-parallel form; a (complete)/(truncated) header.
- render_trace — a single trace as a listing: its SP form, one line per event
  (chan⟨message⟩, alias-folded), one per covering (Hasse) edge.

Adds Trace::to_latex (the LaTeX sibling of to_ascii) by parameterizing the
series-parallel renderer with its separators (\cdot / \parallel).

Tests: race → 2 rows, truncated flag, diamond detail is parallel (ascii ∥ /
latex \parallel), empty trace marked.

Refs #62

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ranch

Review nit: match the house `latex_status` pattern and run the (currently
special-char-free) status literal through `escape_latex_text`, so a future
status string with a LaTeX-special char cannot break the output.

Refs #62

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@0xErgod
0xErgod merged commit 77b69e3 into master Jul 5, 2026
3 checks passed
@0xErgod
0xErgod deleted the trace/62-render branch July 5, 2026 00:54
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.

trace: rendering bundles (render_traces / render_trace)

1 participant