test(resreq-maxtasks-wiring): verify driver parity, update-immunity, cache

Extends test_maxtasks_wiring_ingest.c with two tests: (1) a resource-
request update never changes a job's already-dispatched task count,
because core_events.c's live JOB_UPDATE handler never rebuilds
job->schedobj (Requirement 1.4); (2) two otherwise-identical jobs
differing only in requested task count don't collide in the
unsatisfiable-resource-request cache on the fresh-ingest path
(Requirement 5.4).

Adds a new file, test_maxtasks_wiring_sim_driver_parity.c, proving the
simulation driver's real static translator chain
(sim_process_replay_event_message()/replay_event_to_core_event())
applies this feature's wiring identically to the real driver -- a
genuine white-box test of the real sim_loop.c code (following
test_sim_event_loop.c's established #include technique), not a mirror
of its logic. This was split into its own file because
test_maxtasks_wiring_ingest.c already links the full scheduler_srcs
object list for its own task-3.1 test, which collides at link time
with white-box #include-ing core_events.c/sim_loop.c in one
translation unit; see tasks.md's Implementation Notes.

No production code changed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XYdtrEWWZfKRRGED7raEYg
This commit is contained in:
Rongsong Shen 2026-09-06 07:24:04 +00:00
parent 4644d20cf0
commit c36014c072
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
4 changed files with 865 additions and 2 deletions

View file

@ -1961,3 +1961,32 @@ sched_maxtasks_wiring_ingest_test = executable(
test('scheduler maxtasks wiring ingest test',
sched_maxtasks_wiring_ingest_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
# resreq-maxtasks-wiring spec, task 3.2 remediation round (Req 1.4, 5.4, and
# design.md's "Project Invariant Cross-Check" driver/simulation parity
# commitment): proves the REAL, `static` simulation-driver translator chain
# (sim_process_replay_event_message() -> replay_event_to_core_event(),
# sim_loop.c) -- not a hand-built mirror of it -- applies this feature's
# task-count wiring correctly, by feeding a hand-built, in-memory
# ReplayEvent{jobsPush} capnp message through the REAL function and pushing
# its own real output through the identical xce_core_push_events()/
# core_build_job() ingest chain. Same white-box #include pattern as
# sched_sim_event_loop_test (core.c, core_clock.c, core_events.c,
# core_session.c, decision.c, plugin.c, plugins/builtin_fcfs.c, recording.c,
# recording_session.c, repl.c and siblings, sim.c, sim_loop.c, sim_picker.c,
# sim_record.c, sim_verify.c, snapshot.c/snapshot_wire.c/snapshot_load.c) --
# see this test file's own header comment for why it is a separate file
# from sched_maxtasks_wiring_ingest_test (that file links the whole real
# scheduler_srcs object list for its own test 3, which would collide with
# this file's white-box #include of core_events.c/sim_loop.c into the same
# translation unit).
sched_maxtasks_wiring_sim_driver_parity_test = executable(
'sched_maxtasks_wiring_sim_driver_parity_test',
['test_maxtasks_wiring_sim_driver_parity.c'],
include_directories:[incdir],
dependencies: [scheduler_test_deps],
install: false)
test('scheduler maxtasks wiring sim driver parity test',
sched_maxtasks_wiring_sim_driver_parity_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])