-
Notifications
You must be signed in to change notification settings - Fork 484
Cost models for LookupCoin
, ValueContains
, ValueData
, UnValueData
builtins
#7344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Unisay
wants to merge
5
commits into
master
Choose a base branch
from
yura/costing-builtin-value
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
528ebcd
to
69f1d6f
Compare
LookupCoin
, ValueContains
, ValueData
, UnValueData
builtins
Add new benchmarking infrastructure for Value builtin operations: - Values.hs benchmark module with comprehensive test coverage - Integration into main benchmarking suite - Test cases for cost model validation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Implement statistical modeling and parameter extraction: - R models for lookupCoin, valueContains, valueData, unValueData - Linear regression models with proper memory scaling - Cost model parameter extraction and conversion infrastructure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Update benchmarking dataset with extensive Value builtin measurements: - Performance data for lookupCoin, valueContains, valueData, unValueData - Wide range of input sizes for accurate cost modeling - Statistical data supporting linear regression models 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace unimplementedCostingFun with proper parameter-based costing: - Wire Value builtin cost parameters into evaluation machinery - Update all cost model configurations (A, B, C) with generated parameters - Enable accurate gas cost estimation for Value operations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
30a34e3
to
b698ec1
Compare
…k sizes Refactor Value benchmark generators to use Cardano-compliant constraints and prevent generation of unrealistically large Values that were causing inflated cost model parameters. - Fix policy IDs to exactly 28 bytes (MintingPolicyHash size) - Limit token names to 0-32 bytes per Cardano ledger spec - Cap random generation to max 10,000 policy/token pairs - Simplify generator architecture by removing complex layered logic - Remove unused helper functions and imports - Apply code quality improvements from HLint suggestions This addresses the unValueData builtin having an extremely high intercept cost (10+ billion) due to benchmarking against Values with millions of entries that would never exist on-chain.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements cost modeling for Value-related builtins:
lookupCoin
,valueContains
,valueData
, andunValueData
.Implementation
Complete cost modeling pipeline:
Cost models:
valueData
: Uses constant cost model based on uniform performance analysislookupCoin
: Linear cost model with dimension reduction for 3+ parametersvalueContains
: Linear cost model for container/contained size dependencyunValueData
: Linear cost model for size-dependent deserializationAll functions now have proper cost models instead of unimplemented placeholders.