Skip to content

Check C jet costs in the jet decoding tests - #353

Merged
apoelstra merged 1 commit into
BlockstreamResearch:masterfrom
stringhandler:st-test-c-jet-costs
Nov 4, 2026
Merged

apoelstra merged 1 commit into
BlockstreamResearch:masterfrom
stringhandler:st-test-c-jet-costs

Conversation

@stringhandler

Copy link
Copy Markdown
Collaborator

LLM suggested this additional test to check that the Haskell spec'ed costs match the c costs. We currently check only the CMR's match. The generated rust jets use the Haskell spec, so this will complete the circle for testing rust jets match the c jets, in terms of cost at least.

LLM description:

The FFI tests decode every Bitcoin and Elements jet with the C decoder and compare its CMR with Haskell's, but not its cost. The C cost is what libsimplicity charges against the budget, and it is stored separately from the CMR in primitiveJetNode.inc, so compare it with Haskell's jetCost as well.

Assisted by: Claude Opus 5.5 xhigh

The FFI tests decode every Bitcoin and Elements jet with the C decoder
and compare its CMR with Haskell's, but not its cost. The C cost is what
libsimplicity charges against the budget, and it is stored separately
from the CMR in primitiveJetNode.inc, so compare it with Haskell's
jetCost as well.

Assisted by: Claude Opus 5.5 xhigh

@apoelstra apoelstra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 951c082; successfully ran local tests

@apoelstra
apoelstra merged commit a5ce00c into BlockstreamResearch:master Nov 4, 2026
14 checks passed
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