feat(scheduler-sim-decision-trace): hook the allocator runner

Task 3.4: the runner records no-plan reasons, the cluster-wide check,
plans (tried, discarded, not tried) and their ends, positions, claimed
skips and per-host candidate verdicts, rollbacks, commit or finalize
failure, and search end. A declined or generator-failed requirement now
counts once as 'no plan generated'. Runner results are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-08 12:04:16 +00:00
parent d4bee4b5d0
commit 16f40fa9dc
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
9 changed files with 1216 additions and 14 deletions

View file

@ -515,6 +515,7 @@ struct xce_sched_trace_rec_s {
int scope_discarded;
int scope_not_tried;
bool scope_plan_err; /* a tried plan ended in an internal error */
bool scope_no_plan; /* a no-plan reason already counted the search */
/* summary level: the current position's host tallies. The limit
* tallies live in builder memory (malloc'd, not the arena) until the
* position ends, so an omitted position allocates nothing in the
@ -616,13 +617,17 @@ sched_trace_attempt_reasons(xce_sched_trace_rec_t* rec,
int ncodes, const char* const* hosts, int nhosts,
const char* const* res, int nres);
/* Cluster-wide check scope. check_begin stores no entry; check_end stores
* the result, which on failure says no placement plans were tried (4.8). */
/* Cluster-wide check scope. check_begin stores no entry and drops any
* host scope left open; check_end stores the result, which on failure
* says no placement plans were tried (4.8). */
extern void sched_trace_check_begin(xce_sched_trace_rec_t* rec,
const xce_sched_obj_t* obj);
extern void sched_trace_check_end(xce_sched_trace_rec_t* rec, int rc,
bool plans_follow);
/* No plan generated for the current requirement, and why (4.7). Counts
* the requirement under "no plan generated" (9.3), once: a search end
* later in the same requirement makes no statement and counts nothing. */
extern void sched_trace_no_plan(xce_sched_trace_rec_t* rec,
xce_sched_trace_noplan_t why);
@ -696,6 +701,7 @@ extern void sched_trace_finalize_failed(xce_sched_trace_rec_t* rec, int err);
* generated (g == 0), all discarded (g > 0, d == g), or none placed (t > 0
* and no tried plan ended in an internal error). The matching decision-
* wide counter is bumped under the same conditions, stored or not (9.3).
* After a no_plan entry in the requirement, there is no statement.
*/
extern void sched_trace_search_end(xce_sched_trace_rec_t* rec, int rc);