Skip to content

feat(u32): add direct zero predicate - #86

Merged
RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
brenorb:feat/u32-zero-test
Sep 16, 2026
Merged

RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
brenorb:feat/u32-zero-test

Conversation

@brenorb

@brenorb brenorb commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add u32_iszero() for the existing four-byte u32 representation
  • fold four per-limb zero tests without constructing a second zero word
  • document the canonical-byte precondition and measured boundary

Measurements

  • 4 policy-compiled locking-script bytes
  • 5 serialized bytes for the four-item zero witness
  • 4-item peak and 4 static non-push opcodes
  • 21-byte u32_push(0) + u32_equal() baseline

Validation

  • cargo test --locked arithmetic::u32::stack::tests -- --nocapture
  • cargo test --locked --test primitive_metrics
  • python3 tools/kb.py validate
  • git diff --check

The full repository test suite was intentionally not run.

@RobinLinus
RobinLinus merged commit 5c7f126 into solving-bitcoin:main Sep 16, 2026
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