8 ½ ounces (1 1/4 cups) green or brown lentils, picked over and rinsed
Salt and pepper
1 ¼ cups basmati rice
2 pounds yellow onions, halved and sliced crosswise
2 teaspoons salt
1½ cups vegetable oil
3 garlic cloves, minced
1 teaspoon ground coriander
1 teaspoon ground cumin
½ teaspoon ground cinnamon
½ teaspoon ground allspice
1/8 teaspoon cayenne pepper
1 teaspoon sugar
3 tablespoons minced fresh cilantro
Bring lentils, 4 cups water, and 1 teaspoon salt to boil in medium saucepan over high heat. Reduce heat to low and cook until lentils are tender, 15 to 17 minutes. Drain and set aside. While lentils cook, place rice in medium bowl and cover by 2 inches with hot tap water; let stand for 15 minutes.
Toss onions and salt together in a large bowl. Microwave for 5 minutes. Rinse thoroughly, transfer to a paper towel-lined baking sheet, and dry well.
Heat onions and oil in Dutch oven over high heat, stirring frequently, until onions are golden brown, 25 to 30 minutes. Drain onions in a colander set in large bowl, reserving the oil. Transfer the onions to a paper towel-lined baking sheet to drain. Set oil aside.
Using your hands, gently swish rice grains to release excess starch. Carefully pour off the water, leaving rice in the bowl. Add cold tap water to rice and pour off the water. Repeat adding and pouring off cold tap water 4 to 5 times, until water runs almost clear. Drain rice in a fine-mesh strainer.
Heat reserved onion oil, garlic, coriander, cumin, cinnamon, allspice, 1/4 teaspoon pepper, and cayenne in a Dutch oven over medium heat until fragrant, about 2 minutes. Add rice and cook, stirring occasionally, until edges of rice begin to turn translucent, about 3 minutes. Add 2 1/4 cups water, sugar, and 1 teaspoon salt and bring to boil. Stir in lentils, reduce heat to low, cover, and cook until all liquid is absorbed about 12 minutes.
Off heat, remove lid, fold dish towel in half, and place over pot; replace lid. Let stand for 10 minutes. Fluff rice and lentils with fork and stir in cilantro and half of crispy onions. Transfer to serving platter, top with remaining crispy onions, and serve.