In a medium bowl, combine the lentils, rice, and barley (if using) and rinse a few times until the water runs clear. Fill the bowl with warm water and allow to soak. Set aside.
Place the onion in a food processor and pulse to chop finely (but not blend). Remove the onion and set aside. Next, place the garlic and ginger in the food processor and chop very finely.
Turn Instant Pot on Sauté mode and set to More/High. Once hot, add oil, ghee, and chopped onion. Sauté for about 8-10 minutes, until the onions are lightly golden. While the onions are sautéing, add the garlic, ginger, and all the spices listed under Whole Spices. Deglaze with 1-2 tbsp water if the onions stick to the pot.
Add the meat and sauté until the color of the meat changes (~5 minutes). Meanwhile, pulse to chop the tomatoes and green chilies in the food processor. Set aside.
Add the spices (haleem masala, red chili flakes, and turmeric) and salt and sauté for 30 seconds. Add the chopped tomato mixture and yogurt along with 3 cups of water.
Drain the soaked lentils and grains and add them to the Instant Pot. Stir well, ensuring no bits are stick to the bottom of the pot. Cancel Sauté. Cover the Instant Pot and set the valve to Sealing. Select the Meat/Stew Setting to set the pressure time to 45 minutes on High. (Note 4)
Allow the pressure to naturally release for at least 5 minutes, and then manually release the remaining pressure. Open the pot, and use a slotted spoon and tong to remove the beef pieces and place them in a large bowl. Discard any large whole spices (the bay leaves, cinnamon stick, etc.) as they come up. Using a potato masher, shred the beef, maintaining the stringy texture as much as possible. (Alternatively, shred the beef in a stand mixer using the paddle attachment on low speed. As per original recipe, you may also pulse to shred 7-8 times in the food processor - but be careful about breaking the grains too much and losing the strands of meat.)
Use an immersion blender to blend the dal until smooth. (Alternatively, transfer to your food processor to process until smooth.) Turn on the Instant Pot to Sauté mode and set to Less/Low.
Add the shredded beef and rolled oats and stir. Sauté for 3-5 minutes to cook this mixture down. Once the haleem starts bubbling, cancel Sauté and cover with a lid.
Select Slow Cook and set to More/High. Allow to cook, stirring occasionally, for an additional 20-30 minutes (See Note 1). Use a wooden spoon to crush the remaining beef and lentils on the side of the pan. Your haleem is done once you've reached a 'laced' consistency. (See Note 2) If the haleem thickens too much, add ½-1 cup boiling water and continue to stir. Add the garam masala/chaat masala and black pepper and stir to mix.
In a medium skillet, heat ghee or oil over medium-high heat. Add the onions and sauté, stirring occasionally, until golden brown (~5-6 min). Stir more cautiously toward the end because you want them deep brown in color but not burnt.
Pour the tadka over the haleem. Garnish and serve with more garnishing on the side.
