Module handshake

Module handshake 

Source
Expand description

2026-09-26: The client side of the rail handshake as byte functions over Read/Write that take QP identities as (qpn, psn, gid) tuples, so they need no Verbs. railset::RailSet calls them; tests/transcript_golden.rs drives them against a scripted peer.

Wire order (the params’ integers are little-endian, see wire):

  • client: [u8 n_rails] (write_n_rails);
  • server, RO dialect: [u8 n], then n VerbsServerParams (wire::read_server_rails); RW dialect: [u8 n], then n CacheServerParams (read_rw_server_params);
  • client: [u8 n_rails] a second time, then n VerbsClientParams (write_client_params);
  • server: [u8 ack], which must be STATUS_OK (read_ack).

Owner: metrale-gpu-sys. Invariants: none beyond the types.

Functions§

read_ack
2026-09-26: Read the peer’s one-byte ack, which must be STATUS_OK.
read_rw_server_params
2026-09-26: RW dialect (the KV and snapshot tiers): read the peer’s [u8 n], which must equal want, then want CacheServerParams. Unlike wire::read_server_rails, the count is not limited to 1..=8.
write_client_params
2026-09-26: Write the rail count again, then each rail’s VerbsClientParams.
write_n_rails
2026-09-26: Write the rail count as one byte.