code wiki / (root) / nx_scene_contract_test.nx

nx_scene_contract_test.nx

buildroot/runtime/nx_scene_contract_test.nx

7268 B199 linesdepth 8pulls 10 transitivereach 0 importersview sourcekind gate/prooftopic scene
docsdependenciesstructsconstsfunctions

about

nx_scene_contract_test.nx -- KATs for the R0 style-spanning scene contract. Exit 0 = all pass; the failing KAT's number is the exit code. KAT 1 identity determinism: same seed -> identical entity, twice. KAT 2 style never touches identity: entity record byte-equal after rendering under all four styles. KAT 3 render determinism: same (world, human, style) -> byte-identical framebuffers. KAT 4 terrain anchoring: the figure's lowest outfit pixel sits on the ground row at the anchor, in EVERY style. KAT 5 styles genuinely differ: framebuffer hashes pairwise distinct. KAT 6 cross-world reuse: the SAME human renders into two different worlds; both visible, both deterministic. KAT 7 proportion tables are style-distinct (head ratios all differ). KAT 8 speed: full Tier-0 quickstart under NX_SCN_RENDER_BUDGET_MS (the measured beat-them-on-speed number, printed every run). license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_scene_contract.nx nx_scene_render.nx nx_scene_contract_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_scene_contract.nxnx_scene_render.nx

imported by: nobody (leaf or entry point)

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

main nx_entity_human sys_mmap _ent_lcg _ent_skin _ent_hair _ent_outfit _ent_eye sys_mmap ↻ t_render_to nx_scene_world sys_mmap ↻ nx_style_is_valid nx_procgen_landscape nx_procgen_preset_is_valid _preset_octaves _preset_persistence_q10 _preset_base_radius _apply_density nx_perlin_alloc sys_mmap ↻ _perlin_lcg_step sys_mmap ↻ _fill_heightmap nx_perlin_fbm_2d nx_perlin_2d nx_sig_compose nx_sig_compose_cfg _sig_n_peaks _sig_peak_radius _sig_peak_amp _sig_argmin sys_mmap ↻ nx_poisson_disk_sample nx_sig_peak_t nx_sig_ridge_t nx_sig_basin _sig_valley_amp nx_sig_valley _sig_cliff_drop

structs

none

consts

37const FB_BYTES: nx_int = 147456 // NX_SCN_W * NX_SCN_H * 3

functions

24func t_puts(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
25func t_putn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
39func t_fnv(fb: *u8, n: nx_int) -> nx_int
called by 1: main
51func t_lowest_of_color(fb: *u8, x0: nx_int, x1: nx_int, rgb: nx_int) -> nx_int
called by 1: main
73func t_count_of_color(fb: *u8, rgb: nx_int) -> nx_int
called by 1: main
91func t_render_to(world_seed: nx_int, human_seed: nx_int, style: nx_int, fb: *u8) -> *i64
100func main() -> i64