There is probably not a single answer.. there are quite some options ! I'm not familiar with calculations, but there exist certain types of food that allow very volume-effective production,
Growing food underground: peanuts
A very high yield, maybe a winner: peanuts. They grow underground, allowing for a high production per unit of volume. Same counts for potatoes and radish. High energy, large yield.
Bananas
My second place, sofar.. in terms of pure energy per volume,
.. but un practice, you'll need a lot of space to grow banana trees. I mension them because if you would calculate calories/m3 only, it would probably result in a very nice yield. I think genetic engineering is needed to allow large scale banana harvesting in greenhouses.
Growing food inside boxes
Fungus or mealworm may not be appropriate food (or appreciated food) for most humans. However, in times of great resource difficulties, it may become necessary. In times of need, insects and worms could be the answer to your question !
Fungus
Certain species are edible, they will fit in very small spaces and grow very fast, under certain conditions.
Mealworms
A very effective way to produce large amounts of "calories per volume" is insects, larvae and mealworms.
Feed your chicken
Chicken meat is definitely not an answer, but there will be demand for it as a supplement. Your small volume mealworm farm could feed many chicken. Consider modern bio-industrial techniques to raise your chicken in stacked cages, you could fit a lot of them in a cubic meter..
Chicken suffering from energy optimization decisions
Greenhouses
Chicken also produce high energy fertilizer, suitable for greenhouses. The advantage of using greenhouses is volume/density (your question) and energy use effectiveness.
Honey
Bees are able to produce healthy and very high energy food with lots of carbon hydrates. However, your natural surroundings should provide the bees with food, which would involve additional total "volume" used, of course.
Sources,
https://www.google.com/search?q=bananas+greenhouses&tbm=isch
https://courses.lumenlearning.com/wm-nmbiology2/chapter/fungi-as-food/
https://www.instructables.com/Mealworm-Farm/
https://www.gardeningknowhow.com/composting/manures/chicken-manure-fertilizer.htm
https://www.rd.com/article/peanuts-real-definition/