Kina.ai

Specification

ADR: Tuple projection for reverseMode results

Context

Section 12 makes handle f(w) with reverseMode a flat tuple (primal, g…), observable from a host .so. Section 11 still takes g as an explicit argument. There is no way to name g inside .kina.

A new tensor operator (fst, get, proj) would invent indexing semantics the numbered specs do not define. The SSA list is already flat after Section 12.

Decision

Specify destructuring let in 13-tuple-projection.md:

let (y, g) = handle f(w) with reverseMode in
w - lr.broadcast(σ) * g

IR constructor LetTuple. No tuple.get, no nested patterns, no AD through the pattern. Projection sits outside the differentiated function.

Consequences