code wiki / _hdl_build / nx_uiq_perf.nx
nx_uiq_perf.nx
buildroot/runtime/_hdl_build/nx_uiq_perf.nx
about
nx_uiq_perf.nx -- CLI: DETERMINISTIC Core-Web-Vitals STATIC predictor (the quantitative guardrail).
Computes, from a page's source, the render-path costs that CWV field metrics punish -- WITHOUT a render:
* render-blocking external stylesheets (<link rel=stylesheet>, not preload) -> delays FCP/LCP
* render-blocking scripts (<script src> without async/defer) -> blocks parse, hurts INP/TBT
* unsized media (<img>/<video> missing width or height) -> CLS risk (>0.1 fails)
* page source weight (bytes) -> transfer proxy
Reuses the nx_uiq_* family lib (DRY: io + syscalls) -- the second consumer of nx_uiq_color, growing the family.
usage: nx_uiq_perf --kat | <html-file-path> -> JSON {bytes,blocking_css,blocking_js,unsized_media,issues,verdict}
HONEST ENVELOPE: STATIC predictors of LCP<=2.5s / INP<=200ms / CLS<=0.1 (web.dev/vitals, p75). Measured
LCP/INP/CLS + Speed Index need a real render + field RUM (browser-lane / CDP). This flags the source-visible
causes; a PASS here is necessary, not sufficient. license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 1 importers
imports: nx_uiq_color.nx
imported by: nx_uiq_perf_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const K_MAGIC_2097152: i64 = 2097152 |
functions
| 16 | func perf_has_in(buf: *u8, a: i64, b: i64, pat: *u8) -> i64 |
| 29 | func perf_tagend(buf: *u8, n: i64, off: i64) -> i64 |
| 35 | func perf_unsized_img(buf: *u8, n: i64) -> i64 |
| 52 | func perf_blocking_js(buf: *u8, n: i64) -> i64 |
| 71 | func perf_blocking_css(buf: *u8, n: i64) -> i64 |
| 88 | func perf_audit(buf: *u8, n: i64, emit: i64) -> i64 called by 3: uiq_perf_selftestmainmain calls 5: perf_blocking_cssperf_blocking_jsperf_unsized_imguiq_wuiq_pn |
| 107 | func uiq_perf_selftest() -> i64 |
| 128 | func perf_slurp(path: *u8, buf: *u8, cap: i64) -> i64 |
| 138 | func main(argc: i64, argv: *i64) -> i64 |