I encountered the same issue today. In my case, the problem happens because the PIDs are not grouped together. RankLib uses a hashmap to save the ideal DCG values for all different PIDs, so when the a PID appears in two separate groups, RankLIb calculates the DCG of the second group but still uses the cached ideal DCG of the first group, resulting in an error. To fix this, either fix the data by grouping PIDs together, or let RankLib handle ungrouped PIDs itself. Somehow 2.1-pached does seem to give...