What happened + What you expected to happen
ResourceRequest::operator== / operator!= (src/ray/common/scheduling/cluster_resource_data.h) compare only resources_, ignoring the other two fields of the class:
bool operator==(const ResourceRequest &other) const {
return this->resources_ == other.resources_;
}
ResourceRequest also holds requires_object_store_memory_ and label_selector_. Two requests with identical resource quantities but a different object-store-memory flag or a different label selector compare equal, so any dedup, change-detection, or map-key use of ResourceRequest silently conflates requests that are not interchangeable.
Expected: == / != account for all fields that distinguish a request. (operator<= / operator>= legitimately compare quantities only — that is their resource-containment semantics and should not change.)
Versions / Dependencies
master (ray-project/ray), all platforms. C++ core (src/ray/common/scheduling).
Reproduction script
No standalone script — found by code review. A unit test constructing two requests with equal quantities but a different label selector / object-store flag and asserting inequality demonstrates it; see the linked PR.
Issue Severity
Medium: latent correctness bug in equality; impact depends on which callers rely on ResourceRequest equality.
What happened + What you expected to happen
ResourceRequest::operator==/operator!=(src/ray/common/scheduling/cluster_resource_data.h) compare onlyresources_, ignoring the other two fields of the class:ResourceRequestalso holdsrequires_object_store_memory_andlabel_selector_. Two requests with identical resource quantities but a different object-store-memory flag or a different label selector compare equal, so any dedup, change-detection, or map-key use ofResourceRequestsilently conflates requests that are not interchangeable.Expected:
==/!=account for all fields that distinguish a request. (operator<=/operator>=legitimately compare quantities only — that is their resource-containment semantics and should not change.)Versions / Dependencies
master (
ray-project/ray), all platforms. C++ core (src/ray/common/scheduling).Reproduction script
No standalone script — found by code review. A unit test constructing two requests with equal quantities but a different label selector / object-store flag and asserting inequality demonstrates it; see the linked PR.
Issue Severity
Medium: latent correctness bug in equality; impact depends on which callers rely on
ResourceRequestequality.