# `StatifierUI.EventLog.Macrostep`
[🔗](https://github.com/riddler/statifier-ui/blob/v0.11.0/lib/statifier_ui/event_log/macrostep.ex#L1)

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".

# `t`

```elixir
@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()]
}
```

# `new`

```elixir
@spec new(non_neg_integer(), [StatifierUI.EventLog.Round.t()], [
  StatifierUI.Trace.Message.t()
]) :: t()
```

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

# `stamped`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
