feat(scheduler-allocation): add resreq fingerprinting for the cache

Adds rusage_hash to xce_primary_resreq_t (computed once by
parse_resreq_primary() via a new hash_rusages() helper, hashing
rusage content rather than raw struct bytes since resname is a
non-interned strdup'd pointer), the xce_resreq_fingerprint_t value
type, and resreq_fp on xce_primary_schedobj_t, populated once at real
job-ingest time in core_build_primary_schedobj().

Task 1.2 (scheduler-allocation spec). Requirement 7.1.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XYdtrEWWZfKRRGED7raEYg
This commit is contained in:
Rongsong Shen 2026-09-04 15:00:12 +00:00
parent d5d2c1caf5
commit 5a6706761d
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
9 changed files with 550 additions and 4 deletions

View file

@ -240,6 +240,12 @@ typedef struct {
int maxTasks;
xce_select_t* select;
xlist_t rusages;
/* Req 7.1 (scheduler-allocation spec): stable resource-usage
* fingerprint over `rusages`, set once by parse_resreq_primary() and
* stable for the life of this resreq -- every later cache lookup for
* the job this resreq belongs to reuses this value instead of
* recomputing it. See resreq.c's hash_rusages(). */
uint64_t rusage_hash;
xce_span_t* span;
xce_same_t* same;
xce_affinity_t* affinity;