code wiki / (root) / nx_ir_dump.nx

nx_ir_dump.nx

buildroot/runtime/nx_ir_dump.nx

5829 B155 linesdepth 2pulls 3 transitivereach 4 importersview sourcekind librarytopic ir
docsdependenciesstructsconstsfunctions

about

nx_ir_dump.nx -- bits-up IR-dump primitive for self-host bootstrap-divergence diagnosis. Writes one stderr line per IR instruction in a function: "IR f=<name> op=<N> n=<N> r=<VID> kind=<K> ci=<CI> o0=<V> o1=<V>" Each line is fixed-width hex-ish so RV64-qemu and native-x86_64 traces can be byte-compared via `diff` to pinpoint the exact transformation that differs. Usage: invoke once per function between parse_module and x86ctx_emit_module, then run the same source through both lanes and `diff -u rv64.trace native.trace`. The first diverging line names the buggy instruction. 3-step usage: 1. cat repro.nx | qemu-riscv64-static _offc/nx_compile_x86.elf 2>rv64.trace >/dev/null 2. cat repro.nx | _offc/nx_compile_x86_native.elf 2>native.trace >/dev/null 3. diff -u rv64.trace native.trace | head -20

dependencies 2 imports · 4 importers

nx_syscalls.nx nx_types.nx nx_ir_dump.nx nx_compile_wat.nx nx_compile_x86.nx nx_vcc_color_wat.nx nx_vcc_probe_wat.nx

imports: nx_syscalls.nxnx_types.nx

imported by: nx_compile_wat.nxnx_compile_x86.nxnx_vcc_color_wat.nxnx_vcc_probe_wat.nx

structs

none

consts

none

functions

26func _ird_write_i64(v: i64) -> i64
43func _ird_write_str(s: *u8, n: i64) -> i64
calls 1: sys_write
49func _ird_dump_instr(f: *Function, i: *Instr, idx: i64) -> i64
117func nx_ir_dump_function(f: *Function, label: *u8) -> i64