Behind the scenes: the Backlog Priority or Stack Rank field
This post details the internal implementation of the 'Backlog Priority' and 'Stack Rank' fields used for ordering work items in Azure DevOps (TFS). It explains the 'sparsification' logic, which uses non-consecutive numbers to allow for efficient reordering of backlog items without updating all subsequent items. The post highlights performance issues observed with the previous 'halving logic' and the 'dust in the corners' problem, leading to dense top/bottom sections of the backlog. It then describes the optimizations introduced in TFS 2013 Update 2: increasing the upper bound to 2 billion, optimizing gap scanning, and improving the logic for generating new numbers to better utilize available gaps. The post also clarifies that the Backlog Priority field is a system field and recommends against manual updates, noting that while values may change after reordering, the item order remains consistent.