code wiki / (root) / nx_argcall_repro.nx

nx_argcall_repro.nx

buildroot/runtime/nx_argcall_repro.nx

2530 B66 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_argcall_repro.nx -- MINIMAL fast repro of the chat-template crash: a 10-arg function (same arg SHAPE as tk_bpe_encode: buf, 4 array-subscript i64s, a string-literal *u8, an ilen, 2 scratch *i64, an out *i64) called TWICE in one function. No model load -> iterate in seconds. If the 2nd call crashes/miscompiles, the bug is call-site codegen for repeated 10-arg calls (eat-the-debt: root-fix nx_cc). If both calls print correct sums, the bug is in tk_bpe_encode's body under 2nd-call conditions instead. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_lib_std.nx nx_argcall_repro.nx

imports: nx_syscalls.nxnx_lib_std.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap std_puts std_slen sys_write rp_enc std_pdec sys_mmap ↻ std_itoa sys_mmap ↻ sys_write ↻ std_putln std_puts ↻ sys_exit

structs

none

consts

10const K_MAGIC_16384: i64 = 16384
11const K_MAGIC_4096: i64 = 4096

functions

13func rp_enc(buf: *u8, a: i64, b: i64, c: i64, d: i64, input: *u8, ilen: i64, p: *i64, q: *i64, ids: *i64) -> i64
called by 1: main
25func main(argc: i64, argv: *i64) -> i64