diff --git a/.kiro/specs/scheduler-allocation/design.md b/.kiro/specs/scheduler-allocation/design.md index 5a15d744..8c1dc9e4 100644 --- a/.kiro/specs/scheduler-allocation/design.md +++ b/.kiro/specs/scheduler-allocation/design.md @@ -276,9 +276,15 @@ struct xce_alloc_plan_iter_s { ##### Service Interface ```c +/* Correction (found during task 1.1 implementation): next() returns + * xce_sched_worker_t* (sched/types.h -- resvals/resInUse/host_eval_ctx), + * not xce_worker_t* (xce/types.h -- the wire/config type make_sched_worker() + * converts FROM). requirements.md's own Composition Algorithm pseudocode + * already used xce_sched_worker_t*; this struct declaration was out of + * sync with it. */ struct xce_host_iter_s { int (*init)(xce_host_iter_t* iter, xce_alloc_plan_t* plan, var workers); - xce_worker_t* (*next)(xce_host_iter_t* iter); + xce_sched_worker_t* (*next)(xce_host_iter_t* iter); void (*fini)(xce_host_iter_t* iter); void* private; }; diff --git a/.kiro/specs/scheduler-allocation/requirements.md b/.kiro/specs/scheduler-allocation/requirements.md index 3fad431a..1969b799 100644 --- a/.kiro/specs/scheduler-allocation/requirements.md +++ b/.kiro/specs/scheduler-allocation/requirements.md @@ -425,6 +425,16 @@ typedef struct { ```c typedef struct xce_host_iter_s xce_host_iter_t; +// Correction (found during task 1.1 implementation): next() returns +// xce_sched_worker_t* (sched/types.h -- the scheduler-internal type +// carrying resvals/resInUse/host_eval_ctx), NOT xce_worker_t* (xce/types.h +// -- the wire/config type make_sched_worker() converts FROM). This +// Composition Algorithm's own pseudocode already uses +// `xce_sched_worker_t* w = host_iter->next(host_iter)` -- this struct +// declaration was simply out of sync with it. sched_check_host_satisfy()/ +// sched_meet_host_selection() (resource.c), which any real host_iter +// implementation must call, both take xce_sched_worker_t*, not +// xce_worker_t*. struct xce_host_iter_s { // Initialize the iterator for a given plan and worker set. // Returns 0 on success, nonzero on error. @@ -434,7 +444,7 @@ struct xce_host_iter_s { // Return the next candidate worker matching the plan's host filter, // or NULL when exhausted. The returned worker pointer is valid until // the next next() or fini() call. - xce_worker_t* (*next)(xce_host_iter_t* iter); + xce_sched_worker_t* (*next)(xce_host_iter_t* iter); // Release all resources held by the iterator. void (*fini)(xce_host_iter_t* iter);