code wiki / _hdl_build / nx_swcompare_bench.nx
nx_swcompare_bench.nx
buildroot/runtime/_hdl_build/nx_swcompare_bench.nx
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
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
structs
| none |
consts
| 12 | const K_MAGIC_5050: i64 = 5050 |
| 13 | const K_MAGIC_4294967296: i64 = 4294967296 |
| 14 | const K_MAGIC_65536: i64 = 65536 |
| 15 | const K_MAGIC_3735928559: i64 = 3735928559 |
| 16 | const K_MAGIC_4294967295: i64 = 4294967295 |
functions
| 18 | func 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 } |
| 19 | func 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 |
| 20 | func wn(fd: i64, v: i64) -> i64 |
| 26 | func wrat(fd: i64, num: i64, den: i64) -> i64 { wn(fd, num); w(fd, "/" as *u8); wn(fd, den); return 0 } |
| 27 | func 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 |
| 29 | func main(argc: i64, argv: *i64) -> i64 |