Season beef short ribs with salt and pepper.
Heat oil in a large casserole dish and brown the ribs on all sides.
Transfer ribs to a wire rack over a plate.
Fry chopped carrots, leeks, garlic, peppercorns, star anise, and chopped onions until golden.
Add wine and port, then simmer until reduced by three-quarters.
Return ribs to pan, add beef stock, cover with greaseproof paper, and simmer for 3 hours.
Strain the liquid into a clean pan and set the meat aside.
Reduce the strained liquid by half while skimming off excess fat.
Shred the meat from the bones and mix it into the reduced sauce.
Fry sliced onions in oil until softened, then stir in thyme leaves.
Boil potato pieces for 18 minutes until tender and drain.
Pass the potatoes through a ricer into a clean bowl.
Beat simmered milk and 200g of butter into the potatoes and transfer to a piping bag.
Preheat oven to 200°C, assemble beef in dishes, and top with onions, marrow bones, rosemary, and potato.
Bake for 20 minutes until the topping is golden and bubbling.
Serve the finished pie immediately.