ansys / ansys/api-eigen-example

vector serialization does not take into account endianness

未关闭
#53 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
C++ gRPC Python
主要语言
Python
星标
8
派生
0
平均合并
11 小时 54 分钟
30 天内合并 PR
10

描述

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.

贡献指南

打开贡献指南

调研方向

从引用的 grpcdemo.proto 定义以及 src/ansys/eigen/cpp/grpc/client/src/GRPCClient.cpp 和 src/ansys/eigen/python/grpc/client.py 中的序列化位置开始。将当前基于 bytes 的表示与 gRPC 数组进行比较,并确定必须保留的跨字节序行为。当具有不同本机字节序的客户端和服务器能够交换向量数据而不会发生静默损坏时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp, grpc, python
领域
api, backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。