nx_eqprobe.nx
buildroot/runtime/nx_eqprobe.nx
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
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
structs
| none |
consts
| 24 | const EQ_A: i64 = 100 |
| 25 | const EQ_B: i64 = 101 |
| 26 | const EQ_C: i64 = 102 |
functions
| 28 | func 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 |
| 29 | func eq_p(s: *u8) -> i64 { sys_write(1, s, eq_len(s)); return 0 } |
| 37 | func eq_pick(v: i64) -> *u8 called by 1: main |
| 44 | func main() -> i64 |