code wiki / (root) / nx_bench_collatz.nx

nx_bench_collatz.nx

buildroot/runtime/nx_bench_collatz.nx

2205 B57 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind benchtopic bench
docsdependenciesstructsconstsfunctions

about

nx_bench_collatz.nx -- NishiLang twin of bench/xlang/collatz.c (branch-heavy). Max Collatz stopping-time over [1,N) + XOR step checksum. Prints checksum then elapsed_us. Checksum MUST equal the gcc AND clang builds (3rd-party oracles). 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 transitively via nx_clock.nx -> syscalls.nx. Importing nx_syscalls_x86_64.nx as well put TWO syscall layers in one translation unit: every wrapper defined twice, one against RAW x86 numbers and one against the @ifndef TARGET_X86_64 RV64 numbers the backend translates at emit (SYS_POLL 7 vs 73). nx_cc accepted the redefinition silently and let definition ORDER pick the numbering.)

dependencies 1 imports · 0 importers

nx_clock.nx nx_bench_collatz.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 bc_emit_i64

structs

none

consts

12const K_MAGIC_3000000: i64 = 3000000
13const K_MAGIC_2654435761: i64 = 2654435761
14const K_MAGIC_1000003: i64 = 1000003

functions

16func bc_emit_i64(fd: i64, n: i64) -> i64
called by 1: main
34func main() -> i64