The library has to compile

The bet is a deep learning library you can read. Zig, not a Python skin over someone else’s C++. Allocators you pass in. Errors you handle. CUDA kernels you wrote, not a graph runtime that decided for you. Day one is not a matmul. Day one is a library that compiles, and refuses to if the tests fail.

The first commit is the empty shape. Then back to basics: a contrived test so the build graph has something to run, another so it actually runs. For a moment the artifact is named lib and the linker emits liblib.a, which is as suspicious as it sounds. The static library becomes zigtensor. Compilation is wired to the test step. If the tests fail, you do not get a library.

An error set is imported for later: OutOfMemory, NotImplemented. The semi-colon convention is established like it matters, because in Zig it does. Types arrive as two enums. DType is f32, i32, bool. Device is CPU or GPU. Tests assert the tag names exist. One of them points at DType.CPU, which does not exist. Day two of Zig. Awkward. The root of the library is still dummy(). That is enough. The repo knows how to fail in public.

e66bff4 · a356865 · 2dbe061 · 838f00f · 11a1bfc · 0c7e0ed · 1694bed · 7978710 · 1fc7f60 · 758b88e · cadd654

Next