feat(spec): GF-T argmax classification head — 4 logits to class index (Refs #1764) - #1801
Conversation
PR DashboardGenerated at: 2026-08-06 15:37:34 UTC
Summary
Seal Status
|
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
|
⏳ Merge deferred — GitHub Actions infrastructure incident, not a code issue. The Locally verified independently of CI:
No |
specs/ternary/gft_argmax4.t27 (GftArgmax4): four signed GF-T16 logits -> the
index {0,1,2,3} of the maximum real value (lowest index wins ties, strict >).
The final stage of a GF-T classifier: gft_mlp3 emits logits, argmax picks the
predicted class. No arithmetic -- a total order on the GF-T encoding: the low 16
bits (offset<<9 | mant) are monotonic in real magnitude and raw 0 is the only
zero, so negatives < zero < positives. gt(a,b) via a 3-way sign category.
Bit-exact to the ideal exact-float64 argmax over 400 vectors
(tests/gft_argmax4_vectors.txt), iverilog $fscanf. Vectors (incl. injected exact
zeros) emitted only where the integer comparator AND the float argmax agree
(0/400 disagreements). Completes the end-to-end GF-T classifier.
No compiler change (on_comb, 4 ports). Fresh seal (seal --verify MATCH).
Refs #1764
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
07a9517 to
294179e
Compare
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
1 similar comment
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
What
specs/ternary/gft_argmax4.t27(GftArgmax4) — a spec-first classification head over four signed GF-T16 logits → the index {0,1,2,3} of the maximum real value (lowest index wins ties, strict>).This is the final stage of a GF-T classifier:
gft_mlp3emits a vector of logits, argmax picks the predicted class. No arithmetic — just a total order on the GF-T encoding: the low 16 bits (offset<<9 | mant) are monotonic in the real magnitude and raw 0 is the only zero, so the order isnegatives < zero < positives(positives by ascending bits, negatives by descending bits).gt(a,b)uses a 3-way sign category (neg=0, zero=1, pos=2).Verification
float64argmax over 400 vectors (tests/gft_argmax4_vectors.txt), iverilog$fscanfinbootstrap/tests/gft_argmax4.rs.tests: pick-positive, pick-last, zero-beats-negatives, tie-lowest-index.on_comb, 4 ports). Fresh seal (seal --verify→ all MATCH).Completes the end-to-end GF-T classifier: activations → MLP → logits → argmax → class.
Refs #1764
🤖 Generated with Claude Code