Preprint · October 2026

SwiftLD: an agent-built, byte-identical vcftools LD that is 826-fold faster than vcftools and 7.6-fold faster than PLINK 2

Joe Christensen (ORCID) · Translational Neuropsychiatry Unit, Department of Clinical Medicine, Aarhus University

Chart: SwiftLD is 590- to 1,156-fold faster than vcftools and 4.9- to 10.2-fold faster than PLINK 2 on five 1000 Genomes chromosome 22 regions; 826-fold faster than vcftools on average.

Abstract

SwiftLD is a drop-in replacement for the pairwise linkage disequilibrium (LD) modes of vcftools 0.1.17, --hap-r2 and --geno-r2, which population-genetic pipelines use to compute r², D and D′ between nearby variants. On three regions of 1000 Genomes chromosome 22 with 503 to 2,504 samples it wrote the same output as vcftools, byte for byte, and was 826-fold faster (geometric mean at two threads on an AVX-512 CPU). It was also 7.6-fold faster than PLINK 2, the fastest alternative, from VCF input to LD output on all five regions tested; PLINK 2 writes a different file, although its r² values agree with vcftools' within 10−6. One megabase with 503 samples took vcftools 29 s and SwiftLD 0.049 s, and on an ordinary AVX2 laptop SwiftLD was 102-fold faster than vcftools at 12 threads. vcftools was slow because it writes every kept site to a temporary file and, for every pair, reads the second site back one genotype byte per call, tallies the pair one haplotype at a time and flushes the output after each row. I built SwiftLD with correctness-gated coding agents (Claude Opus 5.5): every change had to keep the output byte-identical to vcftools. No output byte differed in 167,749 differential tests on three machines. Matching vcftools exposed seven upstream defects, five of which a short patch fixes.

A revised version with a new analysis of chromosome 22 was resubmitted to bioRxiv on 4 November 2026 and is in screening. The bioRxiv link will appear here once it is posted.

Cite

Christensen J. SwiftLD: an agent-built, byte-identical vcftools LD that is 826-fold faster than vcftools and 7.6-fold faster than PLINK 2. Preprint, 2026. Code: https://doi.org/10.5281/zenodo.23562615

Text and figures licensed under CC BY 4.0. Code licensed under LGPL-3.0.