feat(scheduler-core): implement simulation-mode startup (task 11.1)

Add sim.h/sim.c implementing AC 13 steps 1-4: open+validate ReplayHeader,
locate the most recent SnapshotEntry at/before --sim-start-ts, load it via
xce_sched_core_load_snapshot(), and set the virtual clock anchors. Wire
all seven simulation CLI flags into main.c's task-5.2 mode-selection
branch. Event loop itself (step 5) deferred to task 11.2. Fixes two real
bugs found during TDD: a SnapshotEntry_get_ts() use-after-free and a
pend_updates NULL-deref in xce_sched_core_fini() for bare-core callers.
27/27 scheduler suite green, full project build clean.
This commit is contained in:
Rongsong Shen 2026-08-06 09:22:04 +00:00
parent 16d756aca3
commit 5d587ecf32
Signed by: rshen
SSH key fingerprint: SHA256:8Vf2pZ3h6rJa7EhGK+WaAQ9Mta/apZvteW6g9U/WKKk
7 changed files with 1366 additions and 21 deletions

View file

@ -14,6 +14,7 @@ scheduler_srcs = [
'src/recording.c',
'src/recording_events.c',
'src/recording_session.c',
'src/sim.c',
'src/schedobj.c',
'src/plugin.c',
'src/resource.c',