Runtime link: compileAux + Tape.backwardDenseFrom #
compileAux produces a runtime tape whose node ids correspond to positions in the proof context
Γ ++ ss, and bakes the proved vjp into each node’s runtime backward closure.
The theorem backwardDenseFrom_compileAux_eq_backpropAllCtx states that executing the runtime
reverse-mode loop on this compiled tape matches the proved backpropAllCtx.
All nodes produced by compileAuxData have requires_grad = true.
This is a simplifying invariant: the compiled tape is meant for correctness proofs, so we mark every node as eligible for gradient accumulation (including leaves for inputs).
Pointwise form of compileAuxData_all_requires_grad_true: every node index is requires_grad = true.
This is often more convenient than the .all formulation when reasoning about array indexing.
Backward closure safety for compileAuxData: parent ids produced by any node are strictly smaller
than the node id.
This is the “edges point backwards” invariant required by the runtime reverse loop: when processing
node id, every contribution targets an earlier node (pid < id), so accumulation is well-founded.
All nodes produced by compileAux have requires_grad = true.
This mirrors compileAuxData_all_requires_grad_true for the Graph interface.
Pointwise form of compileAux_all_requires_grad_true.
Backward closure safety for compileAux: parent ids produced by any node are strictly smaller than
the node id.
This mirrors compileAuxData_backward_pids_lt_id for the Graph interface.