feat(scheduler-sim-live-allocation): make capacity checks core-safe (task 1.3)

Re-types sched_meet_host_selection(), sched_check_shared_satisfy()
(+its _ helper), sched_check_host_satisfy() (+its _ helper), and the
private unsatisfy_() helper they share, from xce_scheduler_t* to
xce_sched_core_t*, in resource.c.

Fixes every call site this forces (a C signature migration cannot
keep the build green otherwise): sched_try_alloc_on_host_() (2 sites,
already partially touched by task 1.2), host_iter.c's
sched_host_iter_next() (2 sites), and parjob_allocator.c/
seqjob_allocator.c's my_alloc() (1 site each) -- each fix is a minimal
&(sched->core) argument wrap, no algorithm change, preserving
host_iter/parjob/seqjob's own allocation algorithm exactly as-is.

Adds test_core_safe_allocation_chain_driver_parity, proving all three
functions produce identical grant/deny results whether given
normal-mode-shaped or simulation-mode-shaped core state.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
This commit is contained in:
Rongsong Shen 2026-09-18 12:42:11 +00:00
parent e8866641a6
commit 55173fca27
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
13 changed files with 345 additions and 53 deletions

View file

@ -661,7 +661,10 @@ static void* capacity_aware_allocator_thread_fn(void* arg)
rc = xvec_idval_store(&wanted, SLOTS_RESIDX, want);
TEST_ASSERT_TRUE(rc >= 0);
rc = sched_check_host_satisfy(sched, w, &uncomitted, &wanted, &unmeet);
/* scheduler-sim-live-allocation task 1.3: sched_check_host_
* satisfy() is now core-typed -- pass the already-derived `core`
* local. */
rc = sched_check_host_satisfy(core, w, &uncomitted, &wanted, &unmeet);
xvec_fini(&uncomitted);
xvec_idval_fini(&wanted);