code wiki / (root) / nx_colonize_gate.nx

nx_colonize_gate.nx

buildroot/runtime/nx_colonize_gate.nx

6697 B139 linesdepth 4pulls 8 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_colonize_gate.nx -- PG21: DO TREES GROW BY COMPETITION FOR SPACE, AND DOES THE CANOPY MATCH THE LAYOUT? SUBJECT: nx_treegen.tg_colonize (in-process) fed by nx_forest_layout's OWN species params (in-process), so the envelope the grower is asked for is the envelope the LIVE layout will place it in. The rung's done-rule in its own words: distinct seeds yield distinct branching, and the canopy envelope matches the layout's species params. Every value is emitted with gv_kv; the per-species numbers name any failing species without a second run.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_treegen.nx nx_forest_layout.nx nx_colonize_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_treegen.nxnx_forest_layout.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr 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 ↻ gv_head gv_puts sys_write ↻ sys_mmap ↻ cg_grow sys_mmap ↻ _forest_species_params tg_colonize sys_mmap ↻ tg_next tg_range tg_next ↻ tg_col_inside tg_col_addnode tg_isqrt vm_isqrt tg_addcaps tg_isqrt ↻ tg_addsph cg_trunk_permil tg_col_envelope tg_isqrt ↻ gv_check

structs

none

consts

11const CG_UNITS_NUM: i64 = 640 // tree units per CG_UNITS_DEN forest Q: the tallest species (pine, 25000 Q) spans 640 units
12const CG_UNITS_DEN: i64 = 25000
13const CG_SEED: i64 = 2026
14const CG_SEEDS: i64 = 8
15const CG_R_LO: i64 = 550 // measured crown reach as permil of the requested radius: lower and upper bands
16const CG_R_HI: i64 = 1100
17const CG_H_LO: i64 = 800 // measured height as permil of the requested height
18const CG_H_HI: i64 = 1100
19const CG_LEAF_R: i64 = 22
20const CG_TINY_H: i64 = 30 // the neg-control envelope: a crown narrower than one step
21const CG_TINY_R: i64 = 1
22const CG_TINY_MAXP: i64 = 20
23const CG_PARAMS: i64 = 3

functions

25func cg_trunk_permil(species: i64) -> i64
called by 1: cg_grow
37func cg_grow(P: *i64, seed: i64, species: i64, prm: *i64) -> i64
48func cg_same(P: *i64, np: i64, Q: *i64, nq: i64) -> i64
called by 1: main
58func main() -> i64