--- id: "bug-1573" status: "fixed" status_updated: "2026-09-24" status_note: "" component: "scheduler" severity: "unknown" timestamp: "2026-08-18T01:20:00Z" last_seen: "2026-09-19T09:00:00Z" occurrences: 1 files: ["src/scheduler/src/core_events.c"] tags: ["scheduler", "core_events.c", "Value_u_which", "union-type-confusion", "resupdate", "resource-value-verification", "task-4.1", "round-2-remediation"] related: ["bug-1572"] legacy: true --- # bug-1573: resource-value-verification task 4.1 round-1 REJECTED by independent review: the RESVALS_DELTA… ## Description resource-value-verification task 4.1 round-1 REJECTED by independent review: the RESVALS_DELTA TRACE logging in xce_core_push_events() assumed any non-string Value_u_which tag was Value_u_fvalue and read rv->val->u.fvalue unconditionally in the else branch -- Value_u_bvalue (and ivalue32/uvalue32/ivalue64/uvalue64) are real, reachable tags at this exact path (worker.c's mark_host_res() sets Value_u_bvalue for any XCE_VAL_BOOLEAN resource, routed through the same update_val_res()/resupdate RPC) that would read the wrong C union member. ## Environment _Not recorded (migrated from buglog.json)._ ## Reproduction _Not recorded (migrated from buglog.json)._ ## Root cause Value_u_which (src/lib/controller.capnp.h:835-843) has 7 tags: ivalue32/uvalue32/ivalue64/uvalue64/svalue/fvalue/bvalue. Round-1's TRACE logic in the XCE_CORE_EVENT_RESVALS_DELTA case only distinguished svalue (explicit check) vs everything else (assumed fvalue, read .u.fvalue unconditionally in the else branch) -- a false dichotomy. Two directly-relevant precedents in this codebase already handle this correctly: update_val_res() (worker.c:107-117) explicitly checks `== Value_u_fvalue` with a generic 'non-numeric' fallback for anything else, and the sibling function core_apply_worker_resvals() 360 lines above in the SAME FILE (core_events.c:439-443) explicitly checks `== Value_u_fvalue` with no else at all (silent skip). Round-1 did not follow either precedent. ## Fix Rewrote the RESVALS_DELTA TRACE block (core_events.c, XCE_CORE_EVENT_RESVALS_DELTA case, right after zarray_put) to explicit if/else-if: Value_u_svalue -> TRACE with value=%s; Value_u_fvalue -> TRACE with value=%f (reading .u.fvalue only once .which is confirmed); anything else (ivalue32/uvalue32/ivalue64/uvalue64/bvalue) -> silently skipped, mirroring core_apply_worker_resvals()'s established convention for the same ambiguity in this file (reviewer-approved Option B -- this feature's resource set is entirely fvalue/svalue today per resval_typeresolve.c). Verified: full scheduler build green (xce-build.sh scheduler), all 41 scheduler tests pass except the pre-existing unrelated bug-1560 (sched_admin_request_test's symlink-escape case); live smoke test via xce-deploy-ha + xce_test worker-context join/resupdate -n r15m -v 12345.5 confirmed unchanged output `resval applied host=task41r2-worker resource=r15m value=12345.500000` in scheduler.log, format-identical to round-1's (expected -- the fix only changes behavior for non-fvalue/non-svalue tags, which this smoke test doesn't exercise). ## Verification _Not recorded (migrated from buglog.json)._ ## References - Related: bug-1572