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

@ -170,6 +170,10 @@ static inline void xce_repl_check_replay_complete(xce_sched_sim_driver_t* sim)
* echo gate and before the breakpoint check; takes d->trace.
* - xce_repl_check_trace_only: an XCE_DECISION_TRACE decision (a traced
* selection with no decision), handled before anything else.
* - xce_repl_trace_reconstructed: a dispatch the simulator rebuilt from
* a recorded allocation (task 5.3, 2.5); attaches a reconstructed
* record to `d` when the session's settings want the job, right after
* the decision is built, so it is then handled like a live one.
*/
extern void repl_trace_session_begin(xce_sched_sim_driver_t* sim);
extern void repl_trace_session_end(xce_sched_sim_driver_t* sim);
@ -177,6 +181,9 @@ extern void repl_trace_on_decision(xce_sched_sim_driver_t* sim,
xce_decision_t* d);
extern void repl_trace_on_trace_only(xce_sched_sim_driver_t* sim,
xce_decision_t* d);
extern void repl_trace_on_reconstructed(xce_sched_sim_driver_t* sim,
xce_decision_t* d,
const xce_sched_job_t* job);
static inline void xce_repl_trace_session_begin(xce_sched_sim_driver_t* sim)
{
@ -200,6 +207,15 @@ static inline void xce_repl_check_trace(xce_sched_sim_driver_t* sim,
}
}
static inline void xce_repl_trace_reconstructed(xce_sched_sim_driver_t* sim,
xce_decision_t* d,
const xce_sched_job_t* job)
{
if (sim->interactive) {
repl_trace_on_reconstructed(sim, d, job);
}
}
static inline void xce_repl_check_trace_only(xce_sched_sim_driver_t* sim,
xce_decision_t* d)
{