Skip to content

test(u4): strengthen pair-to-byte coverage - #239

Merged
RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
brenorb:test/u4-pair-to-byte-validation
Sep 25, 2026
Merged

RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
brenorb:test/u4-pair-to-byte-validation

Conversation

@brenorb

@brenorb brenorb commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Carry the useful validation from superseded PR #80 into the canonical pair-to-byte implementation from #33.\n\n- Exercise all 256 nibble pairs in both checked and unchecked modes.\n- Make malformed-input coverage consume the output and assert the range-check error instead of relying on clean-stack failure.\n- Preserve the existing surrounding-state assertion.\n\nFocused tests pass; formatting and knowledge-base validation pass.

@RobinLinus
RobinLinus merged commit 9d7a5a0 into solving-bitcoin:main Sep 25, 2026
3 checks passed
brenorb added a commit to brenorb/bitcoin-scripts that referenced this pull request Sep 28, 2026
…licts

Robin Linus requested integrating current main while retaining solving-bitcoin#239's
checked/unchecked pair-packing and range-error tests on stack.rs
alongside this PR's word-transfer and lookup-lifecycle documentation
and tests.

- knowledge/catalog.json: combined the two independent stack_contract
  sentence additions (main's popcount wording, this PR's transfer/
  lookup wording); kept every record and configuration from both
  sides (117 records, 292 configurations; main's 283 configs + this
  PR's 9 new ones).
- src/arithmetic/u4/mod.rs: re-sorted the module list, keeping every
  `pub mod` from both sides.
- src/arithmetic/u4/stack.rs: kept both `use` imports (this PR's
  execute_script_with_inputs_strict and main's bitcoin_scriptexec::
  ExecError, the latter needed by solving-bitcoin#239's tests). All 24 tests in the
  module (main's 13 plus this PR's 11 new transfer tests) survive;
  the PR's now-superseded `packs_all_checked_nibble_pairs` is
  correctly dropped in favor of main's renamed/expanded
  `packs_all_nibble_pairs`, per instruction to keep main's
  pair-packing functions unchanged.
- tests/primitive_metrics.rs: both sides had appended new tests at
  the same insertion point; spliced this PR's 4 new u4 metric tests
  ahead of main's 4 new u32 metric tests, preserving all fns from
  both sides (206 main + 4 new = 210 total, verified by name-set
  comparison).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brenorb
brenorb deleted the test/u4-pair-to-byte-validation 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