test(scheduler-core): task 13 — full cross-phase HA soak regression
Clean rebuild (asan, all components) then 15-round sequential and 15-round chaotic HA soak against the fully integrated feature. Both PASS with zero job loss, zero committed-prefix divergence, zero liveness stall. Closes scheduler-core: all 45 tasks complete. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
1fd467d072
commit
d7093dacdd
1 changed files with 2 additions and 1 deletions
|
|
@ -383,11 +383,12 @@
|
|||
- _Depends: 12.2, 12.3_
|
||||
- _Verified: 2026-08-07 — TEST-ONLY task, no new production code. New test_repl_equivalence.c (683 lines) runs the SAME sched_sim_driver_run() (sim_loop.c) against ONE hand-built `.replay` fixture (two queues at different priorities "high"=5/"normal"=1, four jobs split across THREE ReplaySession boundaries) twice: once in batch mode (interactive=false, straight through), once REPL-driven (interactive=true, stdin freopen()'d from a scripted "step 1\ncontinue\n" -- exactly 2 lines, sufficient and safe regardless of session count since CONTINUE mode never re-reads stdin once entered, avoiding the readline()-EOF-triggers-exit(0) trap). This is a DIFFERENT comparison than task 11.6's test_sim_equivalence.c (which compares normal-mode driver vs simulation driver) -- here both sides are the identical simulation driver, differing only in `sim->interactive`. Both runs set `sched_sim_args_t.output_path` directly (confirmed unconditional on `interactive` by reading sim.c's `args->output_path != NULL` gate), so both write a full `.replay`-format decision stream to their own file with no `set output` REPL command needed. Since the fixture has THREE session boundaries (not task 11.6's one), decoding uses a new decode_all_sessions() that scans the whole output file structurally via sim.c's shared `msg_root_has_shape()` (ReplaySession's distinct (1,2) word/pointer-count shape) rather than a fixed message-skip count. Comparator reuses sim_verify.c's leaf-level structural comparators (`sim_verify_job_alloc_eq()`/`sim_verify_job_preason_eq()`, both `static` but visible via white-box #include) through a duplicated `replay_decision_content_eq()`, same technique test_sim_equivalence.c's own function of that name establishes. Non-tautology guards: session 1 asserted to have EXACTLY 2 decisions (an unambiguous floor -- only 2 jobs could possibly be pending that early), job 501 independently pinned as present in session 1's batch-side content, total batch decisions asserted >= 4, and every decision's type independently pinned as PEND (matching sim_picker_thread_fn()'s documented DISPATCH gap) BEFORE the cross-run equality check -- so a buggy always-`return 1` comparator could not pass silently. Observed (not hand-predicted) that a PEND'd job persists as a picker candidate into later sessions (session 1: jobs 501/502 -> 2 decisions; session 2: 501/503/502 -> 3; session 3: 501/503/502/504 -> 4; total 9 on both sides), confirming the fixture is genuinely non-trivial without needing a fragile hardcoded per-session prediction. Synthetic RED-phase probe: analysis first showed that defeating `repl_should_pause()` (task 12.1's own already-verified probe target) would NOT turn this test red, because that only changes *when* stdin is read/control returns, never *what* gets processed -- every session still eventually completes regardless of pause timing, and this file's own CONTINUE-is-sticky script design tolerates any pause schedule. The correct probe for THIS invariant ("never alters ... what events are processed") had to touch content, and only under `sim->interactive`: temporarily added one line to `xce_repl_on_event()` (repl_break.c) -- which takes a non-const `xce_core_event_t*` and fires (via repl.h's `sim->interactive`-gated wrapper) strictly before an event joins the batch `xce_core_push_events()` later applies -- corrupting a JOBS_PUSH job's jobid (`+= 1000000`) whenever interactive. Rebuilt, ran the full scheduler suite: exactly 4/37 failed (this new test plus three pre-existing REPL tests that also exercise JOBS_PUSH under interactive mode -- sched_repl_execution_control_test, sched_repl_snapshot_params_test, sched_repl_breakpoints_inspection_test -- all correctly detecting the same real divergence), all 33 others stayed green. This test's own failure output: "REPL step/continue-to-completion must produce a byte-identical decision to batch mode at this session and position" (jobid 501 on the batch side vs 1000501 on the REPL side, directly visible in the two runs' printed PEND lines). Reverted (diff-confirmed byte-identical to the pre-probe file), rebuilt, reconfirmed 37/37 scheduler suite (was 36/36), whole-project build clean.
|
||||
|
||||
- [ ] 13. Run full cross-phase HA soak regression
|
||||
- [x] 13. Run full cross-phase HA soak regression
|
||||
- Run sequential and chaotic HA soak rounds against the complete feature (all three phases integrated), confirming zero job loss, divergence, or liveness stall attributable to this feature across the full run
|
||||
- Observable: the soak run completes with a clean pass across all rounds, matching the zero-regression bar set by the Phase 1 and Phase 2 soak runs
|
||||
- _Requirements: 4.3_
|
||||
- _Depends: 12.4, 10.6_
|
||||
- _Verified: 2026-08-07 — Full clean rebuild first (`nix develop ./src -- bash src/tools/xce-build.sh all`, profile=asan): 41/41 meson tests, 15/15 manual scheduler tests, all Go unit tests (apiserver/xcecli), all xceadmin pytest — zero failures, fresh `xce_controller`/`xce_test` binaries (mtime 13:12). Ran `/xce-test-ha` (`.claude/skills/xce-test-ha/run-ha-soak.sh`) against the complete integrated feature (all three phases — picker/core-driver/replay+REPL+simulation — live in one binary) in both required modes, 15 rounds each, fresh deploy dirs, `/home/claude/tmp` (non-overlay fs, dodges bug-924's overlayfs fdatasync wedge): **sequential** — `PASS: 15 rounds, 48 jobs submitted, zero job loss; all 3 nodes led (ctrl-1,ctrl-2,ctrl-3)`; **chaotic** (overlapping kills inside election/catch-up windows, the bug-851-family stress mode) — `VERDICT mode=chaotic rounds=15 jobs=48 committed_divergence=0 committed_job_loss=0 excluded_bug854_discovery=0 excluded_bug924_fdatasync=0 result=PASS`. Zero job loss, zero committed-prefix divergence, zero liveness stall, zero excluded-bug incidents in either mode — matches the zero-regression bar of the sibling specs' Phase 1/Phase 2 soak runs (scheduler-allocation task 3, scheduler-preemption task 6). This closes out scheduler-core: all 45 tasks (1.1–13) complete.
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue