Context
AGENTS.md step 4 asks for functional SGD before AdamW. Section 10 can
build NLL cotangents but cannot return them from @main. A training
loop still needs a specified parameter update.
A new sgd primitive would invent fusion and mutability that the
numbered specs do not define.
Decision
Specify SGD as the existing composition in
11-functional-sgd.md:
w' = w - lr.broadcast(shape(w)) * g
No new surface form, IR constructor, or FFI. Examples take w and g
as explicit tensors. Do not compose this slice with reverseMode
returns. Do not add AdamW.
Consequences
sgd_step.kinaand a.sonumeric check land without compiler-pass changes.- Visitors can see a typed update; they still cannot train a model end-to-end in Kina.
- Schedules remain follow-on work. AdamW is specified in Section 16.