Repository navigation
test(u4): strengthen batch packing coverage - #232
Conversation
|
Review of
Holding this version for the concrete change above. Validation scope: source/diff and existing CI review; no new full-repository or field-arithmetic test run was requested. |
|
Addressed in 12ecb39, integrated with main at e9d5a66. Reproduced the false-positive path before fixing the test: the unchecked four-input batch left two outputs and failed with no interpreter error; adding OP_2DROP OP_TRUE made that same unchecked computation succeed. The production packer is unchanged. The replacement regression uses raw runtime witnesses for -1, 16, and a five-byte numeric encoding at every one of the four positions. Its success-path cleanup consumes both hypothetical outputs, and it requires Verify for out-of-range values or ScriptIntNumericOverflow for the oversized encoding. A valid-input control uses the identical cleanup, and the same shared error assertion detects a deliberately unchecked mutant that succeeds on malformed input. Updated the catalog test reference and evidence description; retained the encoding, preservation, and frontier coverage. Validation on the committed integrated tree: all 7 pack-module tests passed, including the stack frontier; u4_pack_metrics_are_current passed; KB validation, formatting, and whitespace checks passed. These new runtime-witness checks use the pinned local tapscript interpreter with stack enforcement. They do not establish Bitcoin Core consensus or relay-policy validity. No broad repository or field-arithmetic suite was run. |
Summary
u4_nibbles_to_bytesimplementation from feat(u4): add batch nibble packing #205Validation
cargo test --locked --lib arithmetic::u4::packcargo test --locked --lib arithmetic::u4::pack::tests::packs_scriptnum_boundary_encodings -- --exactcargo test --locked --test primitive_metrics u4_pack_metrics_are_current -- --exactpython3 tools/kb.py validaterustfmt --edition 2021 --check src/arithmetic/u4/pack.rsgit diff --checkThe repository-wide test suite was not run.