test(scheduler-sim-decision-trace): bounds under large traces; update the scheduler guide

Task 6.4: a 1000-host, 64-task parallel job traced at full level stores
exactly the line bound with exact omitted counts and counters; 10,000
traced decisions keep the trace store within 64 MiB without evicting the
newest. The scheduler guide lists the REPL trace files and test rules
and carries measured file sizes. Full all-components ASAN build passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-08 17:11:52 +00:00
parent 2e733994c1
commit 1b78fa9638
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
4 changed files with 518 additions and 3 deletions

View file

@ -25,6 +25,14 @@ C-based job scheduling engine with a plugin architecture. Determines job-to-node
None of them may use stdio, file I/O or logging, and none belongs in `sched_core_isolation_lib`; `test_core_isolation.c` scans all five. Every white-box test that `#include`s a hooked source (resource, host_iter, alloc_runner, scheduler, sched_election, driver) must also `#include` the four trace `.c` files, exactly once.
The REPL side (sim thread, stdio allowed, declared in `repl_internal.h`; `repl.h` holds the interactive-only gates `sim_loop.c` calls):
- `repl_trace.c`: the `trace` command grammar, `trace status`, and the refcounted `next`/`cur` session settings with their trace file.
- `repl_trace_emit.c`: session begin/end hooks and per-decision emission to the console and trace file, then into the store.
- `repl_trace_store.c`: latest record per job, oldest-first eviction at 64 MiB (never the newest), discarded marks, `info trace`.
- `repl_trace_render.c`, `repl_trace_render_outcome.c`, `repl_trace_render.h` (private): the one renderer; every output path reuses it.
Every test that `#include`s `repl.c` or `sim_loop.c` (rather than linking them from `scheduler_srcs`) must also `#include` the five REPL trace `.c` files and the four core trace `.c` files, exactly once; `sched_sim_isolation_lib` carries all nine, and `test_sim_isolation.c` scans the REPL trace files and `repl_trace_render.h`. A new REPL trace file goes into all three. Bounds under large traces are covered by `test_trace_bounds.c`.
Links against `libxce` from `src/lib/`. Full design/requirements: `.kiro/specs/scheduler-core/`.
## Conventions
@ -32,7 +40,7 @@ Links against `libxce` from `src/lib/`. Full design/requirements: `.kiro/specs/s
- Format with `clang-format`
- New scheduling policies → add as a plugin under `src/plugins/`, do not modify the core engine
- Shared types defined in `src/include/xce/` (libxce)
- Files stay under the repo's 800-line cap — several core/sim/repl/snapshot/recording modules are deliberately split across multiple `*_events.c`/`*_session.c`/`*_wire.c`-style files for this reason; keep new logic in the file matching its concern rather than growing one file past the cap. Not yet true project-wide: `scheduler.c` (1382 lines) and `plugins/builtin_fcfs.c` (1026 lines) are pre-existing exceptions over the cap with no split or exemption note — do not use them as precedent for new files, and prefer splitting them opportunistically rather than growing them further.
- Files stay under the repo's 800-line cap — several core/sim/repl/snapshot/recording modules are deliberately split across multiple `*_events.c`/`*_session.c`/`*_wire.c`-style files for this reason; keep new logic in the file matching its concern rather than growing one file past the cap. Not yet true project-wide: `scheduler.c` (2060 lines), `sim_loop.c` (1844), `repl_info.c` (1779), `core_events.c` (1488), `driver.c` (1117), `resource.c` (1106), `plugins/builtin_fcfs.c` (1104), `repl_break.c` (980) and `include/core.h` (861) (measured 2026-10-08) are pre-existing exceptions over the cap with no split or exemption note — do not use them as precedent for new files, and prefer splitting them opportunistically rather than growing them further.
## See Also
- Shared library: `src/lib/CLAUDE.md`