code wiki / (root) / nx_eqprobe.nx

nx_eqprobe.nx

buildroot/runtime/nx_eqprobe.nx

4119 B66 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_eqprobe.nx -- MINIMAL REPRO for the suspected `if v == CONST` compiling as `if v > CONST` (debt 1785530065, found in nx_mcu_ready.nx rdy_reason). Deliberately tiny and self-contained: its own puts, its own 4-branch dispatch, no shared helpers, so nothing but the compiler can explain a wrong answer. THE DISCRIMINATOR IS pick(999): 999 matches NO branch, so a correct compiler MUST return "D". If equality is emitted as greater-than, 999 > 100 is true and it returns "A". EXPECTED (correct): 100->A 101->B 102->C 999->D EXPECTED (== behaves as >): 100->D 101->A 102->A 999->A VARIANT KNOB: this file currently imports ONLY nx_syscalls. The broken rdy_reason lives in a file that imports TWO further modules, while the WORKING mf_reason imports only nx_syscalls -- so import count is the leading candidate trigger. Re-run this probe after adding those imports to A/B the hypothesis. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_mcu_fit.nx nx_mcu_brick.nx nx_eqprobe.nx

imports: nx_syscalls.nxnx_mcu_fit.nxnx_mcu_brick.nx

imported by: nobody (leaf or entry point)

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

main eq_p sys_write eq_len eq_pick

structs

none

consts

24const EQ_A: i64 = 100
25const EQ_B: i64 = 101
26const EQ_C: i64 = 102

functions

28func eq_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: eq_p
29func eq_p(s: *u8) -> i64 { sys_write(1, s, eq_len(s)); return 0 }
called by 1: main calls 2: sys_writeeq_len
37func eq_pick(v: i64) -> *u8
called by 1: main
44func main() -> i64
calls 2: eq_peq_pick