code wiki / _hdl_build / nx_polish_census.nx

nx_polish_census.nx

buildroot/runtime/_hdl_build/nx_polish_census.nx

10995 B192 linesdepth 10pulls 46 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_polish_census.nx -- MEASURE the visual POLISH gap vs Chrome/Edge as a NUMBER (operator: the evidence "clearly shows our polish gap" -- so quantify it, no vibes). Legibility (OCR word-recall) says we're readable (984); polish is a DIFFERENT axis: smooth anti-aliased edges vs blocky 1-bit ones. This census decodes the SAME bench renders (ours / chrome / edge, via the sovereign PNG decoder) and computes an ANTI-ALIASING QUALITY score: of the pixels ON A TEXT EDGE (a large luminance jump to a neighbor), what fraction are INTERMEDIATE GRAY (30..225) = softened by AA, vs pure black/white = aliased. A 1-bit bitmap render scores ~0; Chrome's rasterizer scores high. The GAP is the number to close. permille AA = intermediate-gray-edge-px * 1000 / total-edge-px. NEG/liar-kill: a synthetic hard-edged checkerboard MUST score ~0 (the metric can't be fooled into calling blocky "smooth"). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_img_bytes_to_rgb.nx nx_itoa_lib.nx nx_polish_census.nx

imports: nx_img_bytes_to_rgb.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main pc_puts pc_load nx_img_bytes_to_rgb 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 ↻ nx_jpeg_decode_rgb sys_mmap ↻ nx_jpeg_dec_ctx_init sys_mmap ↻ nx_jpeg_ctx_tables_reset nx_jpeg_ctx_htable_at nx_jpeg_ctx_htable_bind nx_jpeg_ctx_qtable_at _jpeg_ascii_probe_sof sys_mmap ↻ nx_jpeg_seg_init nx_jpeg_seg_next nx_jpeg_classify_marker nx_jpeg_marker_is_lengthle nx_jpeg_sof_parse nx_jpeg_is_progressive prog_be16 nx_jpeg_prog_decode sys_mmap ↻ nx_jpeg_ctx_tables_reset ↻ prog_be16 ↻

structs

none

consts

13const K_MAGIC_2126: i64 = 2126
14const K_MAGIC_7152: i64 = 7152
15const K_MAGIC_10000: i64 = 10000
16const K_MAGIC_16384: i64 = 16384

functions

18func pc_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
23func pc_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
24func pc_app(buf: *u8, pos: i64, s: *u8) -> i64 { var p: i64=pos; var i: i64=0; while s[i]!=(0 as u8) { buf[p]=s[i]; p=p+1; i=i+1 } return p }
called by 1: main
25func pc_appd(buf: *u8, pos: i64, v: i64) -> i64
called by 1: main
37func pc_write_file(path: *u8, data: *u8, n: i64) -> i64
called by 1: main
44func pc_lum(rgb: *u8, o: i64) -> i64 { return (K_MAGIC_2126*(rgb[o] as i64) + K_MAGIC_7152*(rgb[o+1] as i64) + 722*(rgb[o+2] as i64))/K_MAGIC_10000 }
called by 1: pc_aa_score
46func pc_parse_after(path: *u8, key: *u8) -> i64
called by 1: main
75func pc_aa_score(rgb: *u8, w: i64, h: i64, out: *i64) -> i64
called by 1: main calls 1: pc_lum
104func pc_load(path: *u8, wh: *i64) -> *u8
called by 1: main calls 1: nx_img_bytes_to_rgb
112func main() -> i64