interplane.Get Omega
Read in your language

aien-protocols-mv

Canonical specifications, wire protocols, and schemas for the AIEN sovereign ecosystem

Brought by drakestapleton

branch main Branches Tags History

aien-protocols-mv / crates / aien-microjob / examples / an0_digest.rs

19 lines · 700 bytes Raw Blame History
1//! Print the `matmul_u32` payload (hex) and the Rust worker kernel's output
2//! digest for `M K N SEED`, one line: `<payload-hex> <digest-hex>`. Used by
3//! `specs/aienet/jobpath/parity.sh` against the Omega recompute.
4use aien_microjob::aienet0::{matmul_u32_digest, to_hex, MatmulU32};
5
6fn main() {
7 let a: Vec<u64> = std::env::args()
8 .skip(1)
9 .map(|s| s.parse().expect("M K N SEED are integers"))
10 .collect();
11 assert_eq!(a.len(), 4, "usage: an0_digest M K N SEED");
12 let j = MatmulU32 {
13 m: a[0] as u16,
14 k: a[1] as u16,
15 n: a[2] as u16,
16 seed: a[3],
17 };
18 println!("{} {}", to_hex(&j.encode()), to_hex(&matmul_u32_digest(&j)));
19}