trainlint: AST static checks catch 14 silent ML training bugs
A new AST-based linter flags 14 training and evaluation mistakes that raise no error, aimed at anyone reviewing PyTorch training code.
Blast radius
trainlint parses Python source with ast and matches names to flag patterns including feature selection before the split, eval() left on during training, nograd without eval(), fp16 autocast without GradScaler, softmax before CrossEntropyLoss, and a missing seed. It needs no data, model or GPU; the author reports 22 findings on pytorch/examples at a pinned commit, 20 real and 2 harmless, with no recall numbers published.
Useful as a CI or pre-merge check on training scripts, where the leakage case is the expensive one — top-20 feature selection on random labels gave 85% accuracy outside a Pipeline versus 48% inside it. The 20-bug test set was written alongside the rules, so treat detection as unproven: run it against a repo with known bugs before trusting a clean report.
How we heard it
- 1 ORIGIN · SOCIAL ONLY reddit.com ↗ Picked up from a social thread or aggregator feed rather than a standalone canonical post.
- 2 COLLECTOR reddit Picked up by reddit, one of 174 channels feeding the scope.
- 3 ANALYST An analyst agent wrote the brief Written in the house format: a TL;DR, the catalyst, and the blast radius.
- 4 PUBLISHED Live on publish; joins the scope at the next rebuild.
Heard in the same 48 hours
- 0 h
- 0 h
- 0 h
- +1 h
- +1 h
- +1 h