I just realized that computing stats on an ungrouped docset still wouldn't work since I still need to do query facets on price ranges.
I don't follow this completely. If you use query or range facets this just should work, right? Or are you using group.facet or group.truncate in the same request?
Have you started on GroupedFacets?
Nope. I created group facet collector in the Lucene grouping module which is used by Solr in the SimpleFacets.
If I remember correctly both query facets and range facets in Solr are queries being executed on a top level searcher. For each queries a count is computed (based on the facet and main query result) and put in the response. For range facets multiple queries are executed based on the start, end and gap. I think grouped variant just needs to compute a grouped count for each query being executed. There are already collectors in the grouping module that compute a grouped count for a query.
The only thing I'm worried about is caching. For each query or range facet a docset is computed and this stored in the filter cache and possible used for future requests. This docset is intersected with the docset matching with the main query, which result in the count being used in the response. We would need to do something similar.