Quoted By:
In such a situation, where you need the smallest and lightest pack possible, the ideal is to cook as little as possible. Sure, you still need to eat, but then you don't have to cook everything.
There are plenty foods that don't require cooking, like nuts, dry fruits and vegetables, dry meat, bread, milk/cheese... and that can be kept for a long time. That's what you should bet on first and foremost.
As for eating hot and cooking rice and pasta, the lightest and smallest combination is pic related, it boils water quickly and efficiently, the cup is very versatile and can just aswell be used to make some tea or cook pasta and rice (though only one at a time), and you can easily find one in which both your can stove and water bottle can fit for minimal volume.