# ZGC: Tensor Graphs/Numerical computation compiler

> Source: <https://ziggit.dev/t/zgc-tensor-graphs-numerical-computation-compiler/17866#post_1>
> Published: 2026-10-06 07:15:48+00:00

Started as a specialized runtime for neural network graphs, and pivoted to a tensor graph compiler, but really they’re the same thing?

[https://github.com/krypticlogan/zig-graph-compiler](https://github.com/krypticlogan/zig-graph-compiler)

Around February/March I got curious about zig comptime and how I could use it effectively. I figured I would use it to truly specialize a particular program, and the forward step for a neural network graph was a good task. I got it to work, but in my quest for optimization, I realized it might be better to just have an underlying tensor computation system that can specialize itself. That’s how I wound up with ZGC, and it’s reached a stage that I would like to share and gather feedback. Though it was a bit of a new domain for me, it felt like comptime made implementations easy to reason about and I’ve had a lot of fun working on it.

One problem that I’ve begun to run into as the compiler (and compile-time work) grows is the eval branch quota. It’s simple enough to scale, but it also becomes user-facing at times. I’m not sure how this is properly dealt with, or more likely, is intentional design that I shouldn’t try to avoid?

0.16.0, 0.17.0 soon

LLMs assisted in problem-space exploration, architectural ideas/concerns, refactors, validation, and testing.

Final implementation decisions were made by me, the developer, and any LLM-generated code was reviewed and edited by me.
