Skip to content

feat(u4): document stack-preserving word copy - #37

Closed
brenorb wants to merge 1 commit into
solving-bitcoin:mainfrom
brenorb:feat/u4-copy-router
Closed

brenorb wants to merge 1 commit into
solving-bitcoin:mainfrom
brenorb:feat/u4-copy-router

Conversation

@brenorb

@brenorb brenorb commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a focused contract test for u4_copy_u32_from(0)
  • verify source, unrelated main-stack state, and altstack state are preserved
  • record the representative 16-byte script, 16-byte witness, and 16-item peak

Validation

  • cargo test --locked arithmetic::u4::stack::tests::copy_u32_from_preserves_the_source_and_unrelated_state
  • cargo test --locked --test primitive_metrics u4_copy_u32_from_metrics_are_current
  • python3 tools/kb.py validate
  • cargo fmt --all -- --check
  • git diff --check

The full repository test suite was intentionally not run; validation is scoped to the documented router.

Copy link
Copy Markdown
Contributor

Review: hold pending the changes below.

Fold this into the shared stack/router documentation-and-test PR. Strengthen the source-preservation test: dropping the source after making a copy does not establish that its contents remained unchanged. Check both the copied value and the original value explicitly.

Historical local validation (September 11, at this unchanged PR head): python3 tools/kb.py validate passed; 1 selected library test passed. These are targeted local checks, not a full-suite or complete-spend validation. Results using a stack-limit-disabled execution helper remain research-unlimited.

Rebase on current main, address the specific gaps above, and run the affected correctness and active metric checks. Broad/full-repository runs are not requested.

Reviewed commit: 1aac7ab54c7457d75d35ee2f53f8b3b3cc5d3a02.

@brenorb

brenorb commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #49. The shared U4 stack/router PR now carries the strengthened preservation/order tests, strict word-transfer boundaries, documentation, and active metrics requested here.

@brenorb brenorb closed this Sep 18, 2026
@brenorb
brenorb deleted the feat/u4-copy-router 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