Link Proofs.RuntimeApprox.RevGraph to the executable Proofs.Autograd.Algebra.GraphData #
This is a definitional/structural bridge:
RevGraph.toGraphDataerases spec/bound metadata and keeps the runtime forward/VJP closures.- We show
GraphData.eval/GraphData.backpropCtxcoincide withRevGraph.evalRuntime/RevGraph.backpropRuntime.
Deduplication note:
Proofs.RuntimeApprox.TList is defined as an abbrev for the same heterogeneous context type
used by the executable autograd-algebra layer (Proofs.Autograd.Algebra.TList). This means all
bridges in this file are genuinely structural/definitional: we do not need to convert between two
different context representations.
Note on environments (Δ):
Proofs.Autograd.Algebra.GraphData is parameterized by an extra (non-differentiable) environment
Δ threaded through evaluation. The runtime-approximation graphs here do not use such an
environment, so we instantiate the executable layer at Δ := Unit and pass () during
evaluation/backprop.
Erase a RuntimeApprox.RevNode into an executable Autograd.Algebra.NodeData.
We take Δ := Unit (no extra environment) and ignore the JVP input, since this bridge is only
used for forward evaluation and VJP-based backprop.
Instances For
Erase a RuntimeApprox.RevGraph into executable Autograd.Algebra.GraphData (with Δ := Unit).
This forgets all spec/bound metadata and keeps only the runtime forward and vjp closures.
Instances For
Erasing a RevGraph into executable GraphData preserves the runtime forward semantics.
Informally: if you forget the spec and bound metadata and keep only the runtime closures, you still evaluate to the same runtime context.
Erasing a RevGraph into executable GraphData preserves the runtime backward semantics.
Informally: the executable GraphData.backpropCtx computes the same reverse-mode accumulation as
RevGraph.backpropRuntime when given the same runtime input context and seed cotangents.