myxce/src/scheduler/testsuite
Rongsong Shen 77f047f2e2
fix(scheduler): host-scoped limit staged N times per dispatch (bug-1846 part 1)
match_job_host_limit_() (plugins/limit.c) runs on every per-host
allocation attempt via limit_prepare_allocation(), and unconditionally
xlist_store()d the matched vres into obj->hlimits[worker->idx]. That list
is only rebuilt by limit_job_election() on a configver bump, so a job that
kept pending on the same host gained one more copy per attempt.
sched_fill_limit_requests() then staged every copy into
ctx->alloc_req.host, and seqjob's make_host_alloc() built a host alloc
carrying all of them.

Found via temporary per-decision --sim-verify diagnostics (reverted, not
committed) against scheduler-replay-20260923-085356.replay: pc13v host
allocs held mem + slots + ~70 identical limit entries (72) instead of 3.
After the fix the replay side is always 3 entries, and the LIVE recording
itself still shows the inflation (72/81/96/114/138/177 entries, resetting
only on a config push) -- so this is a production bug, not sim-only.
make_job_account() creates one res_account per entry and
sched_update_res_accounts() charges each, so the host limit was charged
(and later released) N-fold.

Fix: hlimits_contains_() pointer-identity check (vres is interned per name
in privdata->instances); a matched vres is stored once per (job, worker).

Test: test_limit_host_dedup.c (sched_limit_host_dedup_test) -- five
plugin_prepare_allocation() attempts for one job on one worker must leave
hlimits[worker]->count == 1 and one staged copy of the vres in
alloc_req.host. RED before the fix (Expected 1 Was 2), GREEN after; full
scheduler suite 86/86 (asan).

Still open (bug-1846 part 2, logged in buglog): 9 live-recorded rounds end
after 11-12 decisions while replay processes the whole candidate list; not
root-caused, needs the live scheduler.log or a fresh capture.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 04:21:27 +00:00
..
meson.build fix(scheduler): host-scoped limit staged N times per dispatch (bug-1846 part 1) 2026-09-24 04:21:27 +00:00
test.c feat(scheduler-sim-live-allocation): make capacity checks core-safe (task 1.3) 2026-09-18 12:42:11 +00:00
test_admin_request.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_alloc_cache.c feat(scheduler-sim-live-allocation): add unsatisfiable-cache callback seam (task 1.1) 2026-09-18 10:14:04 +00:00
test_alloc_plan_iter.c feat(scheduler-allocation): add lazy plan/host iterator contracts 2026-09-04 13:50:31 +00:00
test_builtin_fcfs_cursor_uaf.c fix(scheduler): invalidate stale builtin_fcfs picker cursors across calls (bug-1686) 2026-08-25 08:49:43 +00:00
test_clock.c fix(scheduler): clock/resval/jobid-format fixes plus REPL live-operator gaps (task 12.5) 2026-08-19 09:48:46 +00:00
test_core_events.c feat(scheduler-sim-live-allocation): make plugin hook dispatch core-safe (task 1.2) 2026-09-18 11:48:08 +00:00
test_core_full_cycle.c fix(scheduler): wire mem reservation reconciliation into live rusage event path 2026-09-01 07:08:37 +00:00
test_core_isolation.c fix(scheduler): close core_clock.c isolation-test coverage gap (bug-1827) 2026-09-19 14:45:20 +00:00
test_core_jbuf_capacity_pin.c feat(scheduler-core): pin jbuf capacity + record kvmgr determinism audit (task 4.2) 2026-08-03 14:09:42 +00:00
test_core_session.c feat(worker-rejoin-resync): task 5 - exclude reconciling host from dispatch 2026-09-01 18:38:07 +00:00
test_core_session_cache_clear.c feat(scheduler-allocation): clear unsatisfiable-resreq cache per session 2026-09-05 00:57:46 +00:00
test_driver_decision_cb.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_driver_session_ordering.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_driver_translate.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_handlers.c fix(bug-1737): scheduler can never learn a job finished successfully 2026-08-31 04:20:27 +00:00
test_host_iter.c feat(scheduler-sim-live-allocation): thread core state through allocation context and host search (task 2.1) 2026-09-18 13:52:14 +00:00
test_job_array_expand.c refactor(scheduler): defer job-array expansion off the vtask thread pool 2026-09-15 09:01:47 +00:00
test_job_array_wire_e2e.c refactor(scheduler): defer job-array expansion off the vtask thread pool 2026-09-15 09:01:47 +00:00
test_job_update.c feat(scheduler-sim-live-allocation): thread core state through allocation context and host search (task 2.1) 2026-09-18 13:52:14 +00:00
test_limit_host_dedup.c fix(scheduler): host-scoped limit staged N times per dispatch (bug-1846 part 1) 2026-09-24 04:21:27 +00:00
test_limit_plugin.c feat(scheduler-sim-diagnostics): add read-only limit plugin accessors 2026-09-17 09:03:09 +00:00
test_maxtasks_wiring_ingest.c test(resreq-maxtasks-wiring): verify driver parity, update-immunity, cache 2026-09-06 07:24:04 +00:00
test_maxtasks_wiring_sim_driver_parity.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_no_bare_printf.c fix(scheduler): sim_print_decision() bypassed tlog, producing inconsistent PEND/DISPATCH/PREEMPT output 2026-08-20 03:02:48 +00:00
test_parjob_combinatorial.c feat(scheduler-sim-live-allocation): close host-scoped limit fan-out seam gap (task 4.3) 2026-09-19 07:38:34 +00:00
test_parjob_e2e_multislot.c test(resreq-maxtasks-wiring): retire multislot test's bug-1770 workaround 2026-09-06 07:49:38 +00:00
test_picker_config_fields.c feat(scheduler-sim-live-allocation): make plugin hook dispatch core-safe (task 1.2) 2026-09-18 11:48:08 +00:00
test_picker_core_loop_boundary.c feat(scheduler-sim-live-allocation): extract shared picker/allocator into sched_election.c (task 3.1) 2026-09-19 02:50:38 +00:00
test_picker_fcfs.c feat(scheduler-core): wire builtin_fcfs as registered default picker (task 2.4) 2026-08-03 08:51:45 +00:00
test_picker_fcfs_session.c feat(scheduler-core): wire builtin_fcfs as registered default picker (task 2.4) 2026-08-03 08:51:45 +00:00
test_picker_iface.c feat(scheduler-core): define job picker plugin contract (task 1.1) 2026-08-03 04:49:55 +00:00
test_picker_pendreason_factory_audit.c feat(scheduler-core): implement session-start signal + decision callback (task 4.4) 2026-08-04 03:08:18 +00:00
test_picker_wiring.c refactor(scheduler): move job-total limit computation to the limit plugin (bug-1790) 2026-09-08 10:44:07 +00:00
test_plugin_hook_dispatch.c fix(scheduler): plugin_end_session() guards on the wrong field (bug-1682/1492) 2026-09-19 11:44:58 +00:00
test_plugin_picker_registration.c refactor(scheduler): move job-total limit computation to the limit plugin (bug-1790) 2026-09-08 10:44:07 +00:00
test_record_lifecycle.c fix(scheduler): recorder silently truncated a round's decisions on realloc failure (bug-1843) 2026-09-23 08:37:42 +00:00
test_recording_path_validation.c feat(scheduler-core): implement record start/stop lifecycle (task 9.2) 2026-08-05 09:07:51 +00:00
test_repl_breakpoints_inspection.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_repl_equivalence.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_repl_event_echo.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_repl_execution_control.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_repl_help.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_repl_limit_table.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_repl_output_compression.c feat(scheduler-sim-repl-verbosity): task 1.1 - RED-phase tests for job identifier range compression 2026-09-02 07:31:31 +00:00
test_repl_prompt_context.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_repl_resource_formatting.c feat(scheduler-sim-repl-verbosity): task 7.1 - RED-phase resource formatting tests 2026-09-02 16:45:59 +00:00
test_repl_resource_table.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_repl_round_rollup.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_repl_snapshot_params.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_repl_step_verbosity.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_resource_accounting.c feat(scheduler-sim-live-allocation): make plugin hook dispatch core-safe (task 1.2) 2026-09-18 11:48:08 +00:00
test_resval_ownership.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_sched_election_sim_fixture.c feat(scheduler-sim-live-allocation): extract shared picker/allocator into sched_election.c (task 3.1) 2026-09-19 02:50:38 +00:00
test_scheduler_backpressure.c feat(component-failover-adoption): validate scheduler backpressure, fix candidate-name diagnostics 2026-08-11 14:00:02 +00:00
test_scheduler_cache_dispatch.c feat(scheduler-sim-live-allocation): make allocation dispatch and decision commit core-safe (task 2.2) 2026-09-18 14:53:59 +00:00
test_scheduler_cache_dispatch_compound.c feat(scheduler-sim-live-allocation): make allocation dispatch and decision commit core-safe (task 2.2) 2026-09-18 14:53:59 +00:00
test_scheduler_connect.c feat(component-failover-adoption): validate scheduler backpressure, fix candidate-name diagnostics 2026-08-11 14:00:02 +00:00
test_scheduler_decision_publish_retry.c fix(scheduler): close post-failover rejoin detection gap (bug-1760) 2026-09-04 04:37:11 +00:00
test_scheduler_decision_redelivery.c test(component-failover-adoption): add scheduler decision-redelivery queue coverage 2026-08-11 23:50:20 +00:00
test_scheduler_dispatch_commit.c feat(scheduler-sim-live-allocation): make allocation dispatch and decision commit core-safe (task 2.2) 2026-09-18 14:53:59 +00:00
test_seqjob_allocator.c feat(scheduler-sim-live-allocation): close host-scoped limit fan-out seam gap (task 4.3) 2026-09-19 07:38:34 +00:00
test_seqjob_rewrap_equivalence.c feat(scheduler-sim-live-allocation): close host-scoped limit fan-out seam gap (task 4.3) 2026-09-19 07:38:34 +00:00
test_sim_alloc_limit_fanout.c feat(scheduler-sim-live-allocation): close host-scoped limit fan-out seam gap (task 4.3) 2026-09-19 07:38:34 +00:00
test_sim_alt_events.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_sim_cache_clear_isolation.c feat(scheduler-allocation): clear unsatisfiable-resreq cache per session 2026-09-05 00:57:46 +00:00
test_sim_contention_limit_driver_parity.c test(scheduler-sim-live-allocation): prove contention parity across drivers (task 5.1) 2026-09-19 08:24:35 +00:00
test_sim_contention_parity.c fix(scheduler): route sim reconciliation's on_dispatch() through the allocator thread (bug-1837) 2026-09-21 12:58:57 +00:00
test_sim_contention_resource_driver_parity.c test(scheduler-sim-live-allocation): prove contention parity across drivers (task 5.1) 2026-09-19 08:24:35 +00:00
test_sim_e2e_limit_visibility.c test(scheduler-sim-live-allocation): prove replay-driven limit visibility (task 5.2, closes bug-1826) 2026-09-19 09:11:40 +00:00
test_sim_e2e_original_motivation.c fix(scheduler): route sim reconciliation's on_dispatch() through the allocator thread (bug-1837) 2026-09-21 12:58:57 +00:00
test_sim_equivalence.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_sim_event_loop.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_sim_isolation.c feat(scheduler-sim-repl-verbosity): task 7.2 - implement resource formatting helpers 2026-09-02 17:45:06 +00:00
test_sim_live_allocation.c fix(scheduler): --sim-verify false-flagged every DISPATCH decision on wall-clock drift (bug-1842) 2026-09-23 03:07:47 +00:00
test_sim_print_decision_gate.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_sim_reconcile_unaccounted.c fix(scheduler): route sim reconciliation's on_dispatch() through the allocator thread (bug-1837) 2026-09-21 12:58:57 +00:00
test_sim_record_output.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_sim_resource_contention.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_sim_round_boundary_reconciliation.c fix(scheduler): route sim reconciliation's on_dispatch() through the allocator thread (bug-1837) 2026-09-21 12:58:57 +00:00
test_sim_session_ordering.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_sim_snapshot_reconcile_gap.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_sim_startup.c fix(scheduler): sim mode force-dispatched recorded decisions past live capacity (bug-1836, bug-1838) 2026-09-21 09:50:27 +00:00
test_sim_verify.c fix(scheduler): 3 --sim-verify false positives + snapshot resreq_fp gap (bug-1844/1845/1772) 2026-09-23 13:40:16 +00:00
test_snapshot_load_allocator_regression.c test(scheduler-snapshot-job-allocation): regression test for allocator crash 2026-08-27 16:31:45 +00:00
test_snapshot_save_load.c fix(scheduler): 3 --sim-verify false positives + snapshot resreq_fp gap (bug-1844/1845/1772) 2026-09-23 13:40:16 +00:00