nx_distexec.nx
buildroot/runtime/nx_distexec.nx
about
nx_distexec.nx -- DISTRIBUTED EXECUTION ALGEBRA (distributed-compute, F-dist). Spark's essence is not
the cluster -- it is the PARTITION -> MAP -> MERGE algebra: split the data into partitions, compute a
PARTIAL result per partition, then MERGE the partials into the whole answer. That algebra is provable and
buildable single-process from the first byte up; only its PARALLEL execution (a partition per worker
core/node) needs the threading/swarm arc. This organ is the algebra, proven PARTITION-INVARIANT: the
merged result is byte-identical for ANY partition count P, which is exactly the correctness a scheduler
relies on to run partitions anywhere. Composes nx_vecexec (each partition aggregates vectorized) over the
zero-copy nx_colframe. Honest: this is the algebra + a sequential executor; real multi-core/multi-node
parallelism is the named finer gap. license_tier: ORIGINAL No hardware writes (Rule 26).
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_colframe.nx
imported by: nx_distexec_gate.nxnx_parexec.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const DE_MAGIC_4242: i64 = 4242 |
| 13 | const DE_MAGIC_1103515245: i64 = 1103515245 |
| 14 | const DE_MAGIC_12345: i64 = 12345 |
| 15 | const DE_MAGIC_100000: i64 = 100000 |
| 16 | const DE_MAGIC_4000000: i64 = 4000000 |
| 18 | const DE_VEC: i64 = 1024 |
| 19 | const DE_MAXK: i64 = 256 // group-by key domain cap (buckets) |
| 20 | const DE_OUT: i64 = 8192 |
| 21 | const DE_ZERO: i64 = 48 |
| 23 | const DE_SUM: i64 = 0 |
| 24 | const DE_CNT: i64 = 1 |
| 25 | const DE_MIN: i64 = 2 |
| 26 | const DE_MAX: i64 = 3 |
functions
| 29 | func de_agg_range(frame: *u8, ci: i64, lo: i64, hi: i64, out4: *i64) -> i64 |
| 57 | func de_merge(a: *i64, b: *i64) -> i64 |
| 73 | func de_bound(n: i64, P: i64, p: i64) -> i64 |
| 78 | func de_run_agg(frame: *u8, ci: i64, P: i64, out4: *i64) -> i64 |
| 99 | func de_gb_range(frame: *u8, keyci: i64, valci: i64, lo: i64, hi: i64, buckets: *i64, K: i64) -> i64 |
| 110 | func de_run_groupby(frame: *u8, keyci: i64, valci: i64, K: i64, P: i64, buckets: *i64) -> i64 |
| 133 | func de_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: de_demo |
| 134 | func de_num(out: *u8, o: i64, v: i64) -> i64 |
| 146 | func de_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 |
| 149 | func de_demo(nrows: i64, P: i64, out: *u8) -> i64 |
| 197 | func main(argc: i64, argv: *i64) -> i64 |