code wiki / _hdl_build / nx_swcompare_bench.nx

nx_swcompare_bench.nx

buildroot/runtime/_hdl_build/nx_swcompare_bench.nx

18250 B230 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind benchtopic swcompare
docsdependenciesstructsconstsfunctions

about

nx_swcompare_bench.nx -- RUN-AND-COMPARE bench (the deepest form of "mechanically test and bench"): instead of symbol-presence, it IMPORTS a real Nishi organ, RUNS it on known inputs, and compares OUR computed output to the mathematically-correct answer (identical to what Wolfram / any correct CAS produces). Domain 1 = EXACT RATIONAL arithmetic (nx_rational). Each row shows input -> Nishi's value vs the correct value -> PASS/FAIL. Liar-killed: all real KATs must pass AND a NEG-CONTROL (checked against a deliberately-wrong answer) must FAIL (proves the check discriminates). Modes: no-arg = console + gate; "html" = /compare/computational/bench page. NOTE: no '#'/'!' in string literals (nx_cc trap) -> rgb() + emit '!' byte. license_tier: ORIGINAL expect_exit:0

dependencies 4 imports · 0 importers

nx_rational.nx nx_poly.nx nx_matrix.nx nx_bigint_lib.nx nx_swcompare_bench.nx

imports: nx_rational.nxnx_poly.nxnx_matrix.nxnx_bigint_lib.nx

imported by: nobody (leaf or entry point)

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

main streq rat_new sys_mmap rat_set rat_norm rat_gcd rat_add rat_norm ↻ rat_mul rat_norm ↻ rat_gcd ↻ nx_poly_mul nx_poly_derivative nx_poly_eval nx_poly_add nx_poly_power_sum nx_matrix_alloc nx_matrix_set nx_matrix_multiply nx_matrix_get nx_matrix_set ↻ nx_matrix_get ↻ nx_matrix_det_2x2 nx_matrix_get ↻ nx_matrix_det_3x3 nx_matrix_get ↻ nx_matrix_transpose nx_matrix_alloc ↻ nx_matrix_set ↻ nx_matrix_get ↻ bi_zero bi_add bi_mul bi_zero ↻ bi_from_bytes_be bi_zero ↻ w wc wrat

structs

none

consts

12const K_MAGIC_5050: i64 = 5050
13const K_MAGIC_4294967296: i64 = 4294967296
14const K_MAGIC_65536: i64 = 65536
15const K_MAGIC_3735928559: i64 = 3735928559
16const K_MAGIC_4294967295: i64 = 4294967295

functions

18func w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 3: wnwratmain
19func wc(fd: i64, code: i64) -> i64 { let t: *u8 = sys_mmap(2); t[0] = code as u8; sys_write(fd, t, 1); return 0 }
called by 1: main
20func wn(fd: i64, v: i64) -> i64
called by 2: wratmain calls 1: w
26func wrat(fd: i64, num: i64, den: i64) -> i64 { wn(fd, num); w(fd, "/" as *u8); wn(fd, den); return 0 }
called by 1: main calls 2: wnw
27func streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 }
called by 1: main
29func main(argc: i64, argv: *i64) -> i64