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
|
|
@ -17,7 +17,7 @@
|
|||
- _Boundary: Scheduler test suite (contention fixture)_
|
||||
|
||||
- [ ] 2. Core: round-boundary accounting and decision reconciliation
|
||||
- [ ] 2.1 Give simulation mode the same round-boundary accounting sequence normal mode uses
|
||||
- [x] 2.1 Give simulation mode the same round-boundary accounting sequence normal mode uses
|
||||
- Replace simulation mode's single combined session-start call with the same two-step sequence (reset accounting, then unblock the picker) the normal-mode driver already uses, opening an interleaving point between them
|
||||
- Call the relocated resource re-accounting service (task 1.1) in that interleaving point, in the same relative position the normal-mode driver already calls it
|
||||
- Preserve the existing error-handling behavior for a failed session start exactly as it works today
|
||||
|
|
@ -89,3 +89,5 @@
|
|||
|
||||
## Implementation Notes
|
||||
- (task 1.2) Whole-scenario white-box test files in `src/scheduler/testsuite/` (fixture construction + real driver/allocator plumbing) routinely exceed the project's 800-line guidance (`test_sim_verify.c` is 934 lines, uncorrected; the new `test_sim_resource_contention.c` is 883) — the steering's "don't use as precedent" caveat names only non-test files, so this is an accepted pattern for this class of test, not a defect to fix per task. Tasks 4.1-4.3 will likely add similarly-sized files; don't flag file size alone as blocking for them.
|
||||
- (task 2.1) Confirmed (by reading `sim_picker_thread_fn()`): simulation mode's live picker thread unconditionally PENDs every job today, and `sched_commit_decision()` (the only real setter of `job->accounts`) is normal-mode-only. So after 2.1 alone, `resInUse` is still zero end-to-end in sim mode -- 2.1 only wires the call site/interleaving slot. Tasks 2.2-2.4 (Recorded-Decision Reconciliation) are what actually populate `job->accounts` and make `resInUse` correct. Don't expect nonzero `resInUse` from a sim run until 2.2-2.4 land -- this is expected, not a regression.
|
||||
- (task 2.1) White-box test files that `#include "../src/sim_loop.c"` directly (test_sim_event_loop.c, test_sim_verify.c, test_sim_alt_events.c, test_sim_record_output.c, test_repl_breakpoints_inspection.c, test_repl_snapshot_params.c, test_repl_execution_control.c, test_repl_equivalence.c) need a link-satisfying stub added whenever sim_loop.c gains a new extern reference (here: `sched_account_jobs()`). Tasks 2.2-2.4 will likely add more such references (e.g. into the recorded-decision/reporting machinery) -- expect to touch these same 8 files again for stub updates, and check for linker errors rather than guessing which files need it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue