Skip to content

Locate the unique mismatch between opaque vectors - #329

Merged
RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
brenorb:codex/opaque-single-mismatch
Nov 9, 2026
Merged

RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
brenorb:codex/opaque-single-mismatch

Conversation

@brenorb

@brenorb brenorb commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Return the canonical index of the sole mismatch in two interleaved opaque vectors. Consume the first pair before allocating one private index slot. Every additional unequal pair must find an empty state, and the final state must identify a mismatch. Both caller stacks survive.

The matched baseline materializes every equality flag on alt before decoding the index. Both leaves check the exact index and finish with true. #312 returns a common-prefix length. #270 returns a nibble Hamming count. This primitive requires exactly one raw mismatch across the complete sequence and identifies it.

Pairs Mismatch index Schedule Leaf bytes Data witness bytes Data items Hint items Peak Executed
1 0 Fused 8 6 2 0 2 6
1 0 Dense mask 15 6 2 0 2 10
32 0 Fused 278 192 64 0 64 106
32 0 Dense mask 279 192 64 0 64 165
128 43 Fused 1,144 770 256 0 256 394
128 43 Dense mask 1,145 770 256 0 256 645
500 499 Fused 4,865 3,002 1,000 0 1,000 1,507
500 499 Dense mask 4,866 3,002 1,000 0 1,000 2,505

Serialized data witness includes item count and lengths, excluding leaf, control block, annex and transaction. Executed non-push counts include processed branch delimiters. Both schedules fit 500 pairs. Eager state allocation fails at that width, and the same eager code accepts a 499-pair control. Focused tests cover all short masks, hostile extra mismatches, wrong indices, opaque byte boundaries, and both preserved stacks at the exact frontier.

Evidence is locally reproduced and execution is unclassified. Focused tests, metric snapshots, knowledge validation, formatting, and diff checks passed. The required full non-field suite passed on this exact published commit.

@brenorb
brenorb marked this pull request as ready for review November 6, 2026 11:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T12:03:05.545646Z acbc62e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@RobinLinus
RobinLinus merged commit 0963ec3 into solving-bitcoin:main Nov 9, 2026
3 checks passed
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