Skip to content

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

Merged
behinddwalls merged 3 commits into
mainfrom
manjari/tango-signature-conversion
Oct 20, 2026
Merged

behinddwalls merged 3 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
Comment thread submitqueue/extension/conflict/tango/signature.go Outdated
@manjari25
manjari25 force-pushed the manjari/tango-signature-conversion branch from 9813034 to 6ba0ec1 Compare October 20, 2026 21:58
@manjari25
manjari25 added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2026
@manjari25
manjari25 force-pushed the manjari/tango-signature-conversion branch from 6ba0ec1 to 29a1852 Compare October 20, 2026 22:21
@manjari25
manjari25 force-pushed the manjari/tango-signature-conversion branch from 29a1852 to 28319eb Compare October 20, 2026 22:25
@behinddwalls
behinddwalls added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit aa574f4 Oct 20, 2026
20 checks passed
@behinddwalls
behinddwalls deleted the manjari/tango-signature-conversion branch October 20, 2026 22:58
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.

2 participants