code wiki / _hdl_build / nx_eqdispatch_probe.nx
nx_eqdispatch_probe.nx
buildroot/runtime/_hdl_build/nx_eqdispatch_probe.nx
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
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
structs
| none |
consts
| 19 | const EQ_A: i64 = 100 |
| 20 | const EQ_B: i64 = 101 |
| 21 | const EQ_C: i64 = 102 |
functions
| 23 | func eq_w(s: *u8) -> i64 |
| 30 | func eq_pick(v: i64) -> *u8 called by 1: main |
| 37 | func eq_pick_int(v: i64) -> i64 called by 1: main |
| 44 | func eq_wn(v: i64) -> i64 |
| 51 | func main(argc: i64, argv: *i64) -> i64 |