code wiki / _hdl_build / nx_ecosystem_compare.nx

nx_ecosystem_compare.nx source

↩ module page · 45 lines · 2235 B

1// nx_ecosystem_compare.nx -- the competitive-landscape evaluator: how does the Nishi stack's WIDTH 2// (breadth = how many layers we even represent) and DEPTH (where we actually compete at S-class) stack up 3// against whole platform ecosystems -- Linux, Windows, Android, Apple (operator: "know how we compete 4// against the whole windows or linux or android or apple ecosystems and stacks"). Each established OS is 5// PRODUCTION+ on every dimension; our gap is (a) the ABSENT dimensions (OS fundamentals we don't have) and 6// (b) the TOY/FUNCTIONAL dimensions that need hardening + triangulated S-class wins. license_tier: ORIGINAL 7 8import "nx_maturity_auditor.nx" 9import "nx_syscalls.nx" 10 11const PLAT_LINUX: i64 = 1 12const PLAT_WINDOWS: i64 = 2 13const PLAT_ANDROID: i64 = 3 14const PLAT_APPLE: i64 = 4 15 16func eco_represented(level: i64) -> i64 { if level != MAT_ABSENT { return 1 } return 0 } 17func eco_functional_plus(level: i64) -> i64 { if level >= MAT_FUNCTIONAL { return 1 } return 0 } 18func eco_competitive(level: i64) -> i64 { if level >= MAT_SCLASS { return 1 } return 0 } 19 20// permil (x1000) -- integer, no floats. 21func eco_permil(count: i64, total: i64) -> i64 { if total <= 0 { return 0 } return count * 1000 / total } 22 23// WIDTH: fraction of stack dimensions we represent at all (vs a full OS that covers them all). 24func eco_breadth_permil(levels: *i64, n: i64) -> i64 { 25 var c: i64 = 0; var i: i64 = 0 26 while i < n { if eco_represented(levels[i]) == 1 { c = c + 1 } i = i + 1 } 27 return eco_permil(c, n) 28} 29// USABLE width: fraction at FUNCTIONAL or better. 30func eco_usable_permil(levels: *i64, n: i64) -> i64 { 31 var c: i64 = 0; var i: i64 = 0 32 while i < n { if eco_functional_plus(levels[i]) == 1 { c = c + 1 } i = i + 1 } 33 return eco_permil(c, n) 34} 35// DEPTH: fraction where we actually compete with the best (S-class+, triangulated). 36func eco_depth_permil(levels: *i64, n: i64) -> i64 { 37 var c: i64 = 0; var i: i64 = 0 38 while i < n { if eco_competitive(levels[i]) == 1 { c = c + 1 } i = i + 1 } 39 return eco_permil(c, n) 40} 41func eco_count_at(levels: *i64, n: i64, level: i64) -> i64 { 42 var c: i64 = 0; var i: i64 = 0 43 while i < n { if levels[i] == level { c = c + 1 } i = i + 1 } 44 return c 45}