skip to content
==> README.md <==
1# @ajax/mesh-backend
2
3The executor interface meshd's driver sees: `mesh_backend`, `mesh_compiler`, `mesh_kernel` (a loaded image), `mesh_stream` (where a slot's work runs) and `mesh_prepared` (an image compiled off the driver thread). The Rust's traits are tables of functions (`ops` + `self`); the trait's default methods apply when an op is NULL. Also the free functions of backend.rs: `mesh_pick_exec`, `mesh_runs_here`, `mesh_prepare_any`, `mesh_check_manifest`, the backend label, the exit cleanups (native first, then MPS), and a native program's binary path for this target.
4
5Implemented by @ajax/mesh-mps (CUDA, blink and MPS), @ajax/mesh-native (worker processes) and the wasm executor.
6
7## Differences
8
9- Errors are `char **err` (the Rust's `Result<_, String>` messages).
10- `Kernel` and `Stream` are open (an executor provides its ops) instead of a closed enum.
11- Exit cleanups are registered by the executors (`mesh_backend_on_cleanup`) instead of being called by name.
12
13## Ported from
14
15[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/backend.rs.
16
17## Tests
18
19`tests/backend.c`: labels, `pick_exec` and `check_manifest` refusals with the Rust's messages, `prepare_any` over fake compilers, and the cleanup order.
20
21## Licence
22
23MIT. See the repository's LICENSE.