Is the Canon EF 40mm f/2.8 STM Lens sharp? This page visually answers that question. Shown above are 100% crops from a lab-captured 40mm f/3.2 test image. Observe the contrast and resolution of these results.
Is the Canon EF 40mm f/2.8 STM Lens set to 40mm f/3.2 sharper than the Sigma 40mm f/1.4 DG HSM Art Lens set to 40mm f/2.0? The image quality comparison above also answers that question. Switch between the results to see the sharpness differences between these lenses.