Reproducibility in Optimization: Theoretical Framework and Limits