code wiki / _hdl_build / nx_js_h2h_bench.nx

nx_js_h2h_bench.nx

buildroot/runtime/_hdl_build/nx_js_h2h_bench.nx

7812 B155 linesdepth 8pulls 24 transitivereach 0 importersview sourcekind benchtopic js
docsdependenciesstructsconstsfunctions

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

nx_js_vm.nx nx_itoa_lib.nx nx_js_h2h_bench.nx

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

main hb_w hb_case sys_now_us sys_mmap sys_clock_gettime_mono compile_run cr_core jp_parse_source js_lex js_skip_trivia js_lex_one jp_parse_program jp_tok_kind jp_cur jp_err jp_parse_stmt jp_child_commit jp_new_node jp_pst ev_set c_scope_push c_program c_predecl jp_nkind jp_na jp_nb jp_child_at c_newslot ev_tok_start ev_tok_len c_predecl ↻ jp_nextra c_rootslot jp_nc ev_for_body ev_try_finally jp_nb ↻ jp_child_at ↻ jp_nkind ↻

structs

none

consts

11const K_MAGIC_1780: i64 = 1780
12const K_MAGIC_14226: i64 = 14226
13const K_MAGIC_4321: i64 = 4321
14const K_MAGIC_2023: i64 = 2023

functions

16func 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 }
called by 2: hb_casemain
21func hb_n(v: i64) -> i64 { nxi_out(v); return 0 }
called by 2: hb_casemain calls 1: nxi_out
22func hb_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: streq
24func res_str(cell: *i64, buf: *u8) -> i64
50func streq(a: *u8, alen: i64, b: *u8) -> i64
called by 1: hb_case calls 1: hb_slen
57func hb_case(src: *u8, name: *u8, v8us: i64, expect: *u8, tal: *i64, rsum: *i64) -> i64
113func main(argc: i64, argv: *i64) -> i64
calls 3: hb_whb_casehb_n