code wiki / (root) / nx_lcg_bench.nx

nx_lcg_bench.nx

buildroot/runtime/nx_lcg_bench.nx

1872 B47 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

about

nx_lcg_bench.nx -- HONEST cross-language grounding bench (NishiLang side). SAME workload as bench_lcg.c: LCG x=x*A+C accumulated over N=1e8 iterations (64-bit wrapping, serial recurrence -> unfoldable/unvectorizable). Prints "acc elapsed_us". acc MUST equal the C/clang/python acc (2849182864005356672) = correctness; elapsed_us vs gcc's 83ms = the real codegen gap. NOT smelling our own farts: this is nx_cc's tight-loop x86_64 codegen measured against gcc -O2. license_tier: ORIGINAL No hw writes (Rule 26). (nx_syscalls_x86_64.nx import REMOVED 2026-07-31, debt 1785528831: this file already gets the canonical syscall layer via nx_clock.nx -> syscalls.nx, so importing the raw-x86 module too put TWO syscall layers in one TU -- every wrapper twice, numbering picked by definition ORDER, silently.)

dependencies 1 imports · 0 importers

nx_clock.nx nx_lcg_bench.nx

imports: nx_clock.nx

imported by: nobody (leaf or entry point)

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

main nx_clock_monotonic_ns sys_mmap sys_clock_gettime_mono lcg_emit_i64

structs

none

consts

none

functions

13func lcg_emit_i64(fd: i64, n: i64) -> i64
called by 1: main
31func main() -> i64