fix(scheduler): load shared resource values from the snapshot (bug-1923)
xce_scheduler --sim started with no shared resource pool when the shared values came only from the recording's SnapshotEntry (license value=(none)), so jobs needing a shared resource pended instead of dispatching. Two defects caused it: - Load side (snapshot_load.c): a resval was treated as shared only when rv->host == NULL. The capnp round trip (write_snapshot_entry -> decode_SnapshotEntry) reads a NULL host back as "", so every shared resval in a .replay file was skipped. A NULL or empty host now means the shared pool; only a named host marks per-worker data. - Save side (snapshot.c, snapshot_wire.c): core->sharedInst and each worker's resvals were walked with i < .count. zarray_t.count is the number of filled slots, not the highest idx + 1, and both arrays are sparse by resource idx, so higher-index values were dropped from the snapshot. Both loops are now bounded by .caps, as repl_info.c already is. New test test_snapshot_sparse_resvals.c covers the in-memory save/load, the empty-host load, and the real sched_record_start() -> .replay -> sched_sim_driver_start() round trip. Regenerated fixtures/repl_trace_baseline/set_output.replay: its mid-run snapshot now carries license, limit=cluster_slots and each worker's limit=host_slots, which the old writer dropped (all other fixtures unchanged). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4f951f2b52
commit
16616d9688
7 changed files with 453 additions and 5 deletions
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue