nx_nofloat_blockfloat_gate.nx
buildroot/runtime/nx_nofloat_blockfloat_gate.nx
about
nx_nofloat_blockfloat_gate.nx -- BLOCK-FLOAT quant rung: per-block power-of-2-scaled integer = MXFP8's
dynamic-range fix, but DETERMINISTIC. "Use it for building": grounded in the operator's banked arithmetic
(knowledge/research/2026-06-24-arithmetic-grounding-blockfloat.md + knowledge/library/arith_fp8_training.txt --
FP8's case against INT8 is dynamic range; MXFP8's fix is per-block(32) power-of-2 scale in E8M0). Power-of-2 =
integer shift = exact + associative, so we get FP8's range advantage WHILE keeping the bit-exact determinism moat.
Proves the FORMAT UPGRADE per-tensor INT8 -> per-block float:
criteria:
1 block-float round-trips the small block EXACTLY (its block scale e=0): reconstructed == original
2 EXCEED (MEASURED): total reconstruction error block-float < per-tensor on a mixed-magnitude tensor
3 DETERMINISTIC: quantize twice -> bit-identical mantissas + scales (vs float MXFP8 non-determinism)
4 per-tensor scaling DESTROYED the small block (-> all 0); block-float PRESERVED it (the super-weight fix)
expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 16 | func bf_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 17 | func bf_putn(v: i64) -> i64 |
| 27 | func bf_chk(name: *u8, ok: i64) -> i64 |
| 31 | func bf_bitlen(x: i64) -> i64 { var b: i64 = 0; var m: i64 = x; while m > 0 { m = m >> 1; b = b + 1 } return b } called by 1: bf_scale |
| 32 | func bf_absdiff(a: i64, b: i64) -> i64 { if a >= b { return a - b } return b - a } called by 1: main |
| 35 | func bf_scale(v: *i64, off: i64, B: i64, M: i64) -> i64 |
| 43 | func main() -> i64 |