Skip to content

test(awq): match the capture-perf nodes to #5327's drop-set merge - #5349

Merged
Qubitium merged 1 commit into
mainfrom
test/awq-capture-perf-green-5349
Nov 19, 2026
Merged

Qubitium merged 1 commit into
mainfrom
test/awq-capture-perf-green-5349

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

tests/test_awq_capture_perf_5284.py has three red nodes on main @ 5470d9d4. They are test-side over-specifications left behind by #5327's drop-set merge, not product defects; this PR makes main green again with a test-only change.

Why they are red

#5327 replaced the cap + count concat/topk merge with a drop-set search that calls torch.topk twice (largest kept rows, then the drop set) and fills the freed slots in a different order.

Node Fails on main because Correct contract
test_a_winning_capture_still_merges assert len(calls) == 1; the merge now issues 2 the capture still merges and the survivor lands in the displaced row's slot (already asserted)
test_tied_priorities_take_the_merge_path assert len(calls) == 1; the merge now issues 2 a tie is not a loss, so the merge still runs
test_merge_matches_the_previous_algorithm[2] compares the buffer elementwise; the kept set is identical but the slots differ the kept rows, priorities, sources and row indices match; the layout does not

AWQProcessor._merge_reservoir_rows documents that the buffer is "deliberately not kept in capture order", so the layout comparison was never a contract.

Change

  • assert len(calls) == 1 -> assert calls in the two merge-path nodes.
  • New _canonical_snapshot sorts the kept rows by (source, row) before the equivalence comparison in test_merge_matches_the_previous_algorithm. The kept buffer rows, priorities, sources, row indices and used are still compared exactly. I checked the snapshot is not vacuous: perturbing one kept priority makes the comparison fail.

No product code changes.

Verification

  • Before: 3 failed, 10 passed on clean main (5470d9d4).
  • After: 13 passed.
  • bash format/check.sh passes.

@Qubitium
Qubitium merged commit 72cef9b into main Nov 19, 2026
6 checks passed
@Qubitium
Qubitium deleted the test/awq-capture-perf-green-5349 branch November 19, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant