code wiki / _hdl_build / nx_nofloat_linattn_gate.nx

nx_nofloat_linattn_gate.nx

buildroot/runtime/_hdl_build/nx_nofloat_linattn_gate.nx

4035 B100 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_linattn_gate.nx -- gate for the no-float linear-attention recurrent kernel (KDA foundation). T1 recurrent output MATCHES the direct linear-attention formula o_t = sum_{s<=t}(q_t.k_s) v_s T2 CAUSAL: o_t depends only on s<=t (truncating the sequence at t leaves o_t unchanged) T3 O(1)-memory state accumulates correctly (S after T = sum k_s (x) v_s) T4 DETERMINISTIC bit-identical (the exceed: float linear-attn drifts by accumulation order) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_nofloat_linattn.nx nx_gate_verdict.nx nx_syscalls.nx nx_nofloat_linattn_gate.nx

imports: nx_nofloat_linattn.nxnx_gate_verdict.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr sys_mmap gv_head gv_puts sys_write sys_mmap ↻ la_forward sys_mmap ↻ la_zero la_accum la_readout lg_direct gv_check gv_puts ↻ la_zero ↻ la_accum ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat sys_write ↻ sys_close sys_munmap ↻ sys_exit

structs

none

consts

11const LG_T: i64 = 4
12const LG_D: i64 = 4
13const LG_Q: i64 = 65536
14const LG_QBITS: i64 = 16

functions

17func lg_direct(qm: *i64, km: *i64, vm: *i64, om: *i64, t: i64, d: i64) -> i64
called by 1: main
41func main() -> i64