nx_ir_dump.nx
buildroot/runtime/nx_ir_dump.nx
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
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
| 26 | func _ird_write_i64(v: i64) -> i64 |
| 43 | func _ird_write_str(s: *u8, n: i64) -> i64 calls 1: sys_write |
| 49 | func _ird_dump_instr(f: *Function, i: *Instr, idx: i64) -> i64 |
| 117 | func nx_ir_dump_function(f: *Function, label: *u8) -> i64 |