Skip to content

feat(conflict): Add Tango target signature conversion - #881

Open
manjari25 wants to merge 2 commits into
mainfrom
manjari/tango-signature-conversion
Open

manjari25 wants to merge 2 commits into
mainfrom
manjari/tango-signature-conversion

Conversation

@manjari25

@manjari25 manjari25 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Why?

The Tango-backed conflict analyzer receives, from Tango, each affected target as a label with a distance. It compares batches by 64-bit target IDs, so those pairs need a deterministic conversion into the sorted, duplicate-free targets that a TargetSignature stores. This PR adds that conversion.

What?

Everything is added under submitqueue/extension/conflict/tango:

  • Adds LabelDistance, the pair an adapter returns for each affected target: the label exactly as Tango reported it, and its distance from the nearest directly changed source.
  • Adds targetID, which hashes a label to its 64-bit ID: the first 8 bytes of the SHA-256 of the label, read big-endian.
  • Adds toSignatureTargets, which turns label and distance pairs into:
    • the signature targets, sorted ascending by ID, one entry per ID at the smallest distance reported for it, and
    • every distinct (ID, label) pair, sorted by ID then label, for the target dictionary. Two labels that hash to the same ID (a collision) both appear here, and only one signature entry is kept.
  • An empty input yields empty results, which is a valid signature that conflicts with nothing. The input is not modified.
  • Tests use the example IDs from the RFC as fixed vectors, plus collisions, duplicate labels and unmodified input.
  • Nothing calls this code yet. The analyzer that uses it is a later PR in this stack.

Test Plan

./tool/bazel test //submitqueue/extension/conflict/tango/...
make check-gazelle
make check-mocks
make lint
CI

Issue

@manjari25
manjari25 added this pull request to stack #883 October 16, 2026 20:28
@manjari25
manjari25 marked this pull request as ready for review October 16, 2026 22:00
@manjari25
manjari25 requested review from a team, behinddwalls and sbalabanov as code owners October 16, 2026 22:00

This branch has not been deployed

No deployments
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