test_job_rusage_reconciles_mem_reservation_against_usage asserted w->resInUse was already charged 4.0 for a JOBS_PUSH-dispatched RUN job, immediately after the push with no round boundary simulated. That assumption was wrong, not the scheduler: resInUse/sharedInUse is never charged incrementally at JOBS_PUSH/dispatch time. It's fully re-derived once per round by sched_account_jobs() (scheduler.c), which iterates every currently-RUN job and calls sched_charge_account() on each one's accounts -- called by both the real normal-mode driver (driver.c) and the sim driver (sim_loop.c), always before anything else in that round reads resInUse. Confirmed by reading the full JOBS_PUSH handler (core_events.c) and builtin_fcfs_on_job_push(): neither ever charges or uncharges resInUse, by design -- core_session.c's own doc comment on core_begin_session_internal() already documents this "recompute from source of truth each round" architecture. Fix: the test now calls sched_charge_account(&core, tracked->accounts) right after JOBS_PUSH, simulating the one round-boundary reconciliation step sched_account_jobs() would perform for its single RUN job (that function itself lives in scheduler.c, not white-box #included here, so its single-job effect is reproduced directly via the same primitive it calls internally). No production code changed. Full scheduler suite: 77/77 Ok (was 76/77). Full xce-build.sh all asan --incremental: 94/94 Ok, zero regressions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GLfB5uWRdmx2WiZSFC7Fm7 |
||
|---|---|---|
| .. | ||
| autoscaler | ||
| configs | ||
| controller | ||
| docs | ||
| frontend | ||
| include | ||
| lib | ||
| nixSupport | ||
| scheduler | ||
| schema | ||
| tools | ||
| worker | ||
| xceadmin | ||
| flake.lock | ||
| flake.nix | ||
| meson.build | ||
| meson.options | ||