Subject: Extend the tensor element types to the float6 formats added by ONNX 1.23

ONNX 1.23 appends FLOAT6E2M3 and FLOAT6E3M2 to TensorProto::DataType. Two
consteval self-checks tie onnxruntime's own tables to the size of that enum
and both stop resolving as soon as it grows:

  - kTensorProtoDataTypeElementSizes is declared with the enum's ARRAYSIZE but
    initialised only through INT2, so the new slots default to zero and the
    completeness check reads them as non-numeric types.
  - IsTensorProtoToOrtElementTypeMapBijective compares that ARRAYSIZE against
    the public ONNXTensorElementDataType enum, which still ends at FLOAT8E8M0.

Append both formats to the public enum, which keeps every existing value in
place, and move the bijection's upper bound to the new last entry. 1.31.0
moved the mapping into onnxruntime_type_conversion.h, where the pass-through
default rejects anything above FLOAT8E8M0; raise that bound to the new last
entry too. No new case is needed: ONNX and onnxruntime agree on 27 and 28.

Record both as byte-granular in the element-size table, matching every packed
sub-byte type already listed. That table feeds only the big-endian
byte-swapping helper, where byte granularity is exactly what the UINT4, INT4,
FLOAT4E2M1, UINT2 and INT2 entries already express.

type_info_test.cc sizes two expectation tables from the same ARRAYSIZE and
asserts on them at compile time, so both gain the two entries.

The wider initialiser does not fit the narrower ONNX 1.22 enum, so this
requires ONNX 1.23. verified 2026-10-09

--- a/include/onnxruntime/core/session/onnxruntime_c_api.h
+++ b/include/onnxruntime/core/session/onnxruntime_c_api.h
@@ -224,6 +224,9 @@ typedef enum ONNXTensorElementDataType {
   ONNX_TENSOR_ELEMENT_DATA_TYPE_INT2,   // maps to 4 packed int2 values (size == 1 byte)
   // Float8E8M0 type introduced in ONNX 1.21. 8-bit float with 8 exponent bits, 0 mantissa bits, no sign bit.
   ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E8M0,  // Non-IEEE floating-point format, all values are powers of two
+  // Float6 types were introduced in ONNX 1.23.
+  ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT6E2M3,  // Non-IEEE 6-bit floating-point format, stored packed
+  ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT6E3M2,  // Non-IEEE 6-bit floating-point format, stored packed
 } ONNXTensorElementDataType;
 
 // Synced with onnx TypeProto oneof
--- a/include/onnxruntime/core/session/onnxruntime_type_conversion.h
+++ b/include/onnxruntime/core/session/onnxruntime_type_conversion.h
@@ -33,7 +33,7 @@ constexpr ONNXTensorElementDataType ToOrtTensorElementDataType(int tensor_proto_
       return ONNX_TENSOR_ELEMENT_DATA_TYPE_INT2;
     default:
       if (tensor_proto_element_type < 0 ||
-          tensor_proto_element_type > static_cast<int>(ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E8M0)) {
+          tensor_proto_element_type > static_cast<int>(ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT6E3M2)) {
         return ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED;
       }
       return static_cast<ONNXTensorElementDataType>(tensor_proto_element_type);
--- a/onnxruntime/core/framework/onnxruntime_map_type_info.h
+++ b/onnxruntime/core/framework/onnxruntime_map_type_info.h
@@ -32,7 +32,7 @@ constexpr ONNXTensorElementDataType ToONNXTensorElementDataType(
 
 consteval bool IsTensorProtoToOrtElementTypeMapBijective() {
   constexpr size_t ort_element_type_count =
-      static_cast<size_t>(ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E8M0) + 1;
+      static_cast<size_t>(ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT6E3M2) + 1;
   constexpr size_t onnx_element_type_count = ONNX_NAMESPACE::TensorProto_DataType_DataType_ARRAYSIZE;
   if constexpr (onnx_element_type_count != ort_element_type_count) {
     return false;
--- a/onnxruntime/core/framework/tensorprotoutils.h
+++ b/onnxruntime/core/framework/tensorprotoutils.h
@@ -58,6 +58,8 @@ inline constexpr std::array<uint8_t, ONNX_NAMESPACE::TensorProto_DataType_DataTy
         sizeof(uint8_t),   // FLOAT8E8M0
         sizeof(uint8_t),   // UINT2
         sizeof(uint8_t),   // INT2
+        sizeof(uint8_t),   // FLOAT6E2M3
+        sizeof(uint8_t),   // FLOAT6E3M2
     };
 
 consteval bool IsTensorProtoDataTypeElementSizeMapComplete() {
--- a/onnxruntime/test/framework/type_info_test.cc
+++ b/onnxruntime/test/framework/type_info_test.cc
@@ -49,6 +49,8 @@ constexpr bool TensorElementTypeConversionIsConstexpr() {
           ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E8M0,
           ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT2,
           ONNX_TENSOR_ELEMENT_DATA_TYPE_INT2,
+          ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT6E2M3,
+          ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT6E3M2,
       };
 
   for (size_t index = 0; index < expected_types.size(); ++index) {
@@ -105,6 +107,8 @@ TEST(TypeInfoTests, TensorElementTypeConversions) {
       {ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E8M0, ONNX_NAMESPACE::TensorProto_DataType_FLOAT8E8M0},
       {ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT2, ONNX_NAMESPACE::TensorProto_DataType_UINT2},
       {ONNX_TENSOR_ELEMENT_DATA_TYPE_INT2, ONNX_NAMESPACE::TensorProto_DataType_INT2},
+      {ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT6E2M3, ONNX_NAMESPACE::TensorProto_DataType_FLOAT6E2M3},
+      {ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT6E3M2, ONNX_NAMESPACE::TensorProto_DataType_FLOAT6E3M2},
   };
   static_assert(std::size(types) == ONNX_NAMESPACE::TensorProto_DataType_DataType_ARRAYSIZE);
   for (const auto& [api_type, proto_type] : types) {
