Hi matthieul. I think that there will be an actual developer who can chime in here, but I might be able to add something to the conversation (or maybe just enough to muddle it lol).
We don't have something out of the box to support what you're doing exactly, but you should be able to accomplish this via a LiQL query.
I noticed that the popularity field doc says "This is the field used to indicate "Top Entries" on contests." I don't think this would cause a problem with using it with conversation styles other than contests, but it might be good to compare it against kudos.sum(weight) and see if there is a difference in results. The kudos.sum(weight) field will take account of users whose kudos have a higher weight (e.g., a kudo with a certain rank might count as two kudos). I don't know for sure whether the popularity field takes kudo weight into account.
It might be more performant to filter results somehow first (by board ID, node ID, a date range, or depth for example) and then sort the results by kudos.sum(weight) and by replies.count(*).
Whatever you decide to try, be use to review the Sorting in LiQL queries section of the Community customization and performance best practices guide.