chaokunyang commented on code in PR #3564:
URL: https://github.com/apache/fory/pull/3564#discussion_r3112057584


##########
dart/packages/fory/lib/src/resolver/type_resolver.dart:
##########
@@ -1041,6 +1049,8 @@ final class TypeResolver {
         return _builtin(Uint64List, TypeIds.uint64Array);
       case TypeIds.float16Array:
         return _builtin(Uint16List, TypeIds.float16Array);
+      case TypeIds.bfloat16Array:

Review Comment:
   Adding the new wire type here is only half of the read path. 
`_builtin(typeId)` immediately calls `_builtinSerializerFor(typeId)`, but that 
switch still has no `TypeIds.bfloat16Array` branch, so 
`resolveBuiltinWireType(TypeIds.bfloat16Array)` still throws `Unsupported 
builtin type id 54` before deserialization can start. Please wire 54 through 
the serializer path as well.



##########
dart/packages/fory/lib/src/resolver/type_resolver.dart:
##########
@@ -329,6 +330,9 @@ final class TypeResolver {
     if (value is Float16) {
       return _builtin(Float16, TypeIds.float16);
     }
+    if (value is BFloat16) {
+      return _builtin(BFloat16, TypeIds.bfloat16);
+    }

Review Comment:
   This still doesn't make `bfloat16_array` writable. Root and dynamic 
resolution continue to classify every `Uint16List` as `uint16_array` a few 
lines below, so normal serialization still emits type id 49. Without a distinct 
Dart surface for bfloat16 arrays, there is still no path that produces wire 
type 54.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to