test(scheduler-sim-decision-parity): regression suite for existing guarantees (task 4.2)
Four checks in one run: (a) REPL-vs-batch decision equivalence unmodified and still passing; (b) --sim-verify reports no false mismatch for a recording with multiple already-resolved jobs across rounds (non-adjacent memmove compaction, no cross-round bleed); (c) a replay starting from a snapshot with a job already RUN-state and no in-window recorded decision degrades gracefully (no crash, no fabricated value, a second ordinary job unaffected) -- the first test to exercise reconciliation's "not found" path through the real sched_sim_driver_run()/xce_sched_core_load_snapshot() path rather than a hand-built core; (d) normal-mode behavior is byte-for- byte unchanged (zero production diff, the strongest possible evidence). Found and fixed a real test-authoring gap while building (b): builtin_fcfs re-offers a still-PEND job as a fresh PEND every round (confirmed pre-existing, unrelated, also visible in test_repl_equivalence.c's own fixture) -- the first draft's round-2 fixture omitted this recurrence. No production code touched (task 3 already completed the feature) -- git diff on sim_loop.c/resource.c/scheduler.c/driver.c/sim_verify.c is empty. 49/50 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
b31907324c
commit
88bed529a7
4 changed files with 803 additions and 1 deletions
|
|
@ -70,7 +70,7 @@
|
|||
- _Depends: 3_
|
||||
- _Boundary: Scheduler test suite (contention parity)_
|
||||
|
||||
- [ ] 4.2 (P) Regression suite: existing guarantees still hold
|
||||
- [x] 4.2 (P) Regression suite: existing guarantees still hold
|
||||
- Re-run the existing interactive-vs-batch decision-equivalence coverage unmodified and confirm it still passes
|
||||
- Extend decision-verification coverage with a recording containing already-resolved jobs and confirm no mismatch is reported as a result of this feature
|
||||
- Confirm a replay starting from a snapshot with jobs already running at snapshot time (no recorded decision available in-window) degrades gracefully rather than crashing or fabricating a value
|
||||
|
|
@ -99,3 +99,5 @@
|
|||
- (task 3) `get_resvals()` (resource.c) returns `nres` (the count filled in) on success, NOT `0` -- a test-authoring bug (bug-1622, not production) came from assuming the latter. If you write a test against `get_resvals()`, check its actual return-value contract first.
|
||||
- (task 3) Feature is now end-to-end wired and independently confirmed working (reviewer removed the call site itself and watched both integration tests fail for the right reason, then restored and watched them pass). Tasks 4.1-4.3 (Validation) can now exercise the real, complete path -- no more "not fully wired yet" caveats apply.
|
||||
- (task 4.1) `sim_picker_thread_fn()` is confirmed (by direct read, independently re-confirmed by the reviewer) to be structurally PEND-only -- it has no capacity-check/dispatch path for a job it evaluates fresh. This means task 1.2's fixture (or any single-round, freshly-arriving-jobs fixture) can NEVER be literally replayed-and-diffed for full dispatch/PEND parity -- sim's picker always PENDs a fresh job regardless of whether resource accounting is correct, so that comparison would be tautological for freshly-arriving jobs (though still meaningful for reconciled/already-resolved jobs). If a later task needs "real recording vs. sim replay" parity proof, build it the way task 4.1 did: a real driven normal-mode recording plus a hand-crafted sim-mode fixture modeling the identical facts (including at least one already-resolved-before-replay job to exercise reconciliation), not a literal single-file replay-and-diff. This is a real architectural limit, not a testing shortcut -- true dispatch-decision parity for freshly-arriving jobs is scheduler-allocation's (a separate, not-yet-designed spec) job, out of this feature's scope.
|
||||
- (task 4.2) `builtin_fcfs`'s pend-handling (`builtin_fcfs_on_pend`/`begin_session`) never clears a job from `pendJobs` once it's added -- a still-genuinely-PEND job recurs as a fresh PEND decision in the recorded stream EVERY round/session, not just once. This is pre-existing, unrelated-to-this-feature behavior (also visible in `test_repl_equivalence.c`'s own existing fixture). If you build a multi-round `.replay` fixture with a job that stays PEND across rounds, expect and account for that job reappearing in every round's decoded decisions -- don't assume a PEND is a one-time event.
|
||||
- (task 4.2) Not every reconciliation-adjacent test needs to be discriminating via the "disable the reconciliation call site" toggle to be worth keeping -- a test exercising the "not found, nothing to reconcile" branch through the REAL `sched_sim_driver_run()`/`xce_sched_core_load_snapshot()` path can be identical whether reconciliation runs or not, and still catch real bugs (fabrication, snapshot-load corruption, crashes) that a hand-built-core unit test (task 2.2's) can't reach. Judge a test's value by what regression classes it actually covers, not solely by one discriminating-power toggle.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue