A loss in bits
You will learn
How the loss -log2(p) prices a guess in bits, and why a perfect guess must cost exactly 0.
Training starts with a number for how wrong a guess was. gft_nll.t27 takes p, the probability the model gave the true class, and returns -log2(p): p = 1.0 costs 0, p = 0.5 costs 1 bit, and p = 0.25 costs 2. on_comb is neg(log2v(p)), and neg flips the sign bit, except that it returns 0 for 0. One header line still says the output is log2(x); the code returns its negative. The browser skips all 3 tests because its runner does not know assert_eq yet; the native t27c runs all 3, all pass, none vacuous. The recording runs t27c test-report, then a one-line sed that makes neg return 65536 for 0, a zero with the sign bit set, and t27c test-report again: exactly one test fails, perfect. git checkout puts the line back, and sha256sum prints the same hash as before the edit. Every byte in the recording was printed by the command; only the typing is staged.