nx_mcu_fit.nx
buildroot/runtime/nx_mcu_fit.nx
about
nx_mcu_fit.nx -- does a model config fit a specific MCU's memory hierarchy? Pure decision logic.
THE ONE RULE THAT MAKES THIS HONEST: an UNMEASURED resource is REFUSED, never assumed. mcu_targets.conf
carries -1 for every field we have not put on a bench, and a -1 must never be silently treated as 0
(infinite room) or as a datasheet guess. If we cannot decide, we say so and name the field to go measure.
That is what makes this organ useful for hardware bring-up rather than merely decorative: pointing it at
an unmeasured board returns a WORK ORDER, not a verdict.
The second rule, inherited from the memfloor incident: REFUSE, NEVER SILENTLY SHRINK. An allocator that
quietly reduces a grid to make it fit froze every seat's builds for minutes. So there is no "nearest
fitting config" return path here -- the caller is told which wall it hit and decides.
Resource model, matching how a PLE-style model actually lands on an ESP32-S3:
dense core -> internal SRAM (fast, tiny, the real constraint that sizes the model)
weights+table-> SPI flash (large, slow, XIP / memory-mapped)
KV + scratch -> PSRAM (medium, bandwidth-bound)
Checks run in that order so the BINDING constraint reported is the tightest real one, deterministically.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_eqprobe.nxnx_mcu_fit_gate.nxnx_mcu_ready.nx
structs
| none |
consts
| 21 | const MF_FIT: i64 = 0 |
| 22 | const MF_REFUSE_SRAM: i64 = 1 |
| 23 | const MF_REFUSE_FLASH: i64 = 2 |
| 24 | const MF_REFUSE_PSRAM: i64 = 3 |
| 25 | const MF_REFUSE_UNMEASURED: i64 = 4 |
| 26 | const MF_UNMEASURED: i64 = 0 - 1 |
| 27 | const MF_KB: i64 = 1024 |
| 28 | const MF_MB: i64 = 1048576 |
functions
| 30 | func mf_reason(v: i64) -> *u8 |
| 39 | func mf_core_bytes(params: i64, bits: i64) -> i64 called by 1: main |
| 47 | func mf_admit(sram_kb: i64, psram_mb: i64, flash_mb: i64, |