code wiki / _hdl_build / nx_js_h2h_bench.nx
nx_js_h2h_bench.nx
buildroot/runtime/_hdl_build/nx_js_h2h_bench.nx
about
nx_js_h2h_bench.nx -- HEAD-TO-HEAD: our sovereign VM/JIT vs V8 (node v22) on the SAME compute kernels,
SAME machine. Kernels are the pure-compute subset our engine runs (no regex/prototypes/classes -> why we
can't run full Octane yet). V8 numbers measured on THIS box (node, best-of-5, us) embedded as the ref so
this gate prints the REAL cross-engine ratio -- NOT a vs-our-own-tree-walker number. EACH kernel's result
is VERIFIED against V8's (stringified compare): a mismatch = FAIL (no ratio) and forces RED, so we can
never report a ratio on a broken run. Kernel SIZES were chosen so BOTH engines complete; the limits our
engine hit at larger sizes (array cap ~4096, call-count arena exhaustion ~fib27) are reported honestly.
expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_js_vm.nxnx_itoa_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
| 11 | const K_MAGIC_1780: i64 = 1780 |
| 12 | const K_MAGIC_14226: i64 = 14226 |
| 13 | const K_MAGIC_4321: i64 = 4321 |
| 14 | const K_MAGIC_2023: i64 = 2023 |
functions
| 16 | func hb_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 21 | func hb_n(v: i64) -> i64 { nxi_out(v); return 0 } |
| 22 | func hb_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: streq |
| 24 | func res_str(cell: *i64, buf: *u8) -> i64 |
| 50 | func streq(a: *u8, alen: i64, b: *u8) -> i64 |
| 57 | func hb_case(src: *u8, name: *u8, v8us: i64, expect: *u8, tal: *i64, rsum: *i64) -> i64 |
| 113 | func main(argc: i64, argv: *i64) -> i64 |