code wiki / (root) / nx_manga_script.nx

nx_manga_script.nx

buildroot/runtime/nx_manga_script.nx

8156 B178 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tooltopic manga
docsdependenciesstructsconstsfunctions

about

nx_manga_script.nx -- R3 of the mangagen lane (comparewatch- contract mangagen_ms_beats): a SCRIPT becomes PANEL BEATS. Rows in, rows out, no model in the loop -- the deterministic half of what DiffSensei does with an MLLM, so the assignment is reproducible and auditable before any art exists. script rows: beat|<action or caption> say|<speaker>|<line of dialogue> beatplan out: panel|<idx>|beat|<text> panel|<idx>|say|<speaker>|<line> THE DONE-RULE, pre-declared on /compare/mangagen before this organ existed: "Every script line lands in exactly one panel; the partition is printed." So the partition is not a comment -- it is COMPUTED and PRINTED, and a plan whose per-panel counts do not sum back to the rows read is a REFUSAL, never a quietly-dropped line. usage: nx_manga_script <script> <panels> [out.beatplan] license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_str.nx nx_syscalls.nx nx_manga_script.nx

imports: nx_str.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main ms_puts sys_write nx_str_len sys_exit sys_mmap nxa_die sys_write ↻ sys_exit ↻ nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ ms_read sys_openat_rd sys_read sys_close ms_pi sys_mmap ↻ sys_write ↻ ms_atoi ms_beats sys_openat_wr sys_write ↻ sys_close ↻

structs

none

consts

14const MS_CAP: i64 = 262144
15const MS_MAXROW: i64 = 2048
16const MS_MAXPANEL: i64 = 64

functions

17func ms_puts(s: *u8) -> i64 { sys_write(1, s, nx_str_len(s)); return 0 }
called by 1: main calls 2: sys_writenx_str_len
18func ms_pi(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
31func ms_atoi(s: *u8) -> i64
called by 1: main
41func ms_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
56func ms_beats(nrows: i64, panels: i64, first: *i64, count: *i64) -> i64
called by 1: main
74func main(argc: i64, argv: *i64) -> i64