code wiki / _hdl_build / nx_fed_registry.nx
nx_fed_registry.nx
buildroot/runtime/_hdl_build/nx_fed_registry.nx
about
nx_fed_registry.nx -- FEDERATED DRIVER REGISTRY (X-DRV-F2).
The main system aggregates the CONSENTING spores' signed telemetry (X-DRV-F1) and REFINES the
driver registry: for each device it picks the config that MEASURABLY WINS (fewest emu-steps per
I/O) across all reporting nodes, and writes that back as the recommended config -> every node
adopting the federated registry gets the best-known driver = the network effect.
Each node report (the federated inbox, default knowledge/registry/federated_reports.tsv):
deviceid <TAB> config_spec <TAB> steps <TAB> node_pubkey_hex <TAB> sig_hex
where sig = ed25519 over the EXACT payload "fedreport deviceid=<id> config=<spec> steps=<n>".
A report whose signature does NOT verify is REJECTED (consent + authenticity enforced -- only
genuinely-signed contributions count; you cannot poison the registry with unsigned data).
nx_fed_registry [reports_path]
-> knowledge/registry/driver_registry_federated.tsv (deviceid -> winning config_spec + steps)
-> knowledge/status/fed_registry.log (FEDREG: per-device winner, nodes-aggregated, rejected)
Sovereign (syscalls + ed25519), no gcc/.sh. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_ed25519_signature.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
| 20 | const FR_MAGIC_262144: i64 = 262144 |
| 21 | const FR_MAGIC_2048: i64 = 2048 |
| 23 | const FR_OUT: *u8 = "knowledge/registry/driver_registry_federated.tsv" |
| 24 | const FR_LOG: *u8 = "knowledge/status/fed_registry.log" |
| 25 | const FR_MAXDEV: i64 = 32 |
functions
| 27 | func fr_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 28 | func fr_fp(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 } |
| 29 | func fr_fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 30 | func fr_n(v: i64) -> i64 { fr_fn(1, v); return 0 } |
| 32 | func fr_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 42 | func fr_field(buf: *u8, ls: i64, le: i64, idx: i64) -> i64 called by 1: main |
| 48 | func fr_field_end(buf: *u8, s: i64, le: i64) -> i64 { var q: i64 = s; while q < le { if buf[q] == (9 as u8) { return q } q = q + 1 } return le } called by 1: main |
| 50 | func fr_parse_num(buf: *u8, p: i64, le: i64) -> i64 called by 1: main |
| 63 | func fr_hexdec(src: *u8, hexlen: i64, out: *u8) -> i64 called by 1: main |
| 77 | func fr_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } called by 1: main |
| 78 | func fr_catn(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{dst[off+i]=t[k-1-i];i=i+1}; return off+k } |
| 79 | func fr_catbytes(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var i: i64=0; while i<n { dst[off+i]=src[i]; i=i+1 } return off+n } called by 1: main |
| 81 | func main(argc: i64, argv: *i64) -> i64 |