pytorch/pytorch

pytorch built lintrunner because no existing tool handled their orchestration needs — but ~86% of its 57 adapters are structural. alint sits beneath as the structural floor; lintrunner keeps the AST-aware tail.

Narrative
Replaces the structural subset of your custom orchestration layer
Rules
87
Last revalidated
Engineering reference
README on GitHub · .alint.yml

Why this case study matters

pytorch is a multi-language ML mega-monorepo (~80k+ files; C++/CUDA core, Python frontend, Bazel + setup.py + CMake build, generated _C stubs, JIT/FX graph machinery, distributed/cuda/xpu/mps/rocm backend matrix). Its structural-validation surface is dominated by one artefact: .lintrunner.toml — a 1876-line TOML manifest declaring 57 distinct linter “adapters” orchestrated by lintrunner, pytorch’s bespoke per-file lint runner (Rust binary that spawns Python adapter scripts).

lintrunner exists because at the time pytorch needed it, no existing tool handled their orchestration needs (multi-language scopes, init-then-lint two-phase adapters, S3-vendored binary fetch, partial-file lint via @PATHSFILE fanout). Anyone running a custom orchestrator (pytorch’s lintrunner; tensorflow’s buildifier/yapf-driven CI; bazel’s own buildifier) is in the same situation.

Headline catch

alint isn’t trying to replace lintrunner — but the structural subset of .lintrunner.toml is exactly what alint specialises in.

Of the 57 lintrunner adapters:

So ~49 of 57 adapters (≈86 %) are within alint’s grammar today; the AST-aware tail (~8/57 ≈ 14 %) stays on lintrunner. alint is what you would have built instead of lintrunner if lintrunner had existed and you’d realised you only needed 86 % of its expressivity.

Where alint earns its keep here

Future story angles

The factual engineering writeup (tooling inventory, mapping table, gap catalogue, validation status footer) lives in the public alint repo at github.com/asamarts/alint/tree/main/examples/pytorch-pytorch/README.md.