code wiki / _hdl_build / nx_race_kernel.nx

nx_race_kernel.nx

buildroot/runtime/_hdl_build/nx_race_kernel.nx

2547 B69 linesdepth 1pulls 1 transitivereach 0 importersview sourcekind tooltopic race
docsdependenciesstructsconstsfunctions

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

nx_spore_syscalls.nx nx_race_kernel.nx

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

main rk_kernel rk_emit_dec sys_mmap sys_write sys_exit

structs

none

consts

14const RK_MAGIC_1234567: i64 = 1234567
15const RK_MAGIC_6364136223846793005: i64 = 6364136223846793005
16const RK_MAGIC_1442695040888963407: i64 = 1442695040888963407
17const RK_MAGIC_65535: i64 = 65535
19const RK_K: i64 = 20000000

functions

22func rk_kernel() -> i64
called by 1: main
35func rk_emit_dec(v: i64, term: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
53func main() -> i64