feat(dart): add bfloat16 and bfloat16_array support#3564
Open
miantalha45 wants to merge 1 commit intoapache:mainfrom
Open
feat(dart): add bfloat16 and bfloat16_array support#3564miantalha45 wants to merge 1 commit intoapache:mainfrom
miantalha45 wants to merge 1 commit intoapache:mainfrom
Conversation
Collaborator
|
where is ai review comments? |
Contributor
Author
|
Adding AI Review comments |
Contributor
Author
Added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BFloat16type class with IEEE 754 bfloat16 conversions (round-to-nearest, ties-to-even).bfloat16(type ID 18) andbfloat16_array(type ID 54) to the Dart type system, serializers, buffer, codegen, and type resolverChanges
lib/src/types/bfloat16.dartBFloat16class withfromBits,fromFloat32,toBits,toDoublelib/src/buffer.dartwriteBfloat16()/readBfloat16()lib/src/resolver/type_resolver.dartTypeIds.bfloat16=18,TypeIds.bfloat16Array=54, all resolution pathslib/src/serializer/primitive_serializers.dartbfloat16Serializerconstant, write/read caseslib/src/codegen/fory_generator.dartlib/src/codegen/generated_support.dartwriteBfloat16()/readBfloat16()lib/src/context/write_context.dartwriteBfloat16()methodlib/src/context/read_context.dartreadBfloat16()methodlib/src/meta/type_meta.dartlib/fory.dartbfloat16.darttest/bfloat16_test.dartTest plan
dart test test/bfloat16_test.dart)dart test)dart analyzeclean (only pre-existing issues)AI Assistance Checklist
AI Usage Disclosure
AI Review Comments
Claude Code:
Skill Review
The implementation is correct and complete. Type IDs match the spec (18/54), conversion logic matches the JS reference exactly, all codegen/resolver/serializer/context/cursor paths are covered, and all 31 tests pass (22 new + 9 existing).General Review
The investigation found 3 critical missing changes and 1 design gap: generated_support.dart - Missing writeBfloat16() / readBfloat16() on cursors (codegen will fail) write_context.dart - Missing writeBfloat16() read_context.dart - Missing readBfloat16() These are now all fixed.Fixes #3287