#if !defined(_DECISION_H_) #define _DECISION_H_ 1 #include "xce/types.h" #include typedef enum { XCE_DECISION_NONE = 0, XCE_DECISION_DISPATCH, XCE_DECISION_PEND, XCE_DECISION_NEW_SESSION, XCE_DECISION_PREEMPT } xce_decision_op_t; /* * xce_preempt_victim_t / xce_preempt_t - PREEMPT decision payload * (scheduler-core spec, task 4.4, Req 5 AC 6). Scheduler-owned (not * xce/types.h): design.md's Boundary Commitments note that the PREEMPT * wire shape is owned by this spec while victim-*selection* semantics * belong to the (separate, not-yet-implemented) scheduler-preemption spec * -- so these two structs carry exactly AC 6's field list ("jobid, * victims[] (jobid, workerid per victim), reason") and nothing more. * * `victims` follows the same "int count; T** items" idiom as * xce_job_dispatch_t.allocs / xce_preason_set_t.reasons (xce/types.h) -- * an array of pointers, not a flat array, for consistency with every other * decision-adjacent list in this codebase. */ typedef struct { uint64_t jobid; char* workerid; } xce_preempt_victim_t; typedef struct { uint64_t jobid; int nvictims; xce_preempt_victim_t** victims; xce_pendreason_t* reason; } xce_preempt_t; typedef struct { xce_decision_op_t op; union { xce_job_alloc_t* alloc; xce_pendreason_t* reason; xce_preempt_t* preempt; } u; } xce_decision_t; extern xce_decision_t* make_pend_decision(xce_pendreason_t*); extern xce_decision_t* make_dispatch_decision(xce_job_alloc_t*); extern xce_decision_t* make_preempt_decision(xce_preempt_t*); #endif