Tracing¶
The deterministic event trace. trace(sim) attaches a Tracer that records a
canonical TraceRecord per processed event; the resulting sequence is the
same-seed-same-result oracle used throughout the parallel test suites.
llmsim.trace is a public submodule of the llmsim package.
Functions¶
disable_trace ¶
disable_trace(sim)
Detach any tracer from sim, restoring the zero-overhead default path.
Records¶
Tracer ¶
Tracer()
Collects a :class:TraceRecord per processed event.
Attach with :func:trace; read :attr:records after the run. Two runs of
the same deterministic model produce equal record lists.
Start with an empty log.
TraceRecord ¶
Bases: NamedTuple
One processed event, in canonical, comparable form.
Attributes:
| Name | Type | Description |
|---|---|---|
time |
float
|
The simulation time at which the event was processed. |
eid |
int
|
The event's monotonic schedule id (the deterministic tie-breaker). |
kind |
str
|
The event class name (e.g. |
priority |
int
|
The scheduling priority the event was processed at. |
payload |
Any
|
The event's resolved value (or its exception, if it failed). |