feat(scheduler-sim-decision-trace): core trace gate and SCHED_TRACE hook macro
Task 1.8: the core gains trace_ctl/trace_rec (NULL unless the sim REPL sets them) and SCHED_TRACE evaluates its call only while a record is being built. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
29b6734649
commit
a801aff46f
6 changed files with 482 additions and 2 deletions
|
|
@ -5,7 +5,7 @@
|
|||
> - Every new trace source file is added to the scheduler's main source list by the task that creates it.
|
||||
> - "Under ASAN" means the standard debug + ASAN scheduler build.
|
||||
|
||||
- [ ] 1. Foundation: baselines, shared formatting, trace model and transport
|
||||
- [x] 1. Foundation: baselines, shared formatting, trace model and transport
|
||||
- [x] 1.1 Capture the trace-off REPL transcript baseline before any feature change
|
||||
- Build a scripted REPL session over a resource-contention replay fixture. The fixture has several jobs competing for a shared license, a cluster-wide limit and a host-scoped limit, plus a parallel job and an alternative-requirement job.
|
||||
- The session exercises step, continue with collapsed ranges, a decision breakpoint, a round-begin breakpoint, info subcommands, set units and set output.
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
- Done when a decision test shows every existing constructor leaves the attachment empty, existing op values are unchanged and the trace-only constructor works, and the existing live-driver and decision tests pass unchanged under ASAN.
|
||||
- _Requirements: 2.4, 10.1, 11.4_
|
||||
|
||||
- [ ] 1.8 Add the core trace gate and the hook macro, test first
|
||||
- [x] 1.8 Add the core trace gate and the hook macro, test first
|
||||
- The scheduling core gains a session-settings pointer and a record-under-construction pointer. Both stay empty unless the simulator REPL sets them.
|
||||
- The hook macro evaluates its call only when a record is being built.
|
||||
- Done when a gate test passes under ASAN showing that:
|
||||
|
|
@ -345,3 +345,4 @@
|
|||
- 1.5 OPEN for 3.4/4.1: a requirement the allocator declines (alloc_runner.c ~474) or whose plan generator fails to start (~427, returns 0) never reaches `sched_trace_search_end` when that call sits only at the last return, so `reqs_none_generated` misses it (Req 4.7, 9.3); calling search_end on that path as well double-reports "no plan generated". Settle it in 3.4, e.g. `sched_trace_no_plan` bumps the counter and search_end skips its statement when a no-plan entry is open. `test_search_end_nonzero_rc_has_no_statement` models a generator failure as rc -12, but the runner returns 0 there.
|
||||
- 1.6: 27 tests include a hooked source and now `#include` sched_trace.c and sched_trace_capture.c. test_snapshot_load_allocator_regression.c matches the grep only in a comment and links scheduler_srcs, which already has both. Still open for the hook tasks: `sched_sim_isolation_lib` (src/scheduler/meson.build ~165-173) compiles the hooked `sched_election.c` without the trace sources (1.8/3.1 must add them or a stub). The 19 repl/sim tests matched via repl.c/sim_loop.c belong to 5.1.
|
||||
- 1.7 OPEN for 5.3: the sim decision-free sites at sim_loop.c ~1327 (reconstructed dispatch) and ~1709 (drain loop) don't yet call `sched_trace_rec_free(d->trace)`, and the TRACE op still falls to the sim's switch defaults. 5.3 must add the early TRACE branch before verify/record/breakpoint, or sim_verify reports false mismatches and breakpoints count it as "NONE". decision.h forward-declares `struct xce_sched_trace_rec_s` rather than including sched/trace.h.
|
||||
- 1.8: `core->trace_ctl` and `core->trace_rec` are plain forward-declared pointers (core.h does not include sched/trace.h), and `xce_sched_core_fini()` clears them without freeing because core.c can't link the trace sources. test_trace_hooks_gate.c counts `sched_trace_rec_new` with a link-time wrap. Its "full allocation creates no record" check only becomes meaningful once 3.1 adds the per-job hook. The 11.3 check (non-interactive sim never publishes trace_ctl) is in 5.3.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue