nx_vecexec.nx
buildroot/runtime/nx_vecexec.nx
about
nx_vecexec.nx -- VECTORIZED EXECUTION (vectorized-exec, F-vec). The DuckDB model, single-core: operators
consume/produce COLUMN VECTORS (batches of VX_VEC values) over the zero-copy nx_colframe, instead of a
tuple-at-a-time pipeline that pays operator-dispatch overhead per row. A filter emits a SELECTION VECTOR;
downstream operators gather over it. Batch loops are branch-lean and cache-resident (and the shape a
SIMD backend auto-vectorises). NOT threading -- this is the batch/columnar execution model, provably
single-core. Composes nx_colframe (reads columns as zero-copy views). license_tier: ORIGINAL No hw writes.
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_colframe.nx
imported by: nx_vecexec_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 9 | const VX_MAGIC_12345: i64 = 12345 |
| 10 | const VX_MAGIC_1103515245: i64 = 1103515245 |
| 11 | const VX_MAGIC_4000000: i64 = 4000000 |
| 13 | const VX_VEC: i64 = 1024 // vector (batch) width -- the granularity operators process |
| 14 | const VX_OUT: i64 = 4096 |
| 15 | const VX_ZERO: i64 = 48 |
functions
| 19 | func vx_sum(frame: *u8, ci: i64) -> i64 |
| 34 | func vx_filter_ge(frame: *u8, ci: i64, thr: i64, sel: *i64) -> i64 |
| 49 | func vx_sum_sel(frame: *u8, ci: i64, sel: *i64, nsel: i64) -> i64 |
| 57 | func vx_count_ge(frame: *u8, ci: i64, thr: i64) -> i64 |
| 72 | func vx_sum_where_ge(frame: *u8, sumci: i64, filtci: i64, thr: i64, sel: *i64) -> i64 |
| 78 | func vx_pred_ge(v: i64, thr: i64) -> i64 { if v >= thr { return 1 } return 0 } called by 1: vx_scalar_sum_where_ge |
| 79 | func vx_scalar_sum_where_ge(frame: *u8, sumci: i64, filtci: i64, thr: i64) -> i64 |
| 90 | func vx_raw(out: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[o] = s[i]; o = o + 1; i = i + 1 } return o } called by 1: vx_bench |
| 91 | func vx_num(out: *u8, o: i64, v: i64) -> i64 |
| 103 | func vx_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; var go: i64 = 1; while go == 1 { let c: i64 = s[i] as i64; if c < 48 { go = 0 } else { if c > 57 { go = 0 } else { v = v * 10 + (c - 48); i = i + 1 } } } return v } called by 1: main |
| 105 | func vx_bench(nrows: i64, out: *u8) -> i64 called by 1: main calls 8: sys_mmapcf_encoded_bytescf_encodesys_now_usvx_scalar_sum_where_gevx_sum_where_ge+2 |
| 161 | func main(argc: i64, argv: *i64) -> i64 |