feat(libxce-alloc-preason-equality): record session begin from the session-start clock reading (task 3.1)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-09-28 09:59:56 +00:00
parent 62d0b8b686
commit 2d7ba66019
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
3 changed files with 85 additions and 6 deletions

View file

@ -29,7 +29,7 @@ Test-first throughout (red → green → refactor). Every sub-task leaves the bu
- _Depends: 2.1_
- [ ] 3. Core: reproducible reservation start time in the scheduler
- [ ] 3.1 (P) Record each session's start from the same clock reading as the session start
- [x] 3.1 (P) Record each session's start from the same clock reading as the session start
- Write the test first, in its own test function (not shared with 3.2): with recording enabled, a recorded session's begin time equals the session's start time exactly.
- Take the recorded begin time from the session start instead of a second clock reading (design.md, Components: Recording).
- Done when the test passes and the existing recording tests still pass.
@ -88,3 +88,4 @@ Test-first throughout (red → green → refactor). Every sub-task leaves the bu
## Implementation Notes
- `xce-build.sh` resolves a relative build dir under `src/`: `bash src/tools/xce-build.sh lib asan xce.build.alloceq` builds into `src/xce.build.alloceq`, so iterate with `meson test -C src/xce.build.alloceq`.
- `xce-build.sh lib` runs only the `libxce test` binary; run `meson test -C src/xce.build.alloceq "libxce alloc OOM test"` (or plain `meson test`) for the allocation OOM binary, which also wraps `vasprintf`/`__vasprintf_chk` since 2.1.
- Simulation mode (`sim_loop.c`) still takes its own session-begin clock reading before `xce_core_begin_session()`; by design that is left to spec scheduler-sim-discrete-clock (3.1 fixed only the normal-mode recorder).