Skip to content

Conversation

@roconnor-blockstream
Copy link
Collaborator

Add new costs for jets in the Bitcoin application of Simplicity.

Generate C code for these new jets, including their CMRs.

The plan is to have a completely separate instance of benchmarks for the Bitcoin
jets, even for the core jets.
@roconnor-blockstream
Copy link
Collaborator Author

@apoelstra The command line syntax for GenPrimitive changes halfway through this PR, so your CI process will need to be updated. Let me know if it would be helpful to split this PR into two.

@apoelstra
Copy link
Collaborator

No, I think it'll be okay. It's not hard to detect the failure and then adapt dynamically. I will need to move the files to different paths anyway and if I attempt to do a "clean break" I'll have a lot of pain on my hands trying to maintain rust-simplicity PRs before and after the break.

@roconnor-blockstream
Copy link
Collaborator Author

Oh, I have not updated GenRustJets in this PR. Would you like me to add one more commit to this PR?

@apoelstra
Copy link
Collaborator

@roconnor-blockstream no, it's okay. I had just got the different Gen* files confused in my comments yesterday.

  • In the CI for this project, I run GenPrecomputed and GenPrimitive and check that the output matches what's committed. I need to update the job to handle the syntax change and then run it here and then we'll be good.
  • In the CI for rust-simplicity, I run GenRustJets and check that the output matches what's committed in the rust-simplicity project. This is totally independent.

So whether we do GenRustJets in this PR or a different one makes no difference to me. It would be better to do it in a different one since there's a bit of extra work on my end.

@psgreco psgreco changed the title Bitcon jet costs Bitcoin jet costs Dec 16, 2025
@apoelstra
Copy link
Collaborator

BTW from reading your code, it looks like we still return an exit 0 status when failing (because neither --elements or --bitcoin was passed). This is fine; I'll just check success by seeing whether the files were generated. But it would be better to change the error return.

@roconnor-blockstream
Copy link
Collaborator Author

roconnor-blockstream commented Dec 16, 2025

Yeah, that's a good idea. Let me change that.

@roconnor-blockstream
Copy link
Collaborator Author

Oh, the code defaults to --elements when nothing is passed. It seems I did keep backwards compatability. Would you rather I fail with no command line argument?

This option builds include files for bitcoin rather than elements.
@apoelstra
Copy link
Collaborator

Oh, the code defaults to --elements when nothing is passed. It seems I did keep backwards compatability. Would you rather I fail with no command line argument?

Yes please (and I see that you did). But my read of

main = do
  mopt <- parseOptions <$> getArgs
  case mopt of
    Nothing -> putStrLn "Invalid Arguments"
    Just OptElements -> writeFiles elementsJetList
    Just OptBitcoin -> writeFiles bitcoinJetList

is that the Nothing case writes a string and does nothing else.

@roconnor-blockstream
Copy link
Collaborator Author

Yeah, but parseOptions returns Just OptElements when there are no arguments.

Copy link
Collaborator

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK d47bfc6; successfully ran local tests

@roconnor-blockstream roconnor-blockstream merged commit d47bfc6 into master Dec 17, 2025
18 checks passed
@roconnor-blockstream roconnor-blockstream deleted the bitcon-jet-costs branch December 17, 2025 17:53
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.

3 participants