There's a lovely article from 1886, written by Henry Rowland, who made the first decent diffraction gratings. He wrote about his process of lapping the screw threads to take out minor local errors. His screw didn't have to do a lot of work, but it had to be damn uniform.
Interestingly, even after that work, they ended up having to debug a really tricky problem. They sent their gratings to the premier astronomer at Harvard, who reported they weren't "perfect. Eventually this was debugged to a situation where a cam advanced the cutting tool after completing a cutting row, but only occurred when the cable connecting the motor to the tool had a slight bulge due to how the cable was cut and joined.
https://en.wikisource.org/wiki/Encyclop%C3%A6dia_Britannica,...