code wiki / _hdl_build / nx_connect_calibrated_div.nx
nx_connect_calibrated_div.nx
buildroot/runtime/_hdl_build/nx_connect_calibrated_div.nx
about
nx_connect_calibrated_div.nx -- CONNECT capability: calibrated recommendation with intra-list DIVERSITY
(CIQ exec cell; incumbents do accuracy-only ranking that crowds out niche -> a homogeneous list). Nishi
re-ranks for category coverage while keeping relevance high, so a single list spans more of the user's
world. MEASURED head-to-head: a pure-relevance ranker fills the list from one dominant category; Nishi's
diversity-aware ranker covers strictly MORE distinct categories at retained relevance. 100% sovereign,
integer. license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 8 | const CD_MAGIC_2000000: i64 = 2000000 |
| 10 | const CD_M: i64 = 8 |
| 11 | const CD_S: i64 = 4 |
| 12 | const CD_PENALTY: i64 = 30 // relevance penalty per already-shown item of the same category |
| 13 | const CD_REL_FLOOR_PCT: i64 = 70 // diversity list must retain >= this % of pure-relevance total |
functions
| 15 | func dw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 16 | func dn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;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(1,bb,k); return 0 } |
| 19 | func distinct_cats(cat: *i64, picks: *i64, cnt: i64) -> i64 |
| 28 | func main() -> i64 |