pub fn eval_grid(g: &Grid, inputs: &[i64]) -> i64
Simulate the grid (feed-forward, row-major) and return the PRIMARY output value.