Skip to content

feat(u4): add canonical reflection witness expansion - #262

Merged
RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
brenorb:codex/u4-palindrome-witness
Oct 16, 2026
Merged

RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
brenorb:codex/u4-palindrome-witness

Conversation

@brenorb

@brenorb brenorb commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Reflection-constrained nibble state can now be supplied as a canonical half-vector and expanded on chain. Equal reflection supports even/odd vectors; complement reflection enforces mirrored values summing to fifteen and rejects odd widths. A full-vector verifier supplies the same constrained domain and output layout for comparison.

At width 32, equal reflection reduces complete-leaf script plus serialized data-witness bytes from 651 to 341, and complement reflection from 683 to 389. Both reduce 32 data items to 16 and the measured combined stack peak from 36 to 33, with zero hints. These gains apply only when the consumer requires the reflection relation; the adapter supplies no data authentication or cryptographic security.

The implementation reuses the canonical nibble boundary and fixed-depth copies. Tests exhaust one/two-symbol half vectors, compare every output for wider asymmetric patterns, reject malformed encodings within the fragments independently of output predicates, reject every broken mirrored pair, and exercise the accepted maximum width. Exact 1,000-item tests use runtime caller data on both stacks so constant markers cannot optimize away. The knowledge record includes dynamic executed opcodes, immutable provenance, the odd-complement negative result NR-076, and consumer acceptance criterion OP-033.

Validation:

  • Focused reflection tests and maximum-width test pass.
  • Metric snapshots pass without refresh after their intentional initial measurement.
  • Knowledge validation, formatting, and all 50 Python harness tests pass.
  • Required locked non-field Rust suite passes with the CI's host optimization settings (cargo test --locked -- --skip fields::): 897 unit tests, all integration suites, 149 metric tests, and 6 doc tests. Field tests remain filtered.

Execution remains locally-reproduced / unclassified; no complete Bitcoin Core spend or relay-policy acceptance is claimed. Measured P2SH and static-opcode limits are documented separately.

@brenorb
brenorb marked this pull request as ready for review October 13, 2026 04:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-10-13T04:23:39.579650Z 341f5c0 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 f392f37 into solving-bitcoin:main Oct 16, 2026
3 checks passed
@brenorb
brenorb deleted the codex/u4-palindrome-witness branch October 28, 2026 02:57
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