In a large bowl, whisk together the flour, salt, and granulated sugar.
Add the cold cubed butter. Use a pastry cutter or your fingertips to work the butter into the flour until the mixture resembles coarse crumbs with a few pea-sized pieces remaining.
Add the ice water one tablespoon at a time, gently mixing after each addition. Stop adding water when the dough begins to hold together when pressed.
Divide the dough into two equal portions and shape each portion into a disk. Wrap the disks and refrigerate for at least 1 hour.
While the dough chills, prepare the filling. Add the pitted cherries, sugar, cornstarch, lemon juice, vanilla extract, almond extract if using, and salt to a large bowl.
Stir gently until the cherries are evenly coated. Allow the mixture to rest for about 10 minutes.
Preheat the oven to 425°F (220°C). Place a baking sheet in the oven or prepare one to catch any bubbling filling.
On a lightly floured surface, roll out one disk of dough into a circle slightly larger than the pie dish.
Transfer the dough to a 9-inch pie dish. Gently press it into the bottom and sides without stretching the dough.
Pour the cherry filling into the crust and spread it evenly.
Roll out the second disk of dough and cut it into strips. Arrange the strips over the filling in a lattice pattern.
Trim the excess dough, then press and crimp the edges to seal the pie.
Refrigerate the assembled pie for 15–20 minutes.
Whisk the egg with the water or milk. Brush the egg wash over the crust and sprinkle with coarse sugar if desired.
Bake at 425°F (220°C) for 15 minutes.
Reduce the oven temperature to 375°F (190°C) and continue baking for 40–50 minutes, or until the crust is golden brown and the filling is bubbling.
If the edges brown too quickly, cover them loosely with aluminum foil.
Transfer the pie to a wire rack and allow it to cool for at least 3–4 hours before slicing.
Serve at room temperature or slightly warm with vanilla ice cream or whipped cream.