fix(scheduler-sim-decision-parity): give sim mode driver.c's round-boundary split (task 2.1)
Replaces sim_loop.c's monolithic xce_core_go() with the same xce_core_begin_session() -> sched_account_jobs() -> xce_core_signal_go() sequence driver.c already uses for normal-mode rounds, opening the same interleaving window and calling the now-core-level accounting service (task 1.1) at the same relative position. Error-handling for a failed session start is preserved byte-for-byte (same cleanup, same rc source). Both interactive and batch simulation runs go through this one call site. This is bug-1613's wiring half: sim_loop.c now calls sched_account_jobs() at all (it never did before). resInUse is still zero end-to-end after this task alone, because job->accounts is never populated by any live path in sim mode yet -- that's Recorded-Decision Reconciliation (tasks 2.2-2.4), not yet implemented; a comment marks where it slots in. Adds a call-count/session-window regression test proving the wiring itself (RED-phase reproduced live via git stash + rebuild, matching bug-1613's symptom exactly). 8 sibling white-box test files needed a link-satisfying sched_account_jobs() stub, discovered via actual linker errors. 45/46 scheduler tests pass; the 1 failure is pre-existing bug-1560 (unrelated). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
76ca61547e
commit
134380b871
12 changed files with 750 additions and 9 deletions
|
|
@ -726,6 +726,32 @@ sched_sim_equivalence_test = executable(
|
|||
dependencies: [scheduler_test_deps],
|
||||
install: false)
|
||||
|
||||
# Round-boundary ordering contract for the simulation driver
|
||||
# (scheduler-sim-decision-parity spec, task 2.1, Req 1.3/1.4, 5.1, 5.3): the
|
||||
# sim-mode counterpart to sched_driver_session_ordering_test above -- proves
|
||||
# sim_loop.c's sched_sim_driver_run() now calls the relocated
|
||||
# sched_account_jobs() (core.h, task 1.1) once per replayed round, strictly
|
||||
# inside that round's session-active window, mirroring driver.c's
|
||||
# xce_sched_driver_run_normal_mode_round() exactly. Before this task,
|
||||
# sim_loop.c called the older monolithic xce_core_go() with no interleaving
|
||||
# slot and never called sched_account_jobs() at all (bug-1613) -- every
|
||||
# worker's/shared resource's resInUse stayed permanently zero for the whole
|
||||
# `--sim`/`--interactive` run. Same combined white-box #include set as
|
||||
# sched_sim_equivalence_test (records two real normal-mode rounds via the
|
||||
# REAL normal-mode driver, then replays the same file through the REAL,
|
||||
# unmodified simulation driver) -- see the test's own header comment for why
|
||||
# a spy sched_account_jobs() (not the real one) is the right-strength proof
|
||||
# here, and why no cross-thread wbuf-rendezvous replica of
|
||||
# test_driver_session_ordering.c's own design is attempted (sim_loop.c's
|
||||
# picker thread is not independently substitutable from a test without
|
||||
# touching sim_picker.c, outside this task's boundary).
|
||||
sched_sim_session_ordering_test = executable(
|
||||
'sched_sim_session_ordering_test',
|
||||
['test_sim_session_ordering.c'],
|
||||
include_directories:[incdir],
|
||||
dependencies: [scheduler_test_deps],
|
||||
install: false)
|
||||
|
||||
# Resource-contention replay fixture (scheduler-sim-decision-parity spec,
|
||||
# task 1.2, Req 2.1/2.2): existing fixtures in this directory never have
|
||||
# scarce capacity, so none can exercise or prove capacity-check correctness.
|
||||
|
|
@ -1073,6 +1099,9 @@ test('scheduler sim record output test',
|
|||
test('scheduler sim equivalence test',
|
||||
sched_sim_equivalence_test, suite: 'scheduler',
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
test('scheduler sim session ordering test',
|
||||
sched_sim_session_ordering_test, suite: 'scheduler',
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
test('scheduler sim resource contention test',
|
||||
sched_sim_resource_contention_test, suite: 'scheduler',
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue