Peel the sweet potatoes and cut them into even 1-inch chunks. Place them in a large pot and add enough cold water to cover by about 1 inch. Add a pinch of salt.
Bring to a boil over high heat, then reduce to a gentle simmer. Cook until a fork slides into the center of a chunk with no resistance, 15 to 20 minutes after the water starts simmering. The chunks should be tender but not falling apart.
Drain well, then return the potatoes to the hot pot. Set the pot over low heat for 1 to 2 minutes, shaking occasionally, to let excess moisture steam off. Mash with a potato masher until mostly smooth; a few small lumps are fine. Do not use a blender or food processor.
Stir in 4 tablespoons melted butter, ⅓ cup brown sugar, ¾ teaspoon kosher salt, 1 teaspoon cinnamon, ¼ teaspoon nutmeg, and 1 teaspoon vanilla. Let the mash cool for 3 to 5 minutes, then stir in the warmed milk and the beaten eggs until combined. Spread the filling evenly in a buttered 9x13-inch baking dish.
Heat the oven to 350°F with a rack in the middle. Stir the remaining 4 tablespoons melted butter with ½ cup brown sugar, ⅓ cup flour, ½ teaspoon cinnamon, and a pinch of kosher salt until clumpy. Stir in the pecans and sprinkle the topping evenly over the filling.
Bake uncovered until the topping is browned and crisp, the edges are gently bubbling, and the center of the filling reaches 165°F, about 40 minutes (35 to 45 minutes is a typical range). If you are adding marshmallows, scatter them over the topping after about 30 to 35 minutes and bake 5 to 8 minutes more, until they are toasted and the center still reads 165°F.
Let the casserole rest 10 minutes before serving. The rest is not included in the recipe times. To make ahead, spread the filling in the dish, cover, and refrigerate for up to 2 days; keep the topping in a separate container. Add the topping just before baking, and allow 10 to 15 extra minutes if the filling is cold. Make-ahead baking time is not included in the recipe times.