code wiki / _hdl_build / nx_raster_bench.nx

nx_raster_bench.nx

buildroot/runtime/_hdl_build/nx_raster_bench.nx

18712 B447 linesdepth 8pulls 18 transitivereach 0 importersview sourcekind benchtopic raster
docsdependenciesstructsconstsfunctions

about

nx_raster_bench.nx -- ARC-10/S12 PERF RUNG-0: the MEASURED sovereign-rasterizer baseline on the REAL textured-Draw path (txtri_render: 3 edge fns + barycentric UV + 4-tap bilinear nx_txs_sample per fragment -- the realistic pixel workload, NOT a null loop). Hardware clock CLOCK_MONOTONIC, best-of-N reps. NEG-CONTROLS: (a) quarter-pixel scene must take materially less time (the timer tracks the PIXEL workload, kills the synthetic-fps lie); (b) FLAT texture -> uniform fill (the per-fragment sample path is live inside the timed frame). Baseline numbers gate every later rasterizer optimization claim (ratchet). license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_textured_tri.nx nx_textured_tri_fast.nx nx_pteam.nx nx_raster_bench.nx

imports: nx_syscalls.nxnx_textured_tri.nxnx_textured_tri_fast.nxnx_pteam.nx

imported by: nobody (leaf or entry point)

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

main hw sys_write sys_mmap rb_frame rb_clear rb_quad txtri_render tt_edge nx_txs_sample_bilinear _txs_wrap_coord nx_image_get pn sys_mmap ↻ sys_write ↻ rb_cksum rb_bench rb_now sys_clock_gettime_mono rb_frame ↻ pd2 pn ↻ hw ↻ rb_frame_fast rb_clear ↻ rb_quad_fast txtri_render_fast txtri_render_fast_clip tt_edge ↻ txsf_bilinear rb_scene_ref rb_clear ↻ txtri_render ↻ rb_scene_fast rb_clear ↻ txtri_render_fast ↻ rb_bench_fast rb_now ↻ rb_frame_fast ↻ nx_hw_worker_count

structs

none

consts

12const RB_MAGIC_1000000000: i64 = 1000000000
13const RB_MAGIC_1400: i64 = 1400
14const RB_MAGIC_10000: i64 = 10000
15const RB_MAGIC_4096: i64 = 4096
17const RB_W: i64 = 512
18const RB_H: i64 = 384
19const RB_QW: i64 = 256
20const RB_QH: i64 = 192
21const RB_FRAMES: i64 = 20
22const RB_REPS: i64 = 5
23const RB_TEXW: i64 = 64
24const RB_TEXH: i64 = 64
25const RB_SQ: i64 = 8

functions

27func 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 2: pd2main calls 1: sys_write
28func pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 }
called by 2: pd2main calls 2: sys_mmapsys_write
30func pd2(v100: i64) -> i64
called by 1: main calls 2: pnhw
39func sput(dst: *u8, pos: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ dst[pos+i]=s[i]; i=i+1 } return pos+i }
called by 1: main
40func nput(dst: *u8, pos: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
55func rb_now(ts: *i64) -> i64
60func rb_clear(fb: *Image) -> i64
70func rb_quad(fb: *Image, tex: *Image) -> i64
called by 1: rb_frame calls 1: txtri_render
78func rb_frame(fb: *Image, tex: *Image) -> i64
called by 2: rb_benchmain calls 2: rb_clearrb_quad
85func rb_quad_fast(fb: *Image, tex: *Image) -> i64
called by 1: rb_frame_fast calls 1: txtri_render_fast
92func rb_frame_fast(fb: *Image, tex: *Image) -> i64
100func rb_scene_ref(fb: *Image, tex: *Image, u0a: i64) -> i64
called by 1: main calls 2: rb_cleartxtri_render
111func rb_scene_fast(fb: *Image, tex: *Image, u0a: i64) -> i64
called by 1: main calls 2: rb_cleartxtri_render_fast
120func rb_cksum(fb: *Image) -> i64
called by 1: main
130func rb_bench(fb: *Image, tex: *Image, ts: *i64) -> i64
called by 1: main calls 2: rb_nowrb_frame
145func rb_bench_fast(fb: *Image, tex: *Image, ts: *i64) -> i64
called by 1: main calls 2: rb_nowrb_frame_fast
163func rb_band_fn(band: i64, ctx: i64) -> i64
185func rb_frame_threaded(team: *NxPTeam, fb: *Image, tex: *Image, ctx: *i64, nbands: i64) -> i64
called by 2: rb_bench_threadedmain calls 1: nx_pteam_run
190func rb_bench_threaded(team: *NxPTeam, fb: *Image, tex: *Image, ctx: *i64, nbands: i64, ts: *i64) -> i64
called by 1: main calls 2: rb_nowrb_frame_threaded
206func main() -> i64