code wiki / (root) / nx_bench_spectral.nx

nx_bench_spectral.nx

buildroot/runtime/nx_bench_spectral.nx

3815 B124 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind benchtopic bench
docsdependenciesstructsconstsfunctions

about

nx_bench_spectral.nx -- NishiLang twin of bench/xlang/spectral.c (spectral-norm, Computer Language Benchmarks Game). FIRST FLOAT (f64) racing-bench workload, proving the 2026-07-16 f64 codegen on a real 3rd-party task. N=100, published answer 1.274219991 -> line 1 = eigenvalue*1e9 truncated (1274219991), line 2 = us. f64 values ride as i64 bit-patterns in i64 arrays; scalars are `f64`. Structurally identical scalar operations to the C twin (Newton sqrt, same reduction order) so nx/gcc/clang agree bit-for-bit at 9-digit truncation. 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_bench_spectral.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 sp_AtA_times_u sp_A_times_u sp_eval_A sp_At_times_u sp_eval_A ↻ sp_sqrt sp_emit_i64

structs

none

consts

15const SN_N: i64 = 100

functions

17func sp_emit_i64(fd: i64, n: i64) -> i64
called by 1: main
36func sp_eval_A(i: i64, j: i64) -> f64
42func sp_A_times_u(u: *i64, Au: *i64) -> i64
called by 1: sp_AtA_times_u calls 1: sp_eval_A
59func sp_At_times_u(u: *i64, Au: *i64) -> i64
called by 1: sp_AtA_times_u calls 1: sp_eval_A
76func sp_AtA_times_u(u: *i64, AtAu: *i64, tmp: *i64) -> i64
called by 1: main calls 2: sp_A_times_usp_At_times_u
83func sp_sqrt(x: f64) -> f64
called by 1: main
90func main() -> i64