CompilationRecord

CompilationRecord#

class braintrace.CompilationRecord(kind, level, message, primitive=None, weight_path=None, hidden_paths=(), context=None)[source]#

A single compiler decision, captured with structured context.

A frozen dataclass recording one decision made by the ETrace compiler, together with enough structured context to query why the decision was made without parsing the human-readable message.

Parameters:
  • kind (DiagnosticKind) – Machine-readable reason for the record.

  • level (DiagnosticLevel) – Severity of the record.

  • message (str) – Human-readable description of the decision.

  • primitive (Optional[Any]) – The JAX primitive the decision concerns, if any. Default None.

  • weight_path (Optional[Tuple[Any, ...]]) – Module path of the weight ParamState the decision concerns, if any. Default None.

  • hidden_paths (Tuple[Tuple[Any, ...], ...]) – Module paths of the hidden states the decision concerns. Default ().

  • context (Optional[Dict[str, Any]]) – Open dict of extra context keyed by the emitting site; see the DiagnosticKind documentation for the schema of each kind. Default None.