feat(scheduler-sim-live-allocation): close host-scoped limit fan-out seam gap (task 4.3)
Fully closes bug-1829's own tracked follow-up from task 4.1: retypes seqjob_allocator.c/parjob_allocator.c's init_fn AND runtime hooks (prepare_allocation_hook, job_alloc_fn) to read the plugin's own honest plugin->core field (task 1.2) instead of deriving an xce_scheduler_t* from plugin->sched -- mirroring task 2.3's limit.c migration exactly. The gap was broader than initially scoped: not just init_fn, but every runtime hook independently derived sched from plugin->sched on each allocation attempt. Adds seqjob_allocator_new_plugin()/parjob_allocator_new_plugin() factories (plugin.h, mirroring limit_new_plugin()), letting sim_alloc.c's bootstrap functions register both plugins DIRECTLY against &(sim->core) via the existing plugin_register_core() -- the same call sim_bootstrap_picker()/sim_bootstrap_limit_plugin() already use. Task 4.1's throwaway xce_scheduler_t wrapper is gone from the plugin-registry/fan-out path entirely; plugin_prepare_allocation()'s fan-out during a live seqjob/parjob dispatch now genuinely reaches sim->core.plugins, the same registry the limit plugin is registered in. One narrow, necessary exception remains, independently verified confined: my_alloc() still needs a small xce_scheduler_t wrapper (only .core.resmgr aliased to sim->core) to satisfy sched_make_allocs() (scheduler.c, out of this task's boundary, unmodified) -- set on plugin->sched only AFTER plugin_register_core() has run, never read by the plugin registry or any prepare_allocation_hook fan-out. TDD: new test_sim_alloc_limit_fanout.c drives a real live dispatch (sched_job_picker()/sched_allocator() thread pair) with a host-scoped limit registered directly against sim->core, proving a real usage instance is created -- isolated from both reconciliation and global-limit matching. RED: dispatch succeeded but the usage-instance iterator was empty. GREEN: 82/82, zero regressions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
This commit is contained in:
parent
915782fc66
commit
f6a2862110
12 changed files with 778 additions and 193 deletions
|
|
@ -2107,3 +2107,31 @@ sched_sim_live_allocation_test = executable(
|
|||
test('scheduler sim live allocation test',
|
||||
sched_sim_live_allocation_test, suite: 'scheduler',
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
|
||||
# scheduler-sim-live-allocation spec, task 4.3 (Req 2.2, boundary: Unified
|
||||
# Picker/Allocator Threads, Limit Plugin Core-Safe Matching): proves a
|
||||
# host-scoped limit registered directly against simulation mode's real core
|
||||
# (sim_bootstrap_limit_plugin()) is matched -- and its usage instance
|
||||
# created -- during a genuine seqjob/parjob dispatch attempt driven through
|
||||
# the real sched_job_picker()/sched_allocator() thread pair, closing the
|
||||
# gap task 4.1 left (bug-1829: the seqjob/parjob allocator plugin's own
|
||||
# plugin->core pointed at a throwaway wrapper's separate registry, never
|
||||
# sim.core.plugins). Same real-scheduler_srcs link technique as
|
||||
# sched_election_sim_fixture_test/sched_sim_live_allocation_test above.
|
||||
sched_sim_alloc_limit_fanout_test_srcs = ['test_sim_alloc_limit_fanout.c']
|
||||
foreach f : scheduler_srcs
|
||||
if f != 'src/main.c'
|
||||
sched_sim_alloc_limit_fanout_test_srcs += ['../' + f]
|
||||
endif
|
||||
endforeach
|
||||
|
||||
sched_sim_alloc_limit_fanout_test = executable(
|
||||
'sched_sim_alloc_limit_fanout_test',
|
||||
sched_sim_alloc_limit_fanout_test_srcs,
|
||||
include_directories:[incdir],
|
||||
dependencies: [scheduler_test_deps],
|
||||
install: false)
|
||||
|
||||
test('scheduler sim alloc limit fanout test',
|
||||
sched_sim_alloc_limit_fanout_test, suite: 'scheduler',
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue