ansys / ansys/api-eigen-example
vector serialization does not take into account endianness
- Dominant language
- Python
- Stars
- 8
- Forks
- 0
- Avg merge
- 11h 54m
- Merged PRs (30d)
- 10
Description
The [gRPC protocol is defined](https://github.com/ansys/api-eigen-example/blob/108085fcaa860a9d1e27abbdc561c160a98e09e3/src/ansys/eigen/protos/grpcdemo.proto#L21) as sending over the bytes of arrays directly, but does not take into account endianness. This means the protocol will fail spectacularly (type 3 error, bad data with no error) if the client and server machines have different native endianness.
https://github.com/ansys/api-eigen-example/blob/108085fcaa860a9d1e27abbdc561c160a98e09e3/src/ansys/eigen/cpp/grpc/client/src/GRPCClient.cpp#L499
https://github.com/ansys/api-eigen-example/blob/108085fcaa860a9d1e27abbdc561c160a98e09e3/src/ansys/eigen/python/grpc/client.py#L280
Unless there is another reason, I recommend using gRPC arrays instead of bytes. gRPC can handle this for us.
Contributor guide
Research direction
Start with the referenced grpcdemo.proto definition and the serialization points in src/ansys/eigen/cpp/grpc/client/src/GRPCClient.cpp and src/ansys/eigen/python/grpc/client.py. Compare the current bytes-based representation with gRPC arrays and determine the cross-endianness behavior that must be preserved. Done means clients and servers with different native endianness exchange vector data without silent corruption.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, grpc, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100