code wiki / _hdl_build / nx_race_kernel.nx
nx_race_kernel.nx
buildroot/runtime/_hdl_build/nx_race_kernel.nx
about
nx_race_kernel.nx -- Nishi contestant in the ONGOING race vs C. A representative
CPU-bound integer kernel (LCG mix + xorshift + masked reduction = the shape of
hashing / PRNG / sensor signal work). Pure compute, NO I/O (fair: no syscall
confound in the timed region). Self-times with rdtsc (best-of-3 to cut noise)
and prints "<checksum> <cycles>" so the harness can compare 1:1 against the C
build of the SAME algorithm. The checksum is a bounded reduction (always small
+ positive) so it is byte-identical across the two languages regardless of
signed-print quirks.
Fairness contract (RACING_TEAM_BENCHMARK_DOCTRINE): identical algorithm, same K,
same shift semantics (arithmetic >>), same wrapping 64-bit multiply, same box.
dependencies 1 imports · 0 importers
imports: nx_spore_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
| 14 | const RK_MAGIC_1234567: i64 = 1234567 |
| 15 | const RK_MAGIC_6364136223846793005: i64 = 6364136223846793005 |
| 16 | const RK_MAGIC_1442695040888963407: i64 = 1442695040888963407 |
| 17 | const RK_MAGIC_65535: i64 = 65535 |
| 19 | const RK_K: i64 = 20000000 |
functions
| 22 | func rk_kernel() -> i64 called by 1: main |
| 35 | func rk_emit_dec(v: i64, term: i64) -> i64 |
| 53 | func main() -> i64 |