Thai Muslim–Style Grilled Chicken

Ingredients:
1 3½–4-lb. whole chicken
3 tsp. white or black peppercorns
6 garlic cloves
2 cilantro roots, chopped, or 2 Tbsp. (heaping) finely chopped cilantro stems
3 Tbsp. (packed) light brown sugar
2 Tbsp. fish sauce
4 tsp. ground turmeric
1 Tbsp. kosher salt
2 tsp. ground coriander
2 tsp. ground cumin
1 tsp. ground cardamom
½ cup (packed) chopped fresh ripe pineapple
¼ cup distilled white vinegar or apple cider vinegar
6 large garlic cloves, finely chopped
3 red jalapeños or serrano chiles, seeds removed, finely chopped
¼ cup granulated sugar
1 tsp. kosher salt
½ tsp. freshly ground white pepper
1 tsp. (lightly packed) saffron threads or 1 tsp. ground turmeric
2 tsp. granulated sugar
1 tsp. kosher salt
⅓ cup virgin coconut oil
Vegetable oil (for grill; optional)
1 Tbsp. coarsely chopped cilantro
Cooked jasmine rice, coconut rice, or sticky rice (for serving)
A spice mill or a mortar and pestle

Instructions:
Spatchcock chicken the Thai way by placing it breast side up on a large cutting board. Using a sharp, heavy knife and working just to the side of the center of the breast, cut down through to the breastbone (do not cut all the way through to the backbone). Now that the path has been created, use the same knife—or, easier, a sturdy pair of kitchen scissors—to make a clean cut all the way through the breastbone and anything else that is still connecting the 2 sides of the breast together. Open up chicken and turn skin side up. Press down on chicken to flatten. Pat thoroughly dry.
Grind peppercorns in a spice mill or a mortar and pestle. Transfer to a food processor or leave in mortar and pestle and add garlic, cilantro roots, brown sugar, fish sauce, turmeric, salt, coriander, cumin, and cardamom and process or pound until smooth. Coat chicken completely in marinade, pressing to adhere and working into nooks and crannies. Place in a large bowl and cover with a plate. Let chill at least 12 hours and up to 24 hours.
Let chicken sit at room temperature 1 hour before grilling or baking.
Purée pineapple and vinegar in a food processor or blender until smooth. Transfer to a small saucepan and add garlic, jalapeños, granulated sugar, salt, and pepper. Bring to a boil over medium heat, then reduce heat so sauce is at a simmer and cook until thick and smooth (consistency should be similar to cocktail sauce), about 5 minutes.
Grind saffron to a fine powder in a spice mill or a mortar and pestle. Transfer to a small saucepan and add granulated sugar, salt, and ¼ cup water and cook over medium heat just until heated through and small bubbles appear around the edges of the pan. Whisk in coconut oil and remove from heat.
If using a grill, prepare a grill for medium-high indirect heat (for a charcoal grill, bank coals on one side of grill; for a gas grill, leave one or two burners off); oil grate. Arrange chicken, skin side up, on cooler part of grill. Close lid and grill, rotating chicken but keeping skin side up every 5–10 minutes, until skin looks dry and golden brown and an instant-read thermometer inserted into thickest part of breast and thighs registers 130°–140°, 35–40 minutes. If using charcoal and your coals are dying, start a new chimney of coals 15 minutes before this point so you are ready for the next step.
Uncover grill and increase heat to high (add more coals for a charcoal grill). Brush one fourth of basting liquid over skin and turn chicken over, positioning over direct heat on the hot side of the grill. Grill, brushing half of remaining basting liquid over bone side of chicken, until skin is browned and lightly charred in spots, about 3 minutes. (Watch carefully as this can happen quickly.) Turn chicken over and return to cooler side of grill. Brush skin with remaining basting liquid. Cover grill and continue to grill chicken until thermometer inserted into thickest part of breast registers 160° and thickest part of thighs registers 165°, 10–15 minutes longer.
If using an oven, place a rack in bottom third of oven and preheat to 350°. Place chicken, skin side up, on a wire rack set inside a rimmed baking sheet. Brush one third of basting liquid over skin. Bake, rotating baking sheet every 10 minutes, until an instant-read thermometer inserted into thickest part of breast and thighs registers 130°–140°, 35–40 minutes.
Increase oven temperature to 450°. Brush remaining basting liquid over skin and continue to bake, rotating baking sheet halfway through, until skin is crisp and charred and thermometer inserted into thickest part of breast registers 160° and thickest part of thighs registers 165°, 10–15 minutes longer.
Transfer chicken to a cutting board and let rest at least 15 minutes. Carve up further as desired.
Top dipping sauce with cilantro. Serve chicken with rice and dipping sauce alongside.
If you cook the chicken in the oven, using the dhungar method to perfume the finished chicken with the scent of smoky ghee is highly recommended.