pub struct RuntimeTraceWriter<W: Write> { /* private fields */ }Expand description
Streaming JSONL emitter for instrumented CPU or synthetic rollouts.
The writer emits metadata immediately, rejects duplicate event ids before writing an event,
and uses the same validation rules as the importer. Tensor callers should populate
TensorObservation::static_id with an id copied from the model IR or a tensor query.
Implementations§
Source§impl<W: Write> RuntimeTraceWriter<W>
impl<W: Write> RuntimeTraceWriter<W>
Sourcepub fn new(writer: W, run: RunMetadata) -> Result<Self>
pub fn new(writer: W, run: RunMetadata) -> Result<Self>
Start a JSONL stream by writing its required metadata event.
Sourcepub fn tensor(&mut self, observation: TensorObservation) -> Result<()>
pub fn tensor(&mut self, observation: TensorObservation) -> Result<()>
Emit one tensor observation. static_id is the static/runtime correlation key.
Sourcepub fn operation(&mut self, observation: OperationObservation) -> Result<()>
pub fn operation(&mut self, observation: OperationObservation) -> Result<()>
Emit one operation observation.
Sourcepub fn gradient(&mut self, fact: GradientFact) -> Result<()>
pub fn gradient(&mut self, fact: GradientFact) -> Result<()>
Emit one parameter-gradient fact after checking state/norm consistency.
Sourcepub fn value(&mut self, observation: ValueObservation) -> Result<()>
pub fn value(&mut self, observation: ValueObservation) -> Result<()>
Emit one forward value-range observation.
Auto Trait Implementations§
impl<W> Freeze for RuntimeTraceWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for RuntimeTraceWriter<W>where
W: RefUnwindSafe,
impl<W> Send for RuntimeTraceWriter<W>where
W: Send,
impl<W> Sync for RuntimeTraceWriter<W>where
W: Sync,
impl<W> Unpin for RuntimeTraceWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for RuntimeTraceWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for RuntimeTraceWriter<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more