make latent subgradient test more robust and faster.