Kina.ai

Specification

ADR: StoryLM-0 deterministic `argmax`

Context

Phase 0 §8 lists argmax as a reduce op whose result is I64 regardless of input. The bootstrap compiler still rejected the name in reduce_ok. AGENTS.md step 4 asks for deterministic argmax after functional AdamW, then seeded sampling, then KV-cache.

The typed-rule box in Phase 0 writes Tensor[dt, …] for every reduce. The prose overrides that for argmax / argmin. Tie-break was unspecified.

A new argmax keyword would invent surface that already exists as x.reduce(op=argmax, axis=…).

Decision

Specify host argmax in 17-argmax.md:

Do not add sampling or KV-cache in this slice.

Consequences