Skip to content

refactor: make the graph the single source for tree output#858

Merged
ivan-aksamentov merged 4 commits into
rustfrom
refactor/graph-io-single-source
Jul 23, 2026
Merged

refactor: make the graph the single source for tree output#858
ivan-aksamentov merged 4 commits into
rustfrom
refactor/graph-io-single-source

Conversation

@ivan-aksamentov

Copy link
Copy Markdown
Member

refactor/graph-io-single-source -> fix/clock-negative-rate-warn

Resolve:

Update:

  • kb/features/io.md: mark tree-output ordering, metadata, and reference-sequence parity

Create:

Tree output was projected through an intermediate TreeIR layer built separately from the command graph. Direct formats (Newick, Nexus) consumed the ordered graph while TreeIR-backed formats (Auspice, PhyloXML, UShER MAT) projected the original graph, so the same output plan could carry different node orders, and the projection duplicated logic that drifted from the graph.

Make the graph authoritative for every writer [src]. Output topology order is applied once, in place, before any writer reads the graph, and each format adapter reads the command graph data directly instead of a projection. Auspice gains the updated metadata and root_sequence it was missing, and UShER export warns rather than fabricating a reference allele from a branch-local parent.

The single-source design removes the class of bugs where two representations of one tree disagree. Node ordering, mutation projection, and reference-sequence population now have exactly one producer, and the augur-facing formats match augur's node identity and ordering.

Work items

  • Remove the TreeIR projection layer; format adapters read the command graph directly [src]
  • Apply output topology order once before every tree writer [src]
  • Introduce a unified Mutation/MutationEvent model for format projection [src]
  • Warn on a fabricated UShER reference allele instead of emitting it

- Apply output topology preferences in place before every tree writer reads the final graph.\n- Remove TreeIR projections and command-specific format gates so adapters read command graph data directly.
Base automatically changed from fix/clock-negative-rate-warn to rust July 23, 2026 05:39
@ivan-aksamentov
ivan-aksamentov merged commit e46b717 into rust Jul 23, 2026
9 checks passed
@ivan-aksamentov
ivan-aksamentov deleted the refactor/graph-io-single-source branch July 23, 2026 05:40
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