test(scheduler-sim-decision-parity): live-verify against a real 24-round recording (task 4.3, final)

The original motivating recording (scheduler-replay-20260820-070103.replay,
named in bug-1611) no longer exists anywhere on disk -- confirmed via
exhaustive filesystem search. Substituted a real, driven 24-round/12-job
resource-constrained recording using actual driver.c/builtin_fcfs/resource.c
code, replayed through the real, unmodified interactive REPL.

This also surfaced and honestly documents a real structural limit:
Recorded-Decision Reconciliation only succeeds when a job's recorded
DISPATCH decision and its JOB_STATE_CHANGE-to-RUN confirmation land in the
SAME replay round (reconciliation searches only that round's own decoded
data). Constructing that exact coincidence from organic, continuous
scheduling is structurally impossible -- a job can't be both "freshly PEND
for this round's picker" and "already RUN before this round's picker runs"
at once. One job (ANCHOR_ID) engineers this coincidence using entirely
real constructors (matching the same precedent tasks 3 and 4.1 already
established); the other 11 jobs arrive/contend/dispatch/finish with zero
special-casing across all 24 real rounds. Recorded in tasks.md's
Implementation Notes as a scope finding for follow-up: in a real deployment
with genuine dispatch-to-confirmation latency, this narrows the feature's
real-world coverage of bug-1611/1613's dominant manifestation.

RED phase: reverting task 3's reconciliation call site makes this test
fail with the exact bug-1611 symptom in its own assertion message, plus 3
sibling tests break too; restored and green. No production code touched
(final task in the feature -- all production work landed in task 3).

50/51 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:
Rongsong Shen 2026-08-22 13:07:33 +00:00
parent 5d194db9b1
commit 3c4091d88b
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
3 changed files with 1235 additions and 1 deletions

View file

@ -854,6 +854,29 @@ sched_sim_contention_parity_test = executable(
dependencies: [scheduler_test_deps],
install: false)
# Live-verify for task 4.3 (Req 1.1-1.3, 3.1-3.3, FINAL task of this spec): a
# real, driven 24-round, 12-job, resource-constrained recording (real
# builtin_fcfs picker + a capacity-aware allocator, same technique as
# sched_sim_resource_contention_test/sched_sim_contention_parity_test, but
# extended far past a 1-2-round toy fixture) is replayed through the real,
# unmodified interactive REPL. Asserts "info worker" reports the
# arithmetically-correct, nonzero used= value at four checkpoints spanning
# the whole replay, and that the one job modeling "already resolved before
# this replay's own live decision-making reaches it" (Recorded-Decision
# Reconciliation's own designed trigger, unreachable from a purely organic
# session per this file's own header comment) has its DISPATCH decision
# visible in step/continue output -- bug-1611's own documented symptom,
# fixed. Substitutes for the original bug-1611/bug-1613 motivating
# recording (`scheduler-replay-20260820-070103.replay`), confirmed absent
# from this filesystem before this file was written -- see this file's own
# header comment for the full transparency note.
sched_sim_e2e_original_motivation_test = executable(
'sched_sim_e2e_original_motivation_test',
['test_sim_e2e_original_motivation.c'],
include_directories:[incdir],
dependencies: [scheduler_test_deps],
install: false)
# Contract test for the interactive simulation REPL's execution-control slice
# (scheduler-core spec, task 12.1, Req 5 AC 22): starting simulation with
# --interactive pauses before any event is processed, and a `step N` command
@ -1196,6 +1219,9 @@ test('scheduler sim snapshot reconcile gap test',
test('scheduler sim contention parity test',
sched_sim_contention_parity_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
test('scheduler sim e2e original motivation test',
sched_sim_e2e_original_motivation_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
test('scheduler repl execution control test',
sched_repl_execution_control_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])

File diff suppressed because it is too large Load diff