code wiki / _hdl_build / nx_eff_board_lib.nx

nx_eff_board_lib.nx

buildroot/runtime/_hdl_build/nx_eff_board_lib.nx

29265 B374 linesdepth 5pulls 7 transitivereach 2 importersview sourcekind librarytopic eff
docsdependenciesstructsconstsfunctions

about

nx_eff_board_lib.nx -- shared core for the efficiency / ROI-investment board (eff lane F732). Split lib+CLI+gate like nx_pm_roi_lib (D001 gate-able). Reads the eff- plane (measured spend rows seeded laptop-side by nx_eff_scan) + the roi- plane (value, same plane the pm-cockpit reads), converts via nx_eff_lib's DECLARED coefficients, emits JSON/HTML. Fail-closed: unseeded -> UNSEEDED, no fabricated spend. This is the COST/INVESTMENT half of ROI (value half = nx_pm_cockpit). license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 2 importers

nx_eff_conv.nx nx_store_seed_lib.nx nx_eff_board_lib.nx nx_eff_board.nx nx_eff_board_gate.nx

imports: nx_eff_conv.nxnx_store_seed_lib.nx

imported by: nx_eff_board.nxnx_eff_board_gate.nx

structs

none

consts

9const EB_MAGIC_3600: i64 = 3600
10const EB_MAGIC_1000000: i64 = 1000000
12const EB_PLANE_CAP: i64 = 524288
13const EB_OUT_CAP: i64 = 262144
14const EB_MAXCOL: i64 = 16
15const EB_MONTH_DAYS: i64 = 30
16const EB_TAB: i64 = 9
17const EB_NL: i64 = 10
18const EB_HASH: i64 = 35
19const EB_ZERO: i64 = 48
20const EB_NINE: i64 = 57
21const EB_HTMLH: i64 = 104
22const EB_MAXDAYS: i64 = 28
23const M_ACT: i64 = 0
24const M_SEC: i64 = 1
25const M_TIN: i64 = 2
26const M_TOUT: i64 = 3
27const M_TCR: i64 = 4
28const M_TCW: i64 = 5
29const M_DAYS: i64 = 6
30const M_WIN: i64 = 7
31const M_TRUNC: i64 = 8
32const M_TRF: i64 = 9
33const M_GEN: i64 = 10
34const M_MCP: i64 = 11
35const M_SH: i64 = 12
36const M_FILE: i64 = 13
37const M_AVAIL: i64 = 14
38const M_ROIAV: i64 = 15
39const M_ROICENTS: i64 = 16
40const M_MODBASE: i64 = 20 // 20 slots: m[M_MODBASE + tier*4 + class] (class 0=in 1=out 2=cr 3=cw)
41const M_MODSEEN: i64 = 40 // 1 if per-model rows present -> real cost available

functions

43func eb_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
44func eb_cols(buf: *u8, ls: i64, le: i64, sp: *i64) -> i64
59func eb_slice_int(buf: *u8, a: i64, b: i64) -> i64
65func eb_slice_eq(buf: *u8, a: i64, b: i64, lit: *u8) -> i64
called by 1: eb_eff_scan calls 1: eb_len
72func eb_is_dayrow(buf: *u8, a: i64, b: i64) -> i64
called by 1: eb_eff_scan
80func eb_modrow_tier(buf: *u8, a: i64, b: i64) -> i64
called by 1: eb_eff_scan
91func eb_realcost(m: *i64) -> i64
103func eb_cost_per_action(cost: i64, actions: i64) -> i64 { if actions <= 0 { return 0 } return cost / actions }
106func eb_cache_ratio_pct(m: *i64) -> i64
111func eb_eff_scan(buf: *u8, n: i64, m: *i64) -> i64
156func eb_roi_value(buf: *u8, n: i64, m: *i64) -> i64
called by 2: mainmain calls 2: eb_colseb_slice_int
179func eb_money(d: *u8, o: i64, cents: i64) -> i64
called by 1: eb_emit_html
191func eb_monthly(v: i64, win: i64) -> i64 { if win <= 0 { return v } return v * EB_MONTH_DAYS / win }
193func eb_emit_json(out: *u8, m: *i64) -> i64
280func eb_emit_html(out: *u8, m: *i64) -> i64