Uncertainty quantification for subgradient descent, with applications to relaxations of discrete problems