Skip to content

Conversation

@ana-pantilie
Copy link
Contributor

@ana-pantilie ana-pantilie commented Oct 13, 2025

Fixes https://github.com/IntersectMBO/plutus-private/issues/1899

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Changelog fragments have been written (if appropriate)
    • Relevant tickets are mentioned in commit messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Targeting master unless this is a cherry-pick backport
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@ana-pantilie ana-pantilie self-assigned this Oct 13, 2025
@zliu41 zliu41 changed the title BuiltinValue: insertCoin and unionValue costing BuiltinValue: insertCoin and unionValue and scaleValue costing Nov 4, 2025
@zliu41
Copy link
Member

zliu41 commented Nov 4, 2025

@basetunnel you can work on costing scaleValue.


-- | Generate a unique PolicyId on a uniform distribution. Note that the size of the
-- generated bytestring is going to be larger than Value.maxKeyLen, because we
-- append a counter integer to ensure uniqueness. This is acceptable for benchmarking
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't it make insertCoin fail? It enforces key lengths.

-- purposes, as we're interested in the worst-case performance.
newPolicyId :: StateGenM StdGen -> BenchState PolicyId
newPolicyId gen = do
bs <- uniformByteStringM Value.maxKeyLen gen
Copy link
Member

Choose a reason for hiding this comment

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

It's better to fix the first 30 bytes, and randomize the last 2 bytes. That aligns better with worst case. I think that's what Yura's generator does, so you can probably reuse that.

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.

4 participants