feat(scheduler-sim-discrete-clock): --sim-speed deprecation-warning helper and discrete-clock test binary (task 1.1)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-09-29 04:23:46 +00:00
parent 4b6872d053
commit 4f653d8fbe
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
6 changed files with 232 additions and 2 deletions

View file

@ -2,8 +2,8 @@
Test-first throughout (red → green → refactor). Every sub-task leaves the build and the scheduler suite green. The simulator's speed field and its shadow copy stay in place, unused, until the last core task removes them together with every test that sets them (design.md, File Structure Plan: build-order constraint).
- [ ] 1. Foundation: deprecation-warning helper and the new test binary
- [ ] 1.1 Add the `--sim-speed` deprecation-warning helper and register the new discrete-clock test binary
- [x] 1. Foundation: deprecation-warning helper and the new test binary
- [x] 1.1 Add the `--sim-speed` deprecation-warning helper and register the new discrete-clock test binary
- Write the tests first, with a test-local stdout-capture helper and without initialising the logger (so warnings reach stdout): the values `0`, `abc`, `-1` and the empty string each produce exactly one line naming the value in quotes and containing `--sim-speed`, "deprecated", "no effect" and "will be removed"; no value produces no output.
- Add the helper as its own small source (design.md, Components: CliCompat) and add it to the scheduler's source list only, not to the simulator-isolation library.
- Register the new test binary in the scheduler suite with the same leak-detection setting as the other scheduler tests, a compile-time path to the built scheduler binary, and a build dependency on that binary. Its build sources are the new test file and the helper only, with the usual scheduler test dependencies; the white-box simulator `#include`s and the stand-in picker/allocator go into the test file itself in 2.1, as the other simulator tests do, not into the build file (listing the simulator sources there as well would define every symbol twice).
@ -65,3 +65,6 @@ Test-first throughout (red → green → refactor). Every sub-task leaves the bu
- Run the HA soak skill, whose replay-verification step still passes `--sim-speed=0`, without modifying it.
- Done when that step passes with zero mismatches and its log contains exactly one deprecation warning.
- _Requirements: 5.3_
## Implementation Notes
- Build dir: `bash src/tools/xce-build.sh scheduler asan xce.build.discrete` builds into `src/xce.build.discrete`; iterate with `meson test -C src/xce.build.discrete --suite scheduler` and grep its testlog for `:FAIL`.