feat(scheduler-sim-live-allocation): make allocation dispatch and decision commit core-safe (task 2.2)
Retypes sched_make_allocation()/sched_make_primary_allocation()/ sched_make_compound_allocation()/sched_make_alter_allocation()/ sched_commit_decision(), plus 3 private helpers found necessary during migration (sched_make_primary_alloc_(), sched_make_seqjob_ allocation(), sched_make_parjob_allocation()) from xce_scheduler_t* to xce_sched_core_t* in scheduler.c. Wires the one genuine normal-mode-only touch point -- the unsatisfiable-resreq cache, inside sched_make_primary_alloc_() -- through the task-1.1 NULL-safe callback seam (core->unsatisfiable_ lookup_cb/populate_cb) instead of a direct field read. No other normal-mode-only state was found in any of the 8 migrated functions, independently confirmed by both the implementer and reviewer against xce_scheduler_t's own field list -- no escalation needed. Minimal &(sched->core) call-site wraps applied inside sched_allocator()/ commit_decision() (task 3.1's home, not yet migrated), matching the pattern established in tasks 1.2/1.3/2.1. TDD: two-part RED -- a compile-error RED from the sched_commit_decision retype, and a behavioral RED using spy callbacks proving the cache seam was genuinely unconsulted before this fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
This commit is contained in:
parent
d52c78e4be
commit
ecdea8bf55
6 changed files with 213 additions and 51 deletions
|
|
@ -162,7 +162,7 @@ static void test_dispatch_commit_transitions_job_to_run(void)
|
|||
decision = make_dispatch_decision(alloc);
|
||||
TEST_ASSERT_NOT_NULL(decision);
|
||||
|
||||
rc = sched_commit_decision(&sched, decision);
|
||||
rc = sched_commit_decision(&(sched.core), decision);
|
||||
TEST_ASSERT_TRUE(rc >= 0);
|
||||
|
||||
/* the new behavior this task adds */
|
||||
|
|
@ -218,7 +218,7 @@ static void test_dispatch_commit_survives_round_boundary_before_confirmation(voi
|
|||
decision = make_dispatch_decision(alloc);
|
||||
TEST_ASSERT_NOT_NULL(decision);
|
||||
|
||||
rc = sched_commit_decision(&sched, decision);
|
||||
rc = sched_commit_decision(&(sched.core), decision);
|
||||
TEST_ASSERT_TRUE(rc >= 0);
|
||||
TEST_ASSERT_EQUAL_UINT(JOB_STAT_RUN, job->state);
|
||||
TEST_ASSERT_NOT_NULL(job->accounts);
|
||||
|
|
@ -264,7 +264,7 @@ static void test_pend_decision_does_not_touch_job_state(void)
|
|||
decision = make_pend_decision(reason);
|
||||
TEST_ASSERT_NOT_NULL(decision);
|
||||
|
||||
rc = sched_commit_decision(&sched, decision);
|
||||
rc = sched_commit_decision(&(sched.core), decision);
|
||||
TEST_ASSERT_TRUE(rc >= 0);
|
||||
|
||||
TEST_ASSERT_EQUAL_UINT(JOB_STAT_PEND, job->state);
|
||||
|
|
@ -316,7 +316,7 @@ static void test_dispatch_commit_survives_several_rounds_before_confirmation(voi
|
|||
decision = make_dispatch_decision(alloc);
|
||||
TEST_ASSERT_NOT_NULL(decision);
|
||||
|
||||
rc = sched_commit_decision(&sched, decision);
|
||||
rc = sched_commit_decision(&(sched.core), decision);
|
||||
TEST_ASSERT_TRUE(rc >= 0);
|
||||
TEST_ASSERT_EQUAL_UINT(JOB_STAT_RUN, job->state);
|
||||
|
||||
|
|
@ -396,7 +396,7 @@ static float run_dispatch_then_n_rounds(int nrounds)
|
|||
decision = make_dispatch_decision(alloc);
|
||||
TEST_ASSERT_NOT_NULL(decision);
|
||||
|
||||
rc = sched_commit_decision(&sched, decision);
|
||||
rc = sched_commit_decision(&(sched.core), decision);
|
||||
TEST_ASSERT_TRUE(rc >= 0);
|
||||
TEST_ASSERT_EQUAL_UINT(JOB_STAT_RUN, job->state);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue