1# @ajax/mesh-abi-host-members
23Member records (M_*): each cluster member as this meshd sees it.
45Part of the mesh contract: the memory, control, snapshot and peer protocols shared by meshd, its GPU
6programs (CUDA kernels, wasm lanes, native workers) and the tools. Every side compiles the same
7definitions, so an offset can never disagree.
89```c
10#include "mesh/abi/host_members.h"
11```
1213## Ported from
1415[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-abi/src/v2.rs: S_MEMBERS, MEMBER_BYTES, M_STATE, M_CC, M_SMS, M_SMS_TOTAL, M_BLOCKS_PER_SM, M_RTT_US, … (21 in all).
1617Names: Rust's `NAME` is `MESH_NAME`; a constant of a Rust module `m` is `MESH_M_NAME` (unless it already starts with `M_`); a function `f` is `mesh_f` (`mesh_m_f`). Offsets that are `usize` in the Rust are plain integer constants or `size_t` results, `u32` constants carry a `u` suffix, `u64` use `UINT64_C`.
1819## Device code
2021The header is freestanding (`<stdint.h>`, `<stddef.h>`, `<stdbool.h>` only): it compiles for the host, `nvptx64-nvidia-cuda` and `wasm32`. Functions the Rust marks `const fn` are `static inline` here. Its tables (string names, field lists) live in `src/`, so device code that uses them links the package for that target.
2223## Tests
2425- `tests/constants.c`: every constant against the value the Rust prints (51 checks)
26- `tests/golden.c`: its functions against 5 vectors computed by the Rust on the same inputs
2728## Licence
2930MIT. See the repository's LICENSE.