Skip to content

Decode a single contiguous run from canonical binary flags - #306

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

RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
brenorb:codex/single-run-mask

Conversation

@brenorb

@brenorb brenorb commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Result

Adds arithmetic::interval_mask::decode_single_run(n) to accept exactly one nonempty contiguous run of native tapscript binary flags and return its canonical zero-based start and length. A negative length records that the run has closed, saving a state item over the matched separate-flag schedule. Both schedules consume the first flag before allocating the remaining state.

Checked 32-flag leaf Script bytes Serialized data witness bytes Data items Hint items Combined peak Executed non-push operations
Signed-length state 602 41 32 0 33 352
Separate closed flag 698 41 32 0 35 354

Both leaves bind the same start 5 and length 8, then leave true. Witness bytes exclude script, control block, annex and transaction. All flags coexist at entry. The evidence uses whole-artifact optimizer ALL and the local stack-limited tapscript Consensus profile. Execution is unclassified.

Both schedules match an independent host interval oracle on every mask through width eight. Typed tests cover malformed flags and resource limits. Signed length reaches 998 flags with no caller state, versus 997 for a separate flag. The existing adjacent transition count alone accepts a split mask and a single run with the same count.

Verification

  • Focused interval and metric tests on the submitted head
  • python3 tools/kb.py validate and cargo fmt --all -- --check
  • cargo test --locked -- --skip fields::

@brenorb
brenorb marked this pull request as ready for review November 6, 2026 07: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-06T08:05:21.719815Z 6ba0f31 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 7abf040 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