Repository navigation
trace: render_traces / render_trace notebook bundles (#62) - #71
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 5 — notebook rendering. Builds on #59 (
Trace) and #60 (traces).What
crates/stratum-notebook/src/render.rs, mirroringrender_lts/render_run(alwaystext/plain;text/latexonly inRepr::Latex):render_traces(&[Trace], truncated, aliases, repr)— the indexed trace-set list. ASCII:Traces: N traces (complete|truncated …)then onetr[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-ltsAdds
Trace::to_latex— the LaTeX sibling ofto_ascii— by parameterizing the SP renderer with its separators (\cdot/\parallel). No behaviour change toto_ascii.Tests
render.rsunit tests over real parsed protocols: race lists twotr[]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 --workspacegreen locally.Closes #62