Skip to content

test(javm): add proptests for PVM blob parsing#832

Open
wangzishuai1987 wants to merge 1 commit into
jarchain:masterfrom
wangzishuai1987:test/javm-program-proptest
Open

test(javm): add proptests for PVM blob parsing#832
wangzishuai1987 wants to merge 1 commit into
jarchain:masterfrom
wangzishuai1987:test/javm-program-proptest

Conversation

@wangzishuai1987
Copy link
Copy Markdown

Summary

Adds property-based tests for the JAR blob parsing and building pipeline in the PVM (PolkaVM) module:

Roundtrip properties:

  • build_simple_blobparse_blob always succeeds for valid inputs
  • Code bytes survive the build → parse roundtrip exactly
  • Bitmask roundtrip: both all-ones and arbitrary bitmask patterns
  • Jump table entries survive the build → parse roundtrip

Robustness properties:

  • parse_blob never panics on arbitrary input bytes
  • parse_code_blob never panics on arbitrary input bytes
  • Empty blobs are rejected (returns None)
  • Blobs with wrong magic bytes are rejected

These tests are important because blob parsing handles untrusted input — the node must never panic when receiving a malformed blob from the network or database.

Refs: #229

Add property-based tests for the JAR blob parsing and building:
- build_simple_blob → parse_blob roundtrip always succeeds
- Code bytes survive build → parse roundtrip
- Bitmask roundtrip (all-ones and arbitrary)
- Jump table entries survive build → parse roundtrip
- parse_blob and parse_code_blob never panic on arbitrary input
- Empty blob and wrong-magic blob are rejected

Refs: jarchain#229
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Genesis Review

Comparison targets:

How to review

Post a comment with the following format (rank from best to worst):

/review
difficulty: <commit1>, <commit2>, ..., <commitN>, currentPR
novelty: <commit1>, <commit2>, ..., <commitN>, currentPR
design: <commit1>, <commit2>, ..., <commitN>, currentPR
verdict: merge

Use the short commit hashes above and currentPR for this PR.
Each line ranks all comparison targets + this PR from best to worst.

To meta-review another reviewer's comment, react with 👍 or 👎.

@johandroid
Copy link
Copy Markdown
Contributor

/review
difficulty: 36d25a6, 4476208, currentPR, 5099f8c, 4edf45b, f88c6e1, db43357, c1d7fdf
novelty: 36d25a6, currentPR, 4476208, 5099f8c, 4edf45b, f88c6e1, db43357, c1d7fdf
design: 36d25a6, 4476208, currentPR, 5099f8c, 4edf45b, f88c6e1, db43357, c1d7fdf
verdict: merge

Adds focused proptest coverage for JAVM program blob parsing: build/parse roundtrips for code, bitmask, and jump table data, plus no-panic checks for arbitrary parser input. Ranked below the transpiler optimization and merkle deduplication targets, but above smaller test/refactor/doc changes because binary parser robustness is a meaningful assurance gain. This touches javm, though only tests, so a benchmark is not likely informative but the javm path is flagged by the review workflow.

@github-actions
Copy link
Copy Markdown
Contributor

JAR Bot: Review recorded from @johandroid (1 reviews, 0 meta-reviews).
Merge weight: 0/37665 (need >50%).

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