==> include/mesh/abi.h <==1/* @ajax/mesh-abi: the whole mesh contract in one include, and the Rust const asserts that span
2 * its packages. Prefer the atomic packages (@ajax/mesh-abi-*) in new code: depend on what you use.
3 * Ported from alpha-rust-mesh crates/mesh-abi (`use mesh_abi::v2::*`). */
4#ifndef MESH_ABI_H
5#define MESH_ABI_H
6
7#include "mesh/abi/base.h"
8#include "mesh/abi/control_protocol.h"
9#include "mesh/abi/backend.h"
10#include "mesh/abi/header.h"
11#include "mesh/abi/program_table.h"
12#include "mesh/abi/control_block.h"
13#include "mesh/abi/ring.h"
14#include "mesh/abi/ops.h"
15#include "mesh/abi/fault.h"
16#include "mesh/abi/node.h"
17#include "mesh/abi/node_load.h"
18#include "mesh/abi/trace.h"
19#include "mesh/abi/exchange.h"
20#include "mesh/abi/ext.h"
21#include "mesh/abi/load_page.h"
22#include "mesh/abi/pipe_table.h"
23#include "mesh/abi/view_heap.h"
24#include "mesh/abi/input_queue.h"
25#include "mesh/abi/snapshot.h"
26#include "mesh/abi/host_status.h"
27#include "mesh/abi/host_members.h"
28#include "mesh/abi/host_net.h"
29#include "mesh/abi/host_links.h"
30#include "mesh/abi/host_nics.h"
31#include "mesh/abi/host_load.h"
32#include "mesh/abi/host_mload.h"
33#include "mesh/abi/host_fleet.h"
34#include "mesh/abi/host_sched.h"
35#include "mesh/abi/host_jobs.h"
36#include "mesh/abi/host_pload.h"
37#include "mesh/abi/host_fields.h"
38#include "mesh/abi/native.h"
39#include "mesh/abi/placement.h"
40#include "mesh/abi/peer_frames.h"
41#include "mesh/abi/peer_sizes.h"
42#include "mesh/abi/reconcile.h"
43#include "mesh/abi/group_state.h"
44#include "mesh/abi/place_ops.h"
45#include "mesh/abi/pipe_ring.h"
46#include "mesh/abi/pipe.h"
47#include "mesh/abi/view_train.h"
48#include "mesh/abi/view_infer.h"
49#include "mesh/abi/view_doom.h"
50#include "mesh/abi/view_http.h"
51#include "mesh/abi/view_pipedemo.h"
52#include "mesh/abi/view_gpt2x.h"
53#include "mesh/abi/wasm.h"
54#include "mesh/abi/fnv.h"
55#include "mesh/abi/name.h"
56#include "mesh/abi/fields.h"
57#include "mesh/abi/words.h"
58#include "mesh/abi/pipe_hash.h"
59
60/* The Rust const asserts (v2.rs, views.rs) that involve more than one package. */
61_Static_assert(MESH_PX_PLACE_ASSIGN + MESH_PLACE_PARTS_MAX <= MESH_PX_PER_SM, "PX_PLACE_ASSIGN + PLACE_PARTS_MAX <= PX_PER_SM");
62_Static_assert(MESH_S_CORE_CLASS + MESH_MAX_CPUS <= MESH_S_MLOAD, "S_CORE_CLASS + MAX_CPUS <= S_MLOAD");
63_Static_assert(MESH_S_LOAD_END <= MESH_SNAP_HOST, "S_LOAD_END <= SNAP_HOST");
64_Static_assert(MESH_S_FLEET_END <= MESH_S_SCHED, "S_FLEET_END <= S_SCHED");
65_Static_assert(MESH_S_SCHED_END <= MESH_S_JOBS, "S_SCHED_END <= S_JOBS");
66_Static_assert(MESH_S_JOBS_END <= MESH_S_PLOAD, "S_JOBS_END <= S_PLOAD");
67_Static_assert(MESH_S_NET_TOTAL + MESH_NIC_BYTES <= MESH_S_LINKS, "S_NET_TOTAL + NIC_BYTES <= S_LINKS");
68_Static_assert(MESH_H_BYTES <= MESH_PROG_TABLE, "H_BYTES <= PROG_TABLE");
69_Static_assert(MESH_P_COUNTERS + 4 * MESH_COUNTERS <= MESH_P_RING, "P_COUNTERS + 4 * COUNTERS <= P_RING");
70_Static_assert(MESH_P_RING == 4 * MESH_LINE, "P_RING == 4 * LINE");
71_Static_assert(MESH_P_MARKS + 4 * MESH_PROG_RESULTS <= MESH_PROG_CTL_BYTES, "P_MARKS + 4 * PROG_RESULTS as usize <= PROG_CTL_BYTES");
72_Static_assert(MESH_SC_CTL_BYTES == MESH_P_RING, "SC_CTL_BYTES == P_RING");
73_Static_assert(MESH_PROG_NODES + MESH_PROG_NODES_BYTES * MESH_PROG_SLOTS <= MESH_TRACE_BASE, "PROG_NODES + PROG_NODES_BYTES * PROG_SLOTS <= TRACE_BASE");
74_Static_assert(MESH_EX_BASE + MESH_EX_BYTES <= MESH_PROG_EXT, "EX_BASE + EX_BYTES <= PROG_EXT");
75_Static_assert(MESH_PX_COUNTER_NAMES + MESH_NAME_BYTES * MESH_COUNTERS <= MESH_PX_FIELD_COUNT, "PX_COUNTER_NAMES + NAME_BYTES * COUNTERS <= PX_FIELD_COUNT");
76_Static_assert(MESH_PX_PLACE_ASSIGN + MESH_PLACE_PARTS_MAX <= MESH_PX_FIELDS, "PX_PLACE_ASSIGN + PLACE_PARTS_MAX <= PX_FIELDS");
77_Static_assert(MESH_PEER_VERSION > MESH_VERSION, "PEER_VERSION > VERSION");
78_Static_assert(MESH_VIEW_HEAP_END == MESH_MAILBOX_BYTES, "VIEW_HEAP_END == MAILBOX_BYTES");
79_Static_assert(MESH_S_RATES + 4 * MESH_PROG_SLOTS <= MESH_S_LAST_BLINK_MS, "S_RATES + 4 * PROG_SLOTS <= S_LAST_BLINK_MS");
80_Static_assert(MESH_S_SESSIONS + 4 <= MESH_S_MEMBERS, "S_SESSIONS + 4 <= S_MEMBERS");
81_Static_assert(MESH_S_LOCK_NAME + MESH_NAME_BYTES <= MESH_S_RATES, "S_LOCK_NAME + NAME_BYTES <= S_RATES");
82_Static_assert(MESH_SN_HEAD_BYTES + MESH_H_BYTES == 0x110, "SN_HEAD_BYTES + H_BYTES == 0x110");
83_Static_assert(MESH_HTTP_HV_SAMPLES + MESH_HTTP_SAMPLE_BYTES * MESH_PROG_SLOTS <= MESH_HTTP_RESP_OFF, "http::HV_SAMPLES + http::SAMPLE_BYTES * super::PROG_SLOTS as u32 <= http::RESP_OFF");
84
85#endif