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:
- Result dtype is
I64(Phase 0 prose). - Tie-break is lowest index (NumPy / PyTorch; strict
ogt/sgtso equals keep the old index). - Admissibility matches
reduce max(floating + signed int). - Host-only; device rejected at type-check.
- No VJP.
argminstays unimplemented.
Do not add sampling or KV-cache in this slice.
Consequences
- Greedy token ids type-check and lower on the host.
- Visitors can compile
storylm0_greedy.kina; they still cannot generate text or sample. - Sampling, KV-cache, device
argmax, andargminremain follow-on work.