code wiki / _hdl_build / nx_srcset_lib_gate.nx

nx_srcset_lib_gate.nx

buildroot/runtime/_hdl_build/nx_srcset_lib_gate.nx

28039 B408 linesdepth 11pulls 78 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_srcset_lib_gate.nx -- the referee for BR14 (nx_srcset_lib, symbol bi_srcset). IN-PROCESS BY CONSTRUCTION. It imports the subject and the render core it is wired into, so the subject is inside THIS gate's own build closure and a mutation of nx_srcset_lib.nx reaches these teeth. A gate that fork/execs a deployed elf cannot be mutation-proven -- every mutant reads NOT-REACHED -- so nothing here forks anything. =================================================================================================== THE ACCEPT RULE, PRE-DECLARED BEFORE THE FIRST RUN (written 2026-08-26, before any result existed). BR14 is proven by this gate IF AND ONLY IF all five hold; anything less is reported NOT PROVEN by name, and the rung stays open. A. GRAMMAR. Every documented descriptor form selects the candidate the HTML selection algorithm selects, for a target DERIVED from the viewport and the device pixel ratio -- not from any breakpoint written in this estate. B. DISCRIMINATION. The three trivial wrong implementations -- always-take-the-first candidate, always-take-the-last, always-take-the-largest -- each FAIL at least one tooth. A ruler that cannot be distinguished from taking the first item has measured nothing. C. WIRING. An <img> whose only usable URL lives in srcset / data-src / data-srcset resolves to THAT URL through the real br_layout, i.e. page.bsrc_off names it. Proving the lib in isolation proves a function, not a browser. D. NO REGRESSION. An <img> carrying only a plain src resolves to byte-identically the range the pre-BR14 code chose, checked against an INDEPENDENT instrument (nx_dom_find_attr direct). E. PAINTED, NOT MERELY SELECTED. On a fixture page whose figures are lazy and responsive, imgsrc_laid == decoded == painted: every laid-out <img> box decodes through the real image path and leaves its own pixels in the framebuffer. This is the done-rule's SHAPE on a fixture this gate controls. It is NOT the done-rule's live half (the wikipedia benchmark page over the network), which needs the GUI and a network and is NOT claimed here. ===================================================================================================

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_srcset_lib.nx nx_browser_render.nx nx_img_to_rgb.nx nx_png_write.nx nx_srcset_lib_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_srcset_lib.nxnx_browser_render.nxnx_img_to_rgb.nxnx_png_write.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 ↻ sg_check gv_check gv_puts ↻ sg_note_fail sys_mmap ↻ sg_picks bi_srcset bi_is_ws bi_desc bi_lc bi_has_dot bi_num_permil bi_is_digit sg_slen sg_span_is sg_slen ↻ sg_eq sg_code bi_srcset ↻

structs

none

consts

38const SG_DIR: *u8 = "/tmp/nx_srcset_lib_gate"
39const SG_PNG: *u8 = "/tmp/nx_srcset_lib_gate/px.png"
40const SG_DIR_MODE: i64 = 493 // 0755 -- owner rwx, group/other rx
44const SG_IMG_R: i64 = 255
45const SG_IMG_G: i64 = 0
46const SG_IMG_B: i64 = 255
47const SG_IMG_W: i64 = 24
48const SG_IMG_H: i64 = 24
49const SG_VW: i64 = 640 // the fixture viewport; every target below is DERIVED from it
50const SG_FB_W: i64 = 700
51const SG_FB_H: i64 = 900
52const SG_RGB_CH: i64 = 3
53const SG_RGBA_CH: i64 = 4
54const SG_DPR_1X: i64 = 1000
55const SG_DPR_1P5X: i64 = 1500
56const SG_DPR_2X: i64 = 2000
57const SG_DPR_3X: i64 = 3000
145const SG_MAXFAIL: i64 = 16

functions

59func sg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
61func sg_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
64func sg_span_is(buf: *u8, off: i64, len: i64, lit: *u8) -> i64
called by 3: sg_pickssg_src_ismain calls 1: sg_slen
77func sg_picks(list: *u8, size_px: i64, dpr: i64, want: *u8, sc: *i64, oo: *i64, ol: *i64) -> i64
called by 1: main calls 3: bi_srcsetsg_slensg_span_is
84func sg_code(list: *u8, size_px: i64, dpr: i64, sc: *i64, oo: *i64, ol: *i64) -> i64
called by 1: main calls 2: bi_srcsetsg_slen
89func sg_took_first(list: *u8, size_px: i64, dpr: i64, sc: *i64, oo: *i64, ol: *i64) -> i64
called by 1: main calls 2: bi_srcsetsg_slen
97func sg_src_is(tag: *u8, vw: i64, dpr: i64, want: *u8, sc: *i64, oo: *i64, ol: *i64) -> i64
called by 1: main calls 3: bi_img_sourcesg_slensg_span_is
103func sg_src_code(tag: *u8, vw: i64, dpr: i64, sc: *i64, oo: *i64, ol: *i64) -> i64
called by 1: main calls 2: bi_img_sourcesg_slen
108func sg_make_png(wh: *i64) -> i64
128func sg_px_is_img(px: *u8, x: i64, y: i64) -> i64
called by 1: main
148func sg_note_fail(nm: *u8) -> i64
called by 2: sg_checksg_bite calls 1: sys_mmap
157func sg_check(nm: *u8, cond: i64, ctr: *i64) -> i64
called by 1: main calls 2: gv_checksg_note_fail
162func sg_bite(nm: *u8, bad: i64, good: i64, ctr: *i64) -> i64
called by 1: main calls 2: gv_bitesg_note_fail
167func sg_dump_fails() -> i64
called by 1: main calls 1: gv_puts
182func main() -> i64