Heat oven to 425°F / 220°C. Toss the sweet potato chunks with oil and salt, then roast for 20–25 minutes, until browned at the edges but not fully soft. Set aside.
Blend all the rendang paste ingredients into a thick paste.
In a wide pan, cook the paste over medium heat with 1–2 tbsp oil for 8–10 minutes, stirring often, until it darkens, smells deeply aromatic, and the oil starts to separate.
Add the coconut milk, water or stock, torn makrut lime leaves, bruised lemongrass, tamarind, soy sauce, and sugar if using. Simmer uncovered for 20–30 minutes, stirring occasionally, until the sauce thickens and reduces.
Add the roasted sweet potato and optional tofu, tempeh, or mushrooms. Simmer gently for another 10–15 minutes, turning carefully so the sweet potato stays chunky.
Stir in the toasted ground coconut and cook for another 5 minutes, until the sauce clings thickly to everything. Taste and adjust with more tamarind for brightness, soy sauce for salt, or chili for heat.
Remove the bruised lemongrass before serving.