Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-3095

Use canonical Extended JSON for BSON binary vector spec tests

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: BSON
    • None
    • Needed
    • Hide

      Summary of necessary driver changes

      • Update float32 spec test.
      • Remove special-case parsing for "inf" and "-inf" in bson_binary_vector tests
      • Verify your driver's float32 test implementation correctly checks equality even for non-finite values. (Ideally handling both Inf and NaN, even though current tests only rely on +/- infinity.)

      Commits for syncing spec/prose tests
      (and/or refer to an existing language POC if needed)

      Context for other referenced/linked tickets

      •  
      Show
      Summary of necessary driver changes Update float32 spec test. Remove special-case parsing for "inf" and "-inf" in bson_binary_vector tests Verify your driver's float32 test implementation correctly checks equality even for non-finite values. (Ideally handling both Inf and NaN, even though current tests only rely on +/- infinity.) Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed) https://github.com/mongodb/specifications/commit/ccd72de68cc29b68fe55a79ad44d20b20ad1b4e7 CDRIVER implementation: https://github.com/mongodb/mongo-c-driver/commit/c186295845d80a6047fd7ba6b7fde56567080ab9 Context for other referenced/linked tickets  
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-5880 Fixed 2.0.0
      CXX-3213 Won't Do
      CSHARP-5482 Needs Triage
      GODRIVER-3478 Backlog
      JAVA-5779 Needs Triage
      NODE-6711 Needs Triage
      MOTOR-1428 Needs Triage
      PYTHON-5121 Needs Triage
      PHPC-2534 Backlog
      RUBY-3617 Needs Triage
      RUST-2147 Backlog
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } #scriptField td.willNotDo { background-color: #FF0000; /* Red color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-5880 Fixed 2.0.0 CXX-3213 Won't Do CSHARP-5482 Needs Triage GODRIVER-3478 Backlog JAVA-5779 Needs Triage NODE-6711 Needs Triage MOTOR-1428 Needs Triage PYTHON-5121 Needs Triage PHPC-2534 Backlog RUBY-3617 Needs Triage RUST-2147 Backlog

      Summary

      The binary vector spec tests are JSON-format spec tests with a unique format. They encode, amongst other data, the numeric vector data for the test cases, including positive and negative infinity for some "float32" test cases. However, the JSON spec does not officially support encoding positive and negative infinity, and many JSON implementations can't decode those values directly as numbers (the quoted strings "inf" and "-inf" in this case), requiring additional conversion logic. The Extended JSON format does support those special floating point values. To avoid requiring some drivers teams to write additional number conversion logic, we should use canonical Extended JSON as the format for the binary vector spec tests.

      Motivation

      Who is the affected end user?

      Drivers devs who are implementing binary vector support and spec test runners.

      How does this affect the end user?

      They have to implement custom JSON unmarshaling logic.

      How likely is it that this problem or use case will occur?

      Depends on the language, but any language that doesn't support the non-standard strings "inf", "-inf" for pos/neg infinity will have to write custom decode logic.

      If the problem does occur, what are the consequences and how severe are they?

      Wasted time, possible bugs in the spec test runner.

      Is this issue urgent?

      No.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      Yes.

      Acceptance Criteria

      • Update the binary vector spec test runner docs to require that drivers decode the spec tests as canonical Extended JSON.
      • Update the binary vector spec tests to use canonical Extended JSON format.

            Assignee:
            micah.scott@mongodb.com Micah Scott
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Kevin Albertson Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: