code wiki / _hdl_build / nx_leasemine.nx

nx_leasemine.nx

buildroot/runtime/_hdl_build/nx_leasemine.nx

16507 B345 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_leasemine.nx -- LEASES-CLASS MINER over the claims journal (miner-sota F1017, 2026-07-23). The census (nx_minecov MC04) measured leases COVERED-but-UNMINED: nx_claims walk derives CURRENT holder/TTL state, but nobody mines the HISTORY. This derives what a point-in-time walk cannot: ORPHANED = CLAIMs with no matching RELEASE (the F214 crash-lease signal, per resource) CONTENDED = a resource claimed by MORE THAN ONE distinct actor (where lanes actually collide) CHURN = claims per resource, ranked; plus hold-time (avg/max) from matched CLAIM->RELEASE pairs A resource claimed once and released is healthy; one claimed 9 times by 4 actors is a coordination hotspot, and one claimed and never released is an orphan a walker must reap. now is INJECTABLE so hold-time arithmetic is deterministic under test. Composes nx_sovjson_lib (sj_*). Read-only. Rule 26. mine <journal> [minsup] [now] -> JSON: totals, by_resource ranked, orphans, contention selftest <scratch-prefix> -> gate T1..T8 frame cols: ts TAB verb(CLAIM|BEAT|RELEASE) TAB resource TAB actor TAB ttl TAB note license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_sovjson_lib.nx nx_syscalls.nx nx_gate_verdict.nx nx_leasemine.nx

imports: nx_sovjson_lib.nxnx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main sj_puts sys_write sys_exit sj_vlen sj_lit_eq lm_selftest gv_ctr sys_mmap gv_head gv_puts sys_write ↻ sys_mmap ↻ sj_cat sj_catn sys_mmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_openat_wr sys_write ↻ sys_close lm_mine_json sys_mmap ↻ lm_read sys_openat_rd sys_read sys_close ↻ sj_le sj_col sj_lit_eq ↻ lm_digits sj_atoi_span lm_span_eq lm_key sj_cat ↻ sj_catn ↻ sj_cat ↻ sj_cat_esc sj_vlen ↻

structs

none

consts

17const LM_MAGIC_1785000000: i64 = 1785000000
18const LM_MAGIC_4088: i64 = 4088
20const LM_WIN: i64 = 4194304
21const LM_OUT: i64 = 65536
22const LM_PATH: i64 = 512
23const LM_RES: i64 = 512
24const LM_ACTORS: i64 = 8
25const LM_TOPN: i64 = 20
26const LM_PERMIL: i64 = 1000
27const LM_NAME_MAX: i64 = 120
28const LM_MODE_644: i64 = 420

functions

30func lm_read(path: *u8, buf: *u8, cap: i64) -> i64
39func lm_find(q: *u8, n: i64, lit: *u8) -> i64
called by 1: lm_selftest calls 1: sj_vlen
52func lm_key(d: *u8, o: i64, name: *u8) -> i64
called by 1: lm_mine_json calls 1: sj_cat
62func lm_digits(q: *u8, s: i64, e: i64) -> i64
called by 1: lm_mine_json
68func lm_span_eq(q: *u8, a: i64, ae: i64, b: i64, be: i64) -> i64
called by 1: lm_mine_json
74func lm_mine_json(jpath: *u8, minsup: i64, now: i64, d: *u8) -> i64
257func lm_selftest(prefix: *u8) -> i64
321func main(argc: i64, argv: *i64) -> i64