stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

feat: static cost analysis

Open brady-stacks opened this issue 4 months ago • 3 comments

Allow measuring static cost statically for contracts.

  • [x] gives min/max execution cost without executing the contracts
  • [x] gives trait call-counts to determine if excessive cost is incurred by trait calls
  • [x] interfaces with clarinet LSP to give codelens functionality in-editor (here)

brady-stacks avatar Nov 20 '25 17:11 brady-stacks

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 20 '25 17:11 CLAassistant

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: tippenein
:x: brady-stacks
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 20 '25 17:11 CLAassistant

Codecov Report

:x: Patch coverage is 63.23296% with 464 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 58.07%. Comparing base (77f1583) to head (5eeafae). :warning: Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
clarity/src/vm/costs/analysis.rs 69.33% 184 Missing :warning:
clarity/src/vm/ast/static_cost/mod.rs 41.73% 134 Missing :warning:
clarity/src/vm/tests/analysis.rs 49.36% 80 Missing :warning:
clarity/src/vm/ast/static_cost/trait_counter.rs 75.91% 66 Missing :warning:

:x: Your project check has failed because the head coverage (58.07%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

:exclamation: There is a different number of reports uploaded between BASE (77f1583) and HEAD (5eeafae). Click for more details.

HEAD has 72 uploads less than BASE
Flag BASE (77f1583) HEAD (5eeafae)
120 48
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #6704       +/-   ##
============================================
- Coverage    75.65%   58.07%   -17.59%     
============================================
  Files          577      581        +4     
  Lines       357690   358952     +1262     
============================================
- Hits        270624   208446    -62178     
- Misses       87066   150506    +63440     
Files with missing lines Coverage Δ
clarity/src/vm/ast/mod.rs 41.20% <ø> (-28.15%) :arrow_down:
clarity/src/vm/costs/mod.rs 76.02% <ø> (-7.29%) :arrow_down:
clarity/src/vm/tests/mod.rs 51.68% <ø> (ø)
clarity/src/vm/ast/static_cost/trait_counter.rs 75.91% <75.91%> (ø)
clarity/src/vm/tests/analysis.rs 49.36% <49.36%> (ø)
clarity/src/vm/ast/static_cost/mod.rs 41.73% <41.73%> (ø)
clarity/src/vm/costs/analysis.rs 69.33% <69.33%> (ø)

... and 403 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 77f1583...5eeafae. Read the comment docs.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Nov 25 '25 20:11 codecov[bot]