Use zig build run and run the binary directly

Just saw a similar issue here: How can you allocate big chunks using FixedBufferAllocator? - #6 by jjmerelo

It looks like buffer overflows aren’t being reported as such and it’s either running garbage instructions or segfaulting. I can’t speak for what the core team is doing on this issue at the moment.

The real question is why zig build run doesn’t have an overflow, but you’d have to check the output of your matrix multiplication to see if it has bad behavior. One way would be to set each value to 1 and see if the output of the multiplication for each element is equal to 1024. That’s because sum: x_i * y_j for i,j < 1024 for x_i, y_j = 1 will produce 1024 as an output for each element (or N more generally in the case of square matrices).

I’m suggesting this because I’d like to see if the inner product behaves as expected because then we’d truly have a discrepency.

1 Like