code wiki / _hdl_build / nx_pm_plan_gen.nx
nx_pm_plan_gen.nx source
↩ module page · 94 lines · 7620 B
1// nx_pm_plan_gen.nx -- the Nishi PM GENERATES the roadmap plan from the maturity gaps, with effort
2// estimates, check-in cadence, and cumulative ETAs, and writes it to /tmp/nishi_pm_plan.log for the
3// operator to read. Ordered for "S-class first, then breadth", on the hardware-up / 3rd-party->1st-party
4// axis. Marks item 1 IN-PROGRESS = the team has BEGUN. license_tier: ORIGINAL
5
6import "nx_pm_plan.nx"
7import "nx_itoa_lib.nx" // shared MSB-first emitter (zero-alloc)
8import "nx_pm_review_log.nx"
9import "nx_syscalls.nx"
10
11func pg_w(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 }
12// MIGRATED to the shared emitter (debt 1785563586). The old body mmapped a scratch buffer
13// per call and never freed it. At PAGE granularity that is 4096B leaked PER CALL -- the
14// defect that took 28.5GB of a 36GB host in nx_ts_lumadiff (2MB input, ~3.66M calls).
15// nxi_* is MSB-first, allocates NOTHING, and emits identical bytes including the sign.
16func pg_num(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
17
18func main() -> i64 {
19 let path: *u8 = "/tmp/nishi_pm_plan.log" as *u8
20 let fd: i64 = sys_openat_wr(path, 0x1a4) // fresh plan each generation
21 let QUANTUM: i64 = 4 // BU per check-in (config, not magic-in-logic)
22
23 pg_w(fd, "# NISHI PM ROADMAP PLAN -- hardware-up, bits-up; 3rd-party now -> 1st-party target\n" as *u8)
24 pg_w(fd, "# units: BU = build-unit ~= one autonomous build+verify iteration (NOT wall-clock).\n" as *u8)
25 pg_w(fd, "# check-in every " as *u8); pg_num(fd, QUANTUM); pg_w(fd, " BU; ETA = cumulative BU from now.\n" as *u8)
26 pg_w(fd, "# goal: keep extracting full value from 3rd-party (x86/Linux) while migrating sovereign->first-party.\n\n" as *u8)
27
28 let N: i64 = 17
29 let nm: *i64 = sys_mmap(8*N) as *i64
30 let pty: *i64 = sys_mmap(8*N) as *i64
31 let lay: *i64 = sys_mmap(8*N) as *i64
32 let cur: *i64 = sys_mmap(8*N) as *i64
33 let tgt: *i64 = sys_mmap(8*N) as *i64
34 let wt: *i64 = sys_mmap(8*N) as *i64
35 var k: i64 = 0
36 // ACTIVE ARC -- information-management + e-reader + wiki (operator's current priority; WSJF-ranked via nx_pm_decision_matrix)
37 nm[k]="W1 wire S-class index into the wiki (full-text+backlinks+related)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_APP; cur[k]=MAT_FUNCTIONAL; tgt[k]=MAT_PRODUCTION; wt[k]=2; k=k+1
38 nm[k]="E wire BM25 over the persistent index into live search" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_APP; cur[k]=MAT_FUNCTIONAL; tgt[k]=MAT_PRODUCTION; wt[k]=2; k=k+1
39 nm[k]="C1 DEFLATE inflate (KEYSTONE: EPUB/comics/PDF read + PDF index)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_APP; cur[k]=MAT_ABSENT; tgt[k]=MAT_FUNCTIONAL; wt[k]=4; k=k+1
40 nm[k]="D harvest scale-up (getdents dir-walk + NAS corpus -> persistent index)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_APP; cur[k]=MAT_FUNCTIONAL; tgt[k]=MAT_PRODUCTION; wt[k]=4; k=k+1
41 nm[k]="FORMAT unified Nishi reader format (RWPM core + Locator/CFI + CAS)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_APP; cur[k]=MAT_ABSENT; tgt[k]=MAT_FUNCTIONAL; wt[k]=6; k=k+1
42 nm[k]="C2 PDF xref/obj/stream parse + text (read+index 301 PDFs)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_APP; cur[k]=MAT_ABSENT; tgt[k]=MAT_FUNCTIONAL; wt[k]=7; k=k+1
43 nm[k]="RENDER two renderers (paginator reflow + fixed-layout PDF/CBZ)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_APP; cur[k]=MAT_TOY; tgt[k]=MAT_FUNCTIONAL; wt[k]=7; k=k+1
44 nm[k]="SYNC cross-device position+annotation (content-addressed locators)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_APP; cur[k]=MAT_ABSENT; tgt[k]=MAT_FUNCTIONAL; wt[k]=5; k=k+1
45 // ---- longer-term hardware-up roadmap (north star) ----
46 // seq1 -- the immediate S-class move
47 nm[k]="x86 toolchain byte-exact differential vs gcc" as *u8 as i64; pty[k]=PM_PARTY_BRIDGE; lay[k]=PM_L_ASM; cur[k]=MAT_PRODUCTION; tgt[k]=MAT_SCLASS; wt[k]=3; k=k+1
48 nm[k]="RV64 toolchain to S-class (open ISA toward 1st-party)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_ASM; cur[k]=MAT_FUNCTIONAL; tgt[k]=MAT_SCLASS; wt[k]=3; k=k+1
49 nm[k]="ARM64 assembler harden (Apple/Android reach)" as *u8 as i64; pty[k]=PM_PARTY_THIRD; lay[k]=PM_L_ASM; cur[k]=MAT_TOY; tgt[k]=MAT_PRODUCTION; wt[k]=3; k=k+1
50 nm[k]="linker/ELF harden to production" as *u8 as i64; pty[k]=PM_PARTY_BRIDGE; lay[k]=PM_L_LINK; cur[k]=MAT_FUNCTIONAL; tgt[k]=MAT_PRODUCTION; wt[k]=2; k=k+1
51 nm[k]="harden TOY app layers (browser/GUI/graphics)" as *u8 as i64; pty[k]=PM_PARTY_THIRD; lay[k]=PM_L_APP; cur[k]=MAT_TOY; tgt[k]=MAT_FUNCTIONAL; wt[k]=2; k=k+1
52 // ABSENT OS-fundamentals -- reduce 3rd-party (Linux) dependence
53 nm[k]="sovereign filesystem (off 3rd-party FS)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_OSFUND; cur[k]=MAT_ABSENT; tgt[k]=MAT_FUNCTIONAL; wt[k]=8; k=k+1
54 nm[k]="sovereign TCP/IP stack (off kernel sockets)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_OSFUND; cur[k]=MAT_ABSENT; tgt[k]=MAT_FUNCTIONAL; wt[k]=8; k=k+1
55 nm[k]="sovereign kernel bring-up (TOY beachhead)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_OSFUND; cur[k]=MAT_ABSENT; tgt[k]=MAT_TOY; wt[k]=8; k=k+1
56 // L0 -- the north star: first-party hardware target
57 nm[k]="first-party hardware target (soft-core/FPGA for sovereign ISA)" as *u8 as i64; pty[k]=PM_PARTY_FIRST; lay[k]=PM_L_HARDWARE; cur[k]=MAT_ABSENT; tgt[k]=MAT_TOY; wt[k]=8; k=k+1
58
59 var eta: i64 = 0
60 var total_checkins: i64 = 0
61 var i: i64 = 0
62 while i < N {
63 let eff: i64 = pm_effort(cur[i], tgt[i], wt[i])
64 let chk: i64 = pm_checkins(eff, QUANTUM)
65 eta = eta + eff
66 total_checkins = total_checkins + chk
67 pg_w(fd, "PLAN seq=" as *u8); pg_num(fd, i + 1)
68 pg_w(fd, " layer=" as *u8); pg_w(fd, pm_layer_label(lay[i]))
69 pg_w(fd, " party=" as *u8); pg_w(fd, pm_party_label(pty[i]))
70 pg_w(fd, " cur=" as *u8); pg_w(fd, mat_label(cur[i]))
71 pg_w(fd, " target=" as *u8); pg_w(fd, mat_label(tgt[i]))
72 pg_w(fd, " effort=" as *u8); pg_num(fd, eff); pg_w(fd, "BU" as *u8)
73 pg_w(fd, " checkins=" as *u8); pg_num(fd, chk)
74 pg_w(fd, " eta=" as *u8); pg_num(fd, eta); pg_w(fd, "BU" as *u8)
75 pg_w(fd, " status=" as *u8)
76 if i == 0 { pg_w(fd, "IN-PROGRESS" as *u8) }
77 if i == 1 { pg_w(fd, "NEXT" as *u8) }
78 if i > 1 { pg_w(fd, "QUEUED" as *u8) }
79 pg_w(fd, " item=" as *u8); pg_w(fd, nm[i] as *u8); pg_w(fd, "\n" as *u8)
80 i = i + 1
81 }
82 pg_w(fd, "\nSUMMARY items=" as *u8); pg_num(fd, N)
83 pg_w(fd, " total_effort=" as *u8); pg_num(fd, eta); pg_w(fd, "BU total_checkins=" as *u8); pg_num(fd, total_checkins)
84 pg_w(fd, "\nNEXT-CHECKIN at " as *u8); pg_num(fd, QUANTUM); pg_w(fd, "BU: item1 W1 wire-index-into-wiki -- first sub-step = point nx_wiki_search_wiring at nx_search_inverted_persist.\n" as *u8)
85 sys_close(fd)
86
87 // tell the review log the plan is ready + the team has begun.
88 let pm: i64 = pm_open("/tmp/nishi_pm_review.log" as *u8)
89 pm_deliverable(pm, "pm/roadmap-plan" as *u8, "plan regenerated + started" as *u8, "17-item plan in /tmp/nishi_pm_plan.log; active arc (info-mgmt+e-reader+wiki) prepended WSJF-ranked; item1 (W1 wire index into wiki) IN-PROGRESS; C1 DEFLATE inflate = the keystone unlock; hardware-up roadmap retained below" as *u8)
90 sys_close(pm)
91
92 pg_w(1, "PM plan written to /tmp/nishi_pm_plan.log; item 1 IN-PROGRESS. Total " as *u8); pg_num(1, eta); pg_w(1, "BU across " as *u8); pg_num(1, N); pg_w(1, " items.\n" as *u8)
93 sys_exit(0); return 0
94}