code wiki / _hdl_build / nx_work_dispatcher.nx

nx_work_dispatcher.nx

buildroot/runtime/_hdl_build/nx_work_dispatcher.nx

2112 B47 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic work
docsdependenciesstructsconstsfunctions

about

nx_work_dispatcher.nx -- the team picks items off the backlog and works them like a real team: respects the governor's worker budget, tracks status, and ESCALATES blockers ("reaches out for help") instead of spinning (operator: "acts like a real team picking up items from the backlogs and working them and reaching out for help when they encounter blockers"). Supports a manual OVERRIDE pick (crash-the-gates). Pure policy. license_tier: ORIGINAL Driven by nx_resource_governor + nx_sysload; priorities from the PM decision matrix.

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_work_dispatcher.nx nx_assignments_run.nx nx_team_console.nx

imports: nx_syscalls.nx

imported by: nx_assignments_run.nxnx_team_console.nx

structs

none

consts

10const WD_QUEUED: i64 = 0
11const WD_RUNNING: i64 = 1
12const WD_BLOCKED: i64 = 2
13const WD_DONE: i64 = 3
14const WD_HELP: i64 = 4 // escalated -- reached out for help

functions

17func wd_start_count(worker_budget: i64, running: i64, queued: i64) -> i64
called by 1: main
25func wd_pick(states: *i64, prio: *i64, n: i64, override_idx: i64) -> i64
called by 1: main
33func wd_should_escalate(state: i64) -> i64 { if state == WD_BLOCKED { return 1 } return 0 }
called by 1: main
35func wd_count(states: *i64, n: i64, s: i64) -> i64
called by 1: main
41func wd_state_label(s: i64) -> *u8
called by 1: main