[SERVER-55029] Investigate correctness of comparison semantics in SBE Created: 08/Mar/21  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Nikita Lapkov (Inactive) Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: sbe-post-v1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-54750 [SBE] Rename cmp3w VM instruction and... Backlog
Assigned Teams:
Query Execution
Participants:

 Description   

Aggregation comparison expressions in SBE are implemented using cmp3w VM instruction. This instruction does not have a well defined semantics behind it. It does not implement MQL comparison or WO comparison. This leads to a situation where passing all comparison operators tests is not enough because we do not have any guarantee on the behaviour in some extreme cases (for instance, comparing special values like NaN, Inf and undefined).

To fix that, we should:

  • Strictly define semantics for cmp3w
  • Ensure that other comparison instructions (less, eq, etc.) have MQL semantics
  • Add an exhaustive test which ensure the behaviour of all find/aggregation comparison operators on various types (including special values)

Generated at Thu Feb 08 05:35:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.