You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
make sure program graph has the same semantics as old trace/ module #68
Graph, Node, NodeType, Executor, TrackedValue, IntoTracked, record_node, record_output, is_tracing, trace() — zero imports outside the trace module
itself
This was a pre-V1 runtime execution tracing system (task-local DAG recording). Completely superseded by ProgramGraph for dynamic graph execution and
tracing crate for observability.
trace/context.rs — task-local CURRENT_TRACE using tokio::task_local!, trace() wrapper function
trace/dag.rs — Graph, Node, NodeType, edge types
trace/executor.rs — Executor that replays a trace graph
trace/value.rs — TrackedValue, IntoTracked trait
Usage:lib.rs exports pub mod trace and pub use trace::*. But nothing outside the trace module imports from it. The Predict::forward() code has no calls into trace recording.
ProgramGraph from the design reference (docs/specs/modules/design_reference.md) was prototyped and intentionally removed — lib.rs docs say: "The type-erased ProgramGraph, DynModule, StrategyFactory layer was prototyped and intentionally removed."
What "same semantics" means:
The trace module captured a DAG of Predict invocations (inputs/outputs at each node). ProgramGraph was a structural graph (nodes = modules, edges = data flow between fields). They serve different purposes:
Trace = runtime execution record (what happened during a call)
ProgramGraph = structural description (how modules are wired together)
Options:
Revive trace/ for runtime recording — wire Predict::forward() to call record_node() when tracing is active. Migrate from Prediction/Example types to BamlValue/typed values. This gives you execution traces for debugging and optimizer data collection.
Delete trace/ entirely — it's dead code. Runtime observability is handled by tracing crate spans (chore: add tracing #56). If you don't need DAG replay, the tracing spans are sufficient.
Merge into the tracing story — use tracing spans for the execution DAG (custom span attributes for inputs/outputs/module names) instead of a separate recording system.
Recommendation: option 3. The tracing crate already supports structured span hierarchies. A custom Layer impl could reconstruct the execution DAG from spans without maintaining a parallel recording system.
Activity
darinkishore commentedon Feb 12, 2026
Codebase audit — trace/ module status
Files:
trace/mod.rs— module root, re-exports everythingtrace/context.rs— task-localCURRENT_TRACEusingtokio::task_local!,trace()wrapper functiontrace/dag.rs—Graph,Node,NodeType, edge typestrace/executor.rs—Executorthat replays a trace graphtrace/value.rs—TrackedValue,IntoTrackedtraitUsage:
lib.rsexportspub mod traceandpub use trace::*. But nothing outside the trace module imports from it. ThePredict::forward()code has no calls into trace recording.ProgramGraph from the design reference (
docs/specs/modules/design_reference.md) was prototyped and intentionally removed — lib.rs docs say: "The type-erased ProgramGraph, DynModule, StrategyFactory layer was prototyped and intentionally removed."What "same semantics" means:
The trace module captured a DAG of Predict invocations (inputs/outputs at each node). ProgramGraph was a structural graph (nodes = modules, edges = data flow between fields). They serve different purposes:
Options:
Predict::forward()to callrecord_node()when tracing is active. Migrate fromPrediction/Exampletypes toBamlValue/typed values. This gives you execution traces for debugging and optimizer data collection.tracingcrate spans (chore: add tracing #56). If you don't need DAG replay, the tracing spans are sufficient.tracingspans for the execution DAG (custom span attributes for inputs/outputs/module names) instead of a separate recording system.Recommendation: option 3. The
tracingcrate already supports structured span hierarchies. A customLayerimpl could reconstruct the execution DAG from spans without maintaining a parallel recording system.