code wiki / (root) / nx_build_plan_sim.nx

nx_build_plan_sim.nx

buildroot/runtime/nx_build_plan_sim.nx

5164 B127 linesdepth 4pulls 4 transitivereach 1 importersview sourcekind librarytopic build
docsdependenciesstructsconstsfunctions

about

nx_build_plan_sim.nx -- simulator for the multi-process build plan. ===================================================================== CARDINAL: [[feedback-simulation-discipline-for-every-substrate]] Second-substrate demonstration of the simulation discipline. First stone was nx_print_sim (3d-print physics). THIS file applies the same SimulatorState + step + sealed-enum issue framework to a completely different substrate (multi-process schedule solver) -- proving the discipline generalizes. Industry: there is no production cross-process build-plan scheduler at all (humans + spreadsheets coordinate today), let alone a simulator that predicts schedule failures. What this simulator predicts on a SOLVED build plan: DEADLINE_MISSED total schedule > caller-supplied deadline POST_CURE_OVERRUN any part's post-cure > caller max PRINTER_IDLE_WASTE one process's printer idle most of its used window (heuristic candidate -- queued per the cardinal's no-heuristic rule) FIRST STONE here ships the first two (real time-arithmetic, not heuristic). PRINTER_IDLE_WASTE deferred until we have a clearer physical definition. ===================================================================== license_tier: ORIGINAL

dependencies 3 imports · 1 importers

nx_syscalls.nx nx_print_process.nx nx_build_plan.nx nx_build_plan_sim.nx nx_build_plan_sim_test.nx

imports: nx_syscalls.nxnx_print_process.nxnx_build_plan.nx

imported by: nx_build_plan_sim_test.nx

structs

53struct NxBuildPlanSimIssue

consts

36const NX_BUILD_SIM_ISSUE_NONE: i64 = 0
37const NX_BUILD_SIM_ISSUE_DEADLINE_MISSED: i64 = 1
38const NX_BUILD_SIM_ISSUE_POST_CURE_OVERRUN: i64 = 2
39const NX_BUILD_SIM_ISSUE_PRINTER_IDLE_WASTE: i64 = 3 // queued (next stone)
40const NX_BUILD_SIM_ISSUE_N: i64 = 4
60const NX_BUILD_PLAN_SIM_ISSUE_BYTES: i64 = 32

functions

42func nx_build_sim_issue_is_valid(k: i64) -> i64
called by 1: main
78func nx_build_plan_sim_check(plan: *NxBuildPlan,
called by 1: main