miantalha45 opened a new pull request, #3564:
URL: https://github.com/apache/fory/pull/3564

   ## Summary
   
   - Add `BFloat16` type class with IEEE 754 bfloat16 conversions 
(round-to-nearest, ties-to-even), matching the JavaScript implementation from 
#3328
   - Add `bfloat16` (type ID 18) and `bfloat16_array` (type ID 54) to the Dart 
type system, serializers, buffer, codegen, and type resolver
   - Add 22 tests covering scalar conversions (±0, ±Inf, NaN, subnormals, 
min/max normal), rounding, equality, buffer round-trips, and packed array 
serialization
   
   ## Changes
   
   | File | Change |
   |------|--------|
   | `lib/src/types/bfloat16.dart` | New `BFloat16` class with `fromBits`, 
`fromFloat32`, `toBits`, `toDouble` |
   | `lib/src/buffer.dart` | `writeBfloat16()` / `readBfloat16()` |
   | `lib/src/resolver/type_resolver.dart` | `TypeIds.bfloat16=18`, 
`TypeIds.bfloat16Array=54`, all resolution paths |
   | `lib/src/serializer/primitive_serializers.dart` | `bfloat16Serializer` 
constant, write/read cases |
   | `lib/src/codegen/fory_generator.dart` | All codegen paths for 
bfloat16/bfloat16_array |
   | `lib/src/codegen/generated_support.dart` | Cursor `writeBfloat16()` / 
`readBfloat16()` |
   | `lib/src/context/write_context.dart` | `writeBfloat16()` method |
   | `lib/src/context/read_context.dart` | `readBfloat16()` method |
   | `lib/src/meta/type_meta.dart` | Wire type checks for 
bfloat16/bfloat16Array |
   | `lib/fory.dart` | Public export of `bfloat16.dart` |
   | `test/bfloat16_test.dart` | 22 tests |
   
   ## Test plan
   
   - [x] All 22 new bfloat16 tests pass (`dart test test/bfloat16_test.dart`)
   - [x] All existing tests still pass (`dart test`)
   - [x] `dart analyze` clean (only pre-existing issues)
   
   ### AI Assistance Checklist
   - [x] Substantial AI assistance was used in this PR (yes)
   - [x] I included the standardized AI Usage Disclosure block below
   - [x] I can explain and defend all important changes without AI help
   - [x] I reviewed AI-assisted code changes line by line before submission
   - [x] I ran adequate human verification and recorded evidence (local/CI 
checks, pass/fail summary, and review confirmation)
   - [x] I added/updated tests and specs where required
   - [x] I validated protocol/performance impacts with evidence when applicable
   - [x] I verified licensing and provenance compliance
   
   AI Usage Disclosure
   - substantial_ai_assistance: yes
   - scope: <design drafting | code drafting>
   
   Fixes #3287 
   


-- 
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