Skip to content

Conversation

@ana-pantilie
Copy link
Contributor

@ana-pantilie ana-pantilie commented Jan 13, 2026

@ana-pantilie ana-pantilie marked this pull request as ready for review January 13, 2026 21:11
@ana-pantilie ana-pantilie requested review from kwxm and zliu41 January 13, 2026 21:11
@kwxm
Copy link
Contributor

kwxm commented Jan 14, 2026

I think the easiest way to deal with this would just be to extract the parts that I need and copy them into my branch.

such situations. To ensure non-negative memory costs, we further overapproximate the formula
to remove the negative intercept:
Memory = 21*(n/2) + 12 = 10.5*n + 12 --approx--> 11*n + 12
Copy link
Member

Choose a reason for hiding this comment

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

If the problem is negative intercept, why not just make intercept 0?

Copy link
Contributor Author

@ana-pantilie ana-pantilie Jan 14, 2026

Choose a reason for hiding this comment

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

If the intercept is 0 then for an empty result the memory will be 0 which I don't think we want. Also, I don't really like the way I had to approximate things here, ideally we'd have a way to differentiate between the two cases (empty and non-empty) but I don't think that's possible with the current costing framework.

@kwxm
Copy link
Contributor

kwxm commented Jan 14, 2026

I think the easiest way to deal with this would just be to extract the parts that I need and copy them into my branch.

I've done this now: other things had changed in plutus-ledger-api and just adding the changes that I needed (the numbers in the JSON files and the models and the explanatory Note in BuiltinMemoryModels.hs) saved me from some conflicts.

@ana-pantilie
Copy link
Contributor Author

@kwxm should I just close this PR then?

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