code wiki / (root) / nx_substrate_compose_test.nx

nx_substrate_compose_test.nx

buildroot/runtime/nx_substrate_compose_test.nx

8364 B204 linesdepth 6pulls 15 transitivereach 0 importersview sourcekind gate/prooftopic substrate
docsdependenciesstructsconstsfunctions

about

nx_substrate_compose_test.nx -- end-to-end compose demo. Exercises ALL 11 optimization-layer primitives together to verify they compose. Per cardinal real-playtest-loop, the per-primitive smokes don't catch composition bugs (one primitive can pass its own test while violating an invariant another primitive depends on). This smoke is the substrate's whole-cloth verification. Scenario: an "iridium voxel world" cell hosts a 32x32x32 tissue at 3 bits per voxel (12 KiB = ESP32-feasible). The cell declares: - foreground game attention class (frame budget pressure) - LOCAL_GPU tropism preference - PTX ribosome target - 16 KiB RAM ceiling (tissue + some scratch) We then simulate the lifecycle: 1. Construct the tissue, fill it half-air half-stone 2. Wrap the cell in a pathway 3. Profile a "raycast" call site through metabolism 4. Apply budget pressure 5. Ask homeostasis for a signal 6. Resolve tropism for the signal 7. Pick ribosome target for the destination tier 8. Log eviction journal entry for the migration Every step asserts the expected outcome from a foreground-game cell under realistic resource pressure.

dependencies 13 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_budget.nx nx_attention_class.nx nx_yield.nx nx_evict_journal.nx nx_metabolism.nx nx_homeostasis.nx nx_palette.nx nx_tropism.nx nx_substrate_compose_test.nx

diagram shows first 10 each side; +3 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tier.nxnx_budget.nxnx_attention_class.nxnx_yield.nxnx_evict_journal.nxnx_metabolism.nxnx_homeostasis.nxnx_palette.nxnx_tropism.nxnx_ribosome.nxnx_pathway.nxnx_tissue.nx

imported by: nobody (leaf or entry point)

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

main nx_budget_new sys_mmap nx_budget_request nx_res_kind_is_valid nx_budget_remaining nx_pathway_new sys_mmap ↻ _spec sys_mmap ↻ nx_pathway_add_cell nx_ac_is_valid nx_tropism_is_valid nx_rbt_is_valid _pathway_cell_at nx_pathway_aggregate_ram_m _pathway_cell_at ↻ nx_metab_new sys_mmap ↻ nx_metab_record _metab_lookup nx_metab_hit_count _metab_lookup ↻ nx_metab_avg_cycles _metab_lookup ↻ nx_metab_suggest_target _metab_lookup ↻ nx_budget_pressure_q10 nx_evict_journal_new sys_mmap ↻ nx_homeo_check nx_budget_pressure_q10 ↻ nx_evict_count_for_cell nx_metab_suggest_target ↻ nx_tropism_resolve nx_tropism_is_valid ↻ nx_ac_is_foreground nx_tropism_is_local nx_pathway_resolve_target nx_pathway_get_cell

structs

none

consts

none

functions

44func _spec(cell_id: nx_int, ac: nx_int, tr: nx_int, rb: nx_int,
called by 1: main calls 1: sys_mmap
57func main() -> i64