skip to content
==> README.md <==
1# @ajax/mesh-rt-block
2
3The block collectives of a multi-warp mesh node, in a fixed order that makes float results bitwise the
4same on every GPU and in the CPU reference (`mesh_ref::block`): warp butterfly reductions, Hillis-Steele
5warp scans, block reductions and scans over the 1024-leaf tree, broadcasts, and the fixed f32 operations
6(sum with identity -0.0, max in the IEEE total order). Also `mesh_shared`, a typed, bounds-checked window
7of the node's shared memory.
8
9Rust's generic `Word` and closures become one function per type (`_u32`, `_f32`, `_u64`) taking the
10operation as a function pointer: `mesh_rt_block_reduce_f32(v, MESH_RT_SUM_F32_ID, mesh_rt_add_f32)`. Every call is
11inlined, so the operation is too.
12
13- **Ported from:** alpha-rust-mesh `crates/mesh-rt/src/block.rs`.
14- **Tests:** programs/blocks runs every collective on 1..32-warp nodes on the simulator and compares with
15  the Rust reference's vectors (@ajax/mesh-ref-block).