TL;DR: An MIT-licensed tool optimizes named constants in unmodified C source against a user-written scoring function, delivering measurable gains on compression and voice-activity-detection code.
Summary: learnc (MIT, github.com/devanmolsharma/learnc) tunes named constants inside unmodified C files against a score function the user writes in C, then writes the same file back with the new values. On held-out data it cut JPEG quantization tables in stb_image_write.h by 9.1% BD-rate at equal SSIM (tuned on 12 Kodak images, tested on the other 12, verified via libjpeg and scikit-image), versus 2.7% for mozjpeg's tables; on Google's WebRTC VAD it lifted LibriParty eval F1 from 0.810 to 0.859 by tuning every constant in vad_core.c. The author notes limits: no JPEG gains below 1 bpp, and it targets tens to hundreds of constants rather than large weight sets.
Why it matters: It offers a drop-in, gradient-free way to squeeze accuracy or size gains out of hand-tuned numerical constants in C codebases, including production signal-processing and ML inference components. Worth trying on your own constant-heavy kernels and quantization tables before assuming manual tuning is optimal.
Source: reddit