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 17 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 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 ↻ sys_munmap hw sys_write ↻ pn sys_mmap ↻ sys_write ↻ sys_mmap ↻ now_ms sys_mmap ↻ sys_clock_gettime_mono sdfmt_render nx_pool_new nx_hw_worker_count ↻ sys_mmap ↻ nx_chan_new sys_mmap ↻ _nx_chan_cell sys_thread_create nx_thread_spawn sys_mmap ↻ nx_thread_spawn_fn sys_mmap ↻

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