code wiki / (root) / nx_select_joint.nx

nx_select_joint.nx

buildroot/runtime/nx_select_joint.nx

12884 B340 linesdepth 4pulls 5 transitivereach 17 importersview sourcekind librarytopic select
docsdependenciesstructsconstsfunctions

about

nx_select_joint.nx -- joint DAG variant selector (MVP: 2-node). SA-5 partial milestone of NISHI_SELF_ASSEMBLY_ROADMAP.md. Full N- node ILP solver deferred to next session; this MVP demonstrates the LOAD-BEARING property: layout compatibility across an edge can force the solver to pick a NON-LOCALLY-OPTIMAL variant at one node to enable a cheaper variant at another node. Selection function (joint, 2-node): S_joint(G, P, K, π) = argmin_{(a, b)} cost(a, P, K, π) + cost(b, P, K, π) + transfer_cost(a, b) s.t. requires(a) ⊆ P AND requires(b) ⊆ P out_layout(a) compatible-with in_layout(b) transfer_cost(a, b) = 0 when out_layout(a) == in_layout(b) (V1; SA-6 will add real transform-bytes cost) MVP scope (this session): - Exactly 2 nodes (producer -> consumer); 1 edge - Exhaustive search over all (a, b) candidate pairs - Layout-compat edge constraint (nx_layout_compatible) - Returns selected indices via *i64 array out[0], out[1] Deferred: - N-node DAGs with topological order + chain composition (next session) - ILP solver for hard cases (SA-6+) - Greedy + backtrack heuristic for large DAGs (SA-7) - Real transfer_cost from edge bandwidth (SA-6 with nx_calibrate emitting bytes-on-wire estimates) - Cross-edge layout transform variants (SA-7) genealogy_id: petabricks_2009 + halide_schedule_search_2019 + polly_loop_polyhedral + cardinal_2026-05-19_self_assembly lineage_id: substrate_select_joint_v1 nx_capability_manifest: variant_class: capability_select_joint variant_id: capability_select_joint_v1_two_node_exhaustive requires_isa: [rv64imac, x86_64]

dependencies 4 imports · 12 importers

nx_syscalls.nx nx_probe.nx nx_calibrate.nx nx_select.nx nx_select_joint.nx nx_install_attest_signed_test.nx nx_install_attest_test.nx nx_install_hash_test.nx nx_install_pipeline.nx nx_install_pipeline_test.nx nx_install_plan.nx nx_install_plan_test.nx nx_select_joint_chain_test.nx nx_select_joint_test.nx nx_spore_up_lifecycle_test.nx

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

imports: nx_syscalls.nxnx_probe.nxnx_calibrate.nxnx_select.nx

imported by: nx_install_attest_signed_test.nxnx_install_attest_test.nxnx_install_hash_test.nxnx_install_pipeline.nxnx_install_pipeline_test.nxnx_install_plan.nxnx_install_plan_test.nxnx_select_joint_chain_test.nxnx_select_joint_test.nxnx_spore_up_lifecycle_test.nxnx_spore_up_network_test.nxnx_spore_up_test.nx

structs

74struct NxJointNode

consts

63const NX_MAGIC_9223372036854775000: i64 = 9223372036854775000
66const NX_SEL_JOINT_OK: i64 = 0
67const NX_SEL_JOINT_BAD_INPUT: i64 = -1
68const NX_SEL_JOINT_NO_FEASIBLE_PAIR: i64 = -2
190const NX_SEL_JOINT_CHAIN_MAX: i64 = 32 // upper bound on N

functions

87func nx_select_joint_2node(
162func nx_joint_node_new(variant_class: i64, manifest_ptrs: *i64,
192func nx_select_joint_chain(