StatifierUI.EventLog.Macrostep (StatifierUI v0.4.0)

Copy Markdown View Source

One macrostep's worth of an StatifierUI.EventLog.t(): its rounds, its round-less effect.* messages, and two summaries derived from its rounds rather than carried on any single message.

configuration is the configuration of the last round (by round order) that carried a trace.macrostep_stable - statifier ADR-0044's rule that the last-arriving trace.macrostep_stable in a macrostep is that macrostep's quiescence, since a stream may carry more than one. event is the first round's dequeued event, nil for the initialize burst, which lets a collapsed macrostep be summarized by what triggered it without inspecting every round.

final_configuration is the same reading for the halting macrostep (sui-dc7). A run that ends by entering a top-level <final> never reaches quiescence in that macrostep, so it emits no trace.macrostep_stable at all; trace.done carries the configuration instead - docs/wire-format.md's trace.done row defines its configuration field as "the full configuration as it stood at exit, a genuine set, sorted ascending", the same shape and the same authority as a macrostep_stable payload. It is kept in its own field rather than folded into configuration so a reader can still tell a configuration the chart settled in from the one it exited in; stamped/1 is the reading for a caller that only needs "whichever this macrostep stamped".

Summary

Functions

Builds a macrostep from its already-ordered rounds and its already-sorted round-less effects, deriving configuration, final_configuration and event from rounds.

Whichever configuration this macrostep stamped, exit reading first, or nil when it stamped neither.

Types

t()

@type t() :: %StatifierUI.EventLog.Macrostep{
  configuration: [non_neg_integer()] | nil,
  effects: [StatifierUI.Trace.Message.t()],
  event: map() | nil,
  final_configuration: [non_neg_integer()] | nil,
  macrostep: non_neg_integer(),
  rounds: [StatifierUI.EventLog.Round.t()]
}

Functions

new(macrostep, rounds, effects)

Builds a macrostep from its already-ordered rounds and its already-sorted round-less effects, deriving configuration, final_configuration and event from rounds.

stamped(macrostep)

@spec stamped(t()) :: [non_neg_integer()] | nil

Whichever configuration this macrostep stamped, exit reading first, or nil when it stamped neither.

The exit reading wins because it is the later of the two: a macrostep that both stabilized and then halted ended where trace.done says it did. Callers that must distinguish the two read the fields.