IntersectMBO / IntersectMBO/plutus

Generate piecewise builtin cost models entirely automatically.

Open
#6,010 0 comments 0 reactions 0 assignees View on GitHub
Costing Internal status: triaged tech debt
Dominant language
Haskell
Stars
1.6k
Forks
508
Avg merge
3d 10h
Merged PRs (30d)
22

Description

[Migrated from PLT-1173]

Some of the builtin functions have piecewise cost models: for example `equalsString` is constant time (and fast) for strings of different length but has a linear cost function for strings of the same length. For functions like these we collect data for a full range of inputs and fit the complex part of the cost function (eg for strings of the same length) automatically, but currently generate the constant-cost part manually and hard-code the result in CostModelCreation.hs. ~We should do the whole thing automatically, which will involve fitting multiple cost functions in R and combining these in the Haskell code.~ Recent changes in the R/Haskell interface allow us to pass more information from R to Haskell and will make this easier. Some of the budgeting benchmarks currently only benchmark the on-diagonal behaviour (for instance), so this may require some extra benchmarking for off-diagonal behaviour.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.