Skip to content

test: add the qbit P2MR v1 conformance corpus - #113

Merged
kiwidream merged 1 commit into
p2mr-v1-conformance-suitefrom
p2mr-v1-conformance-vectors
Jul 13, 2026
Merged

kiwidream merged 1 commit into
p2mr-v1-conformance-suitefrom
p2mr-v1-conformance-vectors

Conversation

@kiwidream

@kiwidream kiwidream commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Promote the existing commitment and PQC witness fixtures into a strict, versioned qbit P2MR v1 corpus.
  • Add a four-file manifest with exact-byte digests and 70 unique cases: 11 commitment/control/address, 14 witness/sighash/PQC, 2 cross-profile, and 43 script/control/leaf/opcode/resource boundaries.
  • Add deterministic Python/Rust generator ownership and non-mutating merge contracts.
  • Make qbit C++ consumers validate schemas, metadata, intermediate values, fixture selectors, consensus/policy results, and exact script errors.

This is PR 2 of 4 and is stacked on p2mr-v1-profile-spec. It changes fixtures and tests, not production consensus behavior.

Stack: parent #112 ← PR 2/4 → next #114.

Refs #105

Testing

  • Built locally.
  • Ran focused unit or functional tests for the changed area.
  • Ran lint or formatting checks relevant to this change.
  • Not run. Reason:

Validation included a clean test_bitcoin build, all 98 script_p2mr_tests, descriptor consumers, exact Python-to-Rust regeneration, manifest --check, JSON checks, git diff --check, and Docker lint.

Target Branch

  • This PR targets main or a maintainer-requested release branch such as 0.1.x.

Stack review base: p2mr-v1-profile-spec. Final target after the parent merges: 1.0.0.

Risk / Review Notes

  • Consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed.
  • No consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed.

Notes: this PR is consensus-adjacent test data. Existing cryptographic values are preserved; new expected results are checked through qbit's production validation paths.

Docs / Process Impact

Choose exactly one:

  • I updated public docs because this PR changes user-visible behavior, integration guidance, release/process guidance, or expected validation.
  • No public docs update needed. Reason:

The test-data README documents the authoritative corpus and generator contract.

libbitcoinpqc Subtree Checklist (if src/libbitcoinpqc changed)

  • Source commit is reachable from an immutable release tag in Qbit-Org/qbit-libbitcoinpqc.
  • qbit imports the tagged upstream tree directly without pruning or a curated subtree branch.
  • Subtree import/update was performed with contrib/devtools/update-libbitcoinpqc-subtree.sh.
  • test/lint/libbitcoinpqc-subtree-check.sh passes locally.
  • Any default tag change in contrib/devtools/update-libbitcoinpqc-subtree.sh is intentional and matches doc/subtrees/libbitcoinpqc.md.

Not applicable; the subtree is unchanged.


Note

Low Risk
Test fixtures, devtools, and documentation only; PR description states no production consensus or script behavior changes.

Overview
Introduces a versioned qbit P2MR v1 test corpus (qbit-p2mr-v1, schema 1) with a p2mr_v1_manifest.json that pins per-file SHA256 digests, case counts, spec linkage, and BIP-360 comparison metadata. New p2mr_cross_profile_vectors.json documents qbit vs pinned BIP-360 expectations; manifest tooling also covers commitment, witness, and script-boundary fixture files wired into test_bitcoin.

Witness regeneration no longer overwrites a bare array: Python and Rust generators take --input / --output, merge only owned vector IDs (Python vs Rust), and enrich entries with id, generator, witness, digest_defined, and structured expected outcomes. Python adds a CHECKSIGADD sub-vector on the default-sighash case; Rust validates the wrapped corpus shape before merging.

Adds contrib/devtools/update-p2mr-v1-manifest.py to refresh or --check manifest digests/counts, and documents the Python→Rust→manifest workflow in src/test/data/README.md.

Reviewed by Cursor Bugbot for commit d1948b7. Bugbot is set up for automated code reviews on this repo. Configure here.

@kiwidream
kiwidream force-pushed the p2mr-v1-profile-spec branch from 6d2f2c6 to 38f59bf Compare July 13, 2026 13:57
@kiwidream
kiwidream force-pushed the p2mr-v1-conformance-vectors branch from 72a9070 to d1948b7 Compare July 13, 2026 13:57
@kiwidream
kiwidream changed the base branch from p2mr-v1-profile-spec to p2mr-v1-conformance-suite July 13, 2026 14:48
@kiwidream
kiwidream merged commit d1948b7 into p2mr-v1-conformance-suite Jul 13, 2026
1 check passed
@kiwidream kiwidream mentioned this pull request Jul 13, 2026
6 of 14 tasks
@kiwidream

Copy link
Copy Markdown
Member Author

Merged into p2mr-v1-conformance-suite; final landing into 1.0.0 is tracked by #118.

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.

1 participant