Engineering teams often face challenges with merging pull requests, particularly as they scale, due to the inefficiencies of traditional merge queues that do not account for dependent or "stacked" pull requests. Graphite tackled this issue by developing the first stack-aware merge queue, which treats stacks as interdependent units rather than individual pull requests, enabling more efficient merging processes. This innovative system has led to significant productivity improvements, such as a 74% reduction in merge times at Ramp and seven hours saved per engineer per week at Asana. The merge queue's architecture includes speculative execution, bisection algorithms for isolating failures, and partitioned queues to manage concurrent processes, all of which minimize CI resource waste and streamline the merging workflow. These enhancements enable teams to maintain high code quality without sacrificing developer velocity, thereby transforming the economics of software development by encouraging smaller, more reviewable pull requests and facilitating faster feature delivery.