code wiki / _hdl_build / nx_sdfrender_mt_gate.nx

nx_sdfrender_mt_gate.nx

buildroot/runtime/_hdl_build/nx_sdfrender_mt_gate.nx

5721 B122 linesdepth 8pulls 14 transitivereach 0 importersview sourcekind gate/prooftopic sdfrender
docsdependenciesstructsconstsfunctions

about

nx_sdfrender_mt_gate.nx -- R1c gate: the THREADED SDF render must be BYTE-IDENTICAL to the single-thread renderer AND measurably faster (the whole point of the rung). A negative control proves the comparator bites. T1 BODY: sdfmt_render (auto workers) == sdf_render, all 196608 px byte-identical T2 FACE: the same identity law on the carve/material program (different code paths: no floor, eye/hair/lash mats) T3 MEASURED speedup on the body frame (monotonic clock): threaded must be >= 2.0x faster (honest floor on a multi-core box; the ACTUAL ratio is printed -- no-wave, measured exceed) T4 NEG-CONTROL: corrupt one threaded pixel -> the comparator must flag EXACTLY one diff (then restore) T5 mt-vs-mt determinism: two threaded renders byte-identical (scheduling-independence) + PNG knowledge/nx_sdfmt.png license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_png.nx nx_hw.nx nx_sdfrender_mt.nx nx_sdfrender_mt_gate.nx

imports: nx_syscalls.nxnx_png.nxnx_hw.nxnx_sdfrender_mt.nx

imported by: nobody (leaf or entry point)

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

main nx_hw_worker_count nx_hw_cpu_count sys_mmap sys_munmap hw sys_write pn sys_mmap ↻ sys_write ↻ sys_mmap ↻ sdf_bytes sdf_body sdf_clear_ops sdf_set_floor sdf_set_mtx_amp sdf_set_kb now_ms sys_mmap ↻ sys_clock_gettime_mono sdf_render sdf_render_rows it_cos4096 it_sin4096 it_sin4096 ↻ sdf_isqrt sdf_shade_ray sdf_eval sdf_ellip sdf_isqrt ↻ sdf_ellip_rot sdf_isqrt ↻ sdf_smax sdf_smin sdf_smin ↻ sdf_isqrt ↻ sdf_softshadow sdf_eval ↻ sdf_gi sdf_abs

structs

none

consts

none

functions

15func hw(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 calls 1: sys_write
16func pn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
28func now_ms() -> i64
called by 1: main calls 2: sys_mmapsys_clock_gettime_mono
33func fbdiff(a: *i64, b: *i64, n: i64) -> i64
called by 1: main
40func main() -> i64