forked from tinygrad/tinygrad
The memory planner was suballocating BUFFERs created during JIT capture that are still referenced by external lazy tensor graphs, like the .grad tensors assigned by backward(). The replay then only writes the arena slices, so realizing such a tensor after the call reads freshly allocated memory and silently returns zeros. Hold every BUFFER reachable from a live Tensor instead of only the parameters of the return value; true internals are still planned. Fixes #16571.
Three groups of tests run in CI backend -- tests that run on each backend null -- tests that don't require any backend unit -- tests that only run on a single backend in CI