feat(scheduler-sim-decision-trace): wire tracing into the simulation driver

Task 5.3: session hooks around each sim session; trace-only decisions
are handled first and skip verification, recording, echo and
breakpoints; traced decisions are emitted after the echo gate and before
the breakpoint check; reconstructed dispatches get reconstructed
records; unclaimed traces are freed at both decision free sites.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-08 15:35:20 +00:00
parent 6bac16812c
commit a1cb9cba4b
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
6 changed files with 743 additions and 7 deletions

View file

@ -2868,3 +2868,33 @@ sched_repl_trace_wiring_test = executable(
test('scheduler repl trace wiring test',
sched_repl_trace_wiring_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
# scheduler-sim-decision-trace task 5.3 (Requirements 1.6, 2.5, 7.1-7.3,
# 7.5, 10.1, 11.3): the trace wired into the simulation driver's session and
# decision flow, driven through the real picker and allocator threads (the
# real-scheduler_srcs link technique of sched_sim_live_allocation_test). The
# wraps watch verification, recording and the breakpoint check for
# trace-only decisions, the session hook in a non-interactive run, and make
# an allocation fail on demand.
sched_sim_trace_driver_test_srcs = ['test_sim_trace_driver.c']
foreach f : scheduler_srcs
if f != 'src/main.c'
sched_sim_trace_driver_test_srcs += ['../' + f]
endif
endforeach
sched_sim_trace_driver_test = executable(
'sched_sim_trace_driver_test',
sched_sim_trace_driver_test_srcs,
include_directories:[incdir],
dependencies: [scheduler_test_deps],
link_args: ['-Wl,--wrap=sim_decision_eq',
'-Wl,--wrap=sched_record_session_add_decision',
'-Wl,--wrap=xce_repl_on_decision',
'-Wl,--wrap=repl_trace_session_begin',
'-Wl,--wrap=sched_make_allocation'],
install: false)
test('scheduler sim trace driver test',
sched_sim_trace_driver_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])