code wiki / _hdl_build / nx_eqdispatch_probe.nx

nx_eqdispatch_probe.nx

buildroot/runtime/_hdl_build/nx_eqdispatch_probe.nx

2315 B68 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind probe
docsdependenciesstructsconstsfunctions

about

nx_eqdispatch_probe.nx -- DECISIVE MINIMAL REPRO for debt 1785530065 (2232): "nx_cc compiles == as >" in a multi-branch i64 equality dispatch returning STRING LITERALS. WHY THIS SHAPE: the reported subject (nx_mcu_ready.rdy_reason) is a 4-branch if-chain comparing an i64 against module consts and RETURNING a string literal from each arm. This probe isolates exactly that and NOTHING else -- no imports beyond syscalls, no structs, no loops around the dispatch. THE DISCRIMINATOR: eq_pick(999) matches NO branch, so a correct compiler returns the fallthrough D. If == is emitted as >, then 999 > 100 is TRUE and the FIRST arm wins. CORRECT : D A B C D ==-as-> : A A A A A The INT-ARM control separates "equality codegen broken" from "string-return dispatch broken". LOCAL RESULT 2026-08-01 (laptop nxc2 toolchain, elf 11207B): STRING-ARM=DABCD INT-ARM=41234 -- BOTH CORRECT, i.e. the general claim is REFUTED under that compiler. This NAS copy exists to close the scope gap, because the two toolchains have diverged before and a refutation on one proves nothing about the other. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_eqdispatch_probe.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main eq_w sys_write eq_pick eq_wn sys_mmap sys_write ↻ eq_pick_int

structs

none

consts

19const EQ_A: i64 = 100
20const EQ_B: i64 = 101
21const EQ_C: i64 = 102

functions

23func eq_w(s: *u8) -> i64
called by 1: main calls 1: sys_write
30func eq_pick(v: i64) -> *u8
called by 1: main
37func eq_pick_int(v: i64) -> i64
called by 1: main
44func eq_wn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
51func main(argc: i64, argv: *i64) -> i64