Repository navigation
feat(u4): add canonical reflection witness expansion - #262
Merged
RobinLinus merged 1 commit intoOct 16, 2026
Merged
Conversation
brenorb
marked this pull request as ready for review
October 13, 2026 04:17
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.