code wiki / _hdl_build / nx_prodladder.nx

nx_prodladder.nx

buildroot/runtime/_hdl_build/nx_prodladder.nx

24189 B531 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_prodladder.nx -- SOVEREIGN PRODUCTION-CAPABILITY LADDER (rent -> lease -> buy -> enterprise). Operator, 2026-08-06: "when we get these production capabilities up for these products first rent then buy or cheap then enterprise ... lets get it a reusable process." WHY THIS ORGAN EXISTS. The estate can already price a SHIPMENT (nx_landed_cost, 15/15 GREEN) and score a PRODUCT (nx_product_score). It could not answer the question that actually gates a physical product: AT WHAT VOLUME DOES IT STOP BEING RIGHT TO RENT AND START BEING RIGHT TO BUY? Searched before building -- nx_prim_query over 855 registered primitives returns 0 matches for `capex` and `tooling`, and `production` returns only e-discovery gates. The rung was missing. THE MODEL. Every acquisition tier is the same shape -- a one-time cost amortised over its life, a standing annual cost, and a per-unit cost -- so tiers are COMPARABLE and the ladder is just argmin over them at a given volume: annual(V) = (capex + tooling) / life_years + fixed_annual + per_unit * V The step-up point between two tiers is where those lines cross: V* = ceil( (standingA - standingB) / (per_unitB - per_unitA) ) for per_unitA > per_unitB That crossover IS the reusable process: it turns "when do we buy the machine?" from a judgement call into an arithmetic one, and it is the SAME arithmetic for a rubber dog ball, an injection moulded enclosure, or a PCB run. The ladder is generic; only the plane rows are product-specific. INTEGER-EXACT, NO FLOAT (sovereign law): money in CENTS, volumes in UNITS. Every figure is a pure integer transform of the inputs -- reproducible and hand-checkable, no rounding drift. ★★THE TIER ECONOMICS ARE DATA, NOT CODE. They live in the seg-store plane `knowledge/store/prodladder-`, one row per <process>_<tier>. Adding a process is a plane write (nx_store_put), never a reship -- rule 11, no magic numbers buried in a binary. ★★★AND IF THE PLANE HAS NO ROW, THIS ORGAN REFUSES. It does NOT fall back to a plausible default. A capex ladder that invents its own capex is worse than no ladder at all: it produces a confident break-even volume that someone will spend real money against. nx_product_score already states the estate's law -- "NO fabricated market/cost figures here (operator no-fake-numbers law)" -- and a refusal is the only honest answer to a question we lack the data to answer. The selftest therefore proves the ARITHMETIC on clearly-labelled SYNTHETIC fixtures, and proves the REFUSAL on a process the plane does not carry. Fixtures prove math; the plane carries facts. PLANE ROW (TAB-separated, field 0 = key): <process>_<tier> <tier_name> <capex_c> <tooling_c> <fixed_annual_c> <per_unit_c> <life_years> <max_annual_units|0=unbounded> <note> tier suffixes, cheap -> enterprise: _t0 rent/service-bureau _t1 lease _t2 buy _t3 line

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_seg_store.nx nx_store_seed_lib.nx nx_prodladder.nx

imports: nx_syscalls.nxnx_seg_store.nxnx_store_seed_lib.nx

imported by: nobody (leaf or entry point)

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

main plw sys_write pl_eq pl_selftest sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ pl_chk plw ↻ sys_mmap ↻ pl_lit pl_num sys_write ↻ pl_standing pl_annual pl_standing ↻ pl_breakeven pl_load sts_load sts_gen_note sts_pfxhash ss_max_segid sys_mmap ↻ ss_cat ss_readall ss_segid_ok ss_open_cached

structs

none

consts

50const PL_MAGIC_4000000: i64 = 4000000
51const PL_MAGIC_1200000: i64 = 1200000
52const PL_MAGIC_600000: i64 = 600000
53const PL_MAGIC_1640000: i64 = 1640000
54const PL_MAGIC_800000: i64 = 800000
55const PL_MAGIC_1760000: i64 = 1760000
56const PL_MAGIC_10000: i64 = 10000
57const PL_MAGIC_8000000: i64 = 8000000
58const PL_MAGIC_2840000: i64 = 2840000
59const PL_MAGIC_2412: i64 = 2412
60const PL_MAGIC_5000: i64 = 5000
61const PL_MAGIC_6000: i64 = 6000
62const PL_MAGIC_500000: i64 = 500000
63const PL_MAGIC_1500: i64 = 1500
65const PL_REGBUF: i64 = 65536
66const PL_OUTBUF: i64 = 16384
67const PL_KEYBUF: i64 = 256
68const PL_FLDBUF: i64 = 256
69const PL_NTIER: i64 = 4
70const PL_INFEAS: i64 = 0 - 1 // tier cannot serve this volume (capacity ceiling)
71const PL_NOROW: i64 = 0 - 2 // plane carries no row for this process_tier

functions

73func plw(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 4: pl_calcpl_ramppl_chkmain calls 1: sys_write
75func pl_eq(a: *u8, b: *u8) -> i64
called by 1: main
82func pl_atoi(s: *u8) -> i64
called by 2: pl_rowmain
95func pl_lit(out: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[o + i] = s[i]; i = i + 1 } return o + i }
96func pl_num(out: *u8, o: i64, v: i64) -> i64
110func pl_field0_eq(buf: *u8, n: i64, rs: i64, key: *u8) -> i64
called by 1: pl_field
123func pl_extract(buf: *u8, n: i64, rs: i64, idx: i64, out: *u8, outcap: i64) -> i64
called by 1: pl_field
144func pl_field(buf: *u8, n: i64, key: *u8, idx: i64, out: *u8, outcap: i64) -> i64
called by 1: pl_row calls 2: pl_field0_eqpl_extract
160func pl_load(rbuf: *u8) -> i64 { return sts_load("knowledge/store/prodladder-" as *u8, rbuf, PL_REGBUF) }
called by 3: pl_calcpl_ramppl_selftest calls 1: sts_load
163func pl_mkkey(process: *u8, suffix: *u8, out: *u8) -> i64
called by 1: pl_row
173func pl_tier_suffix(t: i64) -> *u8
called by 1: pl_row
186func pl_standing(capex_c: i64, tooling_c: i64, fixed_annual_c: i64, life_years: i64) -> i64
195func pl_annual(capex_c: i64, tooling_c: i64, fixed_annual_c: i64, per_unit_c: i64,
206func pl_breakeven(standingA: i64, per_unitA: i64, standingB: i64, per_unitB: i64) -> i64
called by 2: pl_ramppl_selftest
218func pl_row(rbuf: *u8, rn: i64, process: *u8, tier: i64, box: *i64, name: *u8, namecap: i64) -> i64
234func pl_calc(process: *u8, vol: i64) -> i64
309func pl_ramp(process: *u8, vols: *i64, nv: i64) -> i64
410func pl_chk(name: *u8, got: i64, want: i64, st: *i64) -> i64
423func pl_selftest() -> i64
506func main(argc: i64, argv: *i64) -> i64