Buffer incoming opcodes and the filtered interdiff opcodes.
Review Request #15202 — Created July 29, 2026 and updated — Latest diff uploaded
The existing interdiff filtering algorithm tracks a single pending
opcode to process the next iteration, and yieldsfiltered-equal
opcodes as they're calculated.In preparation for some additional work on the algorithm that will
require opcode backtracking, this change switches to a
DiffOpcodeBuffer, which provides peek, consume, and queue operations
for the opcodes. This replaces the oldpending_opcode, simplifies the
opcode loop, and gives us some look-ahead features we'll be using.
filtered-equalopcodes are no longer yielded as they're calculated.
Instead, they're added to a list, which tracks the original tag for
processing (in the upcoming algorithm changes). When it's time to yield
an opcode, it will first flush the filtered opcodes, turning them into
filtered-equalas they're yielded, and once that's flushed the new
non-filtered opcode will be yielded.At the moment, this doesn't change anything about the processing of
interdiffs. The upcoming changes will take advantage of this to
backtrack and buffer opcodes through some new heuristics.
Unit tests pass.