code wiki / (root) / nx_manga_ocr_gate.nx

nx_manga_ocr_gate.nx

buildroot/runtime/nx_manga_ocr_gate.nx

5483 B106 linesdepth 12pulls 48 transitivereach 0 importersview sourcekind gate/prooftopic manga
docsdependenciesstructsconstsfunctions

about

nx_manga_ocr_gate.nx -- REFEREE for MG22 (mo_text_regions). IN-PROCESS against nx_manga_ocr. THE FIXTURE IS PLANTED, NOT DECODED. Every ink map below is written by this gate at known coordinates, so the EXPECTED ANSWER IS EXACT rather than eyeballed -- no image decode, no GPU, no corpus, and the whole run is deterministic. A detector graded against a picture someone looked at is graded by an interpretation; this one is graded by arithmetic. ANTI-VACUITY IS THE POINT. The trivial wrong implementation returns ONE bounding box around all the ink and would satisfy any tooth that merely asks did-you-find-something. T3 requires TWO separated blocks to come back as TWO with their own bounds, and T6 requires two lines a SMALL gap apart to come back as ONE -- a detector that always splits fails T6, a detector that always merges fails T3, and no single wrong rule passes both. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_manga_ocr.nx nx_manga_ocr_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_manga_ocr.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr 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 ↻ gv_head gv_puts sys_write ↻ sys_mmap ↻ mog_clear mo_text_regions rp_rowink rp_colink gv_check gv_puts ↻ mog_eq mog_fill mog_rect_is gv_values_head gv_puts ↻ gv_kv gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_verdict gv_note_bare_rate

structs

none

consts

18const MOG_W: i64 = 40
19const MOG_H: i64 = 40
20const MOG_N: i64 = 1600
21const MOG_OUT: i64 = 256

functions

23func mog_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
25func mog_clear(ink: *u8) -> i64 { var i: i64 = 0; while i < MOG_N { ink[i] = 0 as u8; i = i + 1 } return 0 }
called by 1: main
27func mog_fill(ink: *u8, x0: i64, y0: i64, x1: i64, y1: i64) -> i64
called by 1: main
38func mog_rect_is(out: *i64, i: i64, x0: i64, y0: i64, x1: i64, y1: i64) -> i64
called by 1: main
46func main(argc: i64, argv: *i64) -> i64