_q8blkdot_minrepro.nx
buildroot/runtime/_q8blkdot_minrepro.nx
about
_q8blkdot_minrepro.nx -- the feature program for __q8blk_i16dot (search R0s-b, 2026-09-17): one Q8_0 block's dot,
codes:*i8[32] . x:*i16[32] -> i64, the int8 codes sign-extended IN REGISTER (vpmovsxbw) so the block-native kernel
never stores an i16 copy of the weights.
nx_cc_equiv_gate builds this with the CHALLENGER only (a baseline that lacks the builtin cannot), runs it, and
requires exit 0. Every arm is checked against an exact scalar reference read back from the same bytes:
exit 1 = the 32-lane signed ramp disagrees with the scalar sum
exit 2 = a planted +1 in one code lane does not move the dot by exactly that lane of x (a lane was skipped)
exit 3 = a planted +1 in one x lane does not move the dot by exactly that lane's code (the other operand)
exit 4 = the reference is zero (a vacuous fixture; the ramps are built so it cannot be)
exit 5 = the widest legal block (every code 127, every x 32767) disagrees: 32 * 127 * 32767 = 133,153,088
exit 6 = the most negative code (-128) against the most negative x (-32768) disagrees: the sign extension is
two's complement on both sides, 32 * 4,194,304 = 134,217,728
The contract the builtin holds the caller to: exactly 32 lanes, codes are int8 two's complement, x is i16.
expect_exit: 0
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 21 | const MR_LANES: i64 = 32 |
| 22 | const MR_HALF: i64 = 16 |
| 23 | const MR_PLANT: i64 = 21 |
| 24 | const MR_I16_MOD: i64 = 65536 |
| 25 | const MR_I16_HALF: i64 = 32768 |
| 26 | const MR_BYTE: i64 = 256 |
| 27 | const MR_I8_HALF: i64 = 128 |
| 28 | const MR_CODE_MAX: i64 = 127 |
| 29 | const MR_CODE_MIN: i64 = 0 - 128 |
| 30 | const MR_X_MAX: i64 = 32767 |
| 31 | const MR_X_MIN: i64 = 0 - 32768 |
| 32 | const MR_X_STEP: i64 = 1000 |
functions
| 34 | func mr_put16(p: *u8, i: i64, v: i64) -> i64 { var u: i64 = v; if u < 0 { u = u + MR_I16_MOD } p[i*2] = (u % MR_BYTE) as u8; p[i*2+1] = ((u / MR_BYTE) % MR_BYTE) as u8; return 0 } called by 1: main |
| 35 | func mr_get16(p: *u8, i: i64) -> i64 { var u: i64 = (p[i*2] as i64) + (p[i*2+1] as i64) * MR_BYTE; if u >= MR_I16_HALF { u = u - MR_I16_MOD } return u } |
| 36 | func mr_put8(p: *u8, i: i64, v: i64) -> i64 { var u: i64 = v; if u < 0 { u = u + MR_BYTE } p[i] = (u % MR_BYTE) as u8; return 0 } called by 1: main |
| 37 | func mr_get8(p: *u8, i: i64) -> i64 { var u: i64 = (p[i] as i64) & 0xff; if u >= MR_I8_HALF { u = u - MR_BYTE } return u } |
| 38 | func mr_ref(codes: *u8, x: *u8) -> i64 { var s: i64 = 0; var i: i64 = 0; while i < MR_LANES { s = s + mr_get8(codes, i) * mr_get16(x, i); i = i + 1 } return s } |
| 40 | func main() -> i64 |