Skip to content

Conversation

@harkal
Copy link
Collaborator

@harkal harkal commented Dec 4, 2025

What I did

Add flow-sensitive range analysis and assert pruning

How I did it

How to verify it

Commit message

This commit adds `VariableRangeAnalysis` to track per-block/instruction ValueRange environments
with loop widening, evaluates arithmetic/bitwise/comparison ops and phi merges to tighten bounds 
under branch conditions.

As a minimal usage example for the analysis this commit also implements assert dropping when 
proven nonzero via range info. 

Finally it provides cover for the lattice/optimizer with unit tests.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

wip

wip

wip

more

non zero case

more tests

refactor tests

tests

wip

improve precition

rename ValueInfo to VariableRangeAnalysis and update references

lint

rename

worklist refactor

optimization

Revert "optimization"

This reverts commit 0c1cd77f6f3f1008f655926ddbd4c963c133ae07.

refactor ValueRange

refactor

bytes_range

add comment

fancy

more

asserts

split out assert elimination

move test

lint

widening

rename test file

comments

convert `is_` methods to properties

more comments

udpate sigs

dispatch with dict

lint

split out evaluators

refactor

lint

private

cleanup

redundant check

cleanups

post fix

multi-output update

reduntant

back to TOP BOTTOM
@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 83.75000% with 91 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.04%. Comparing base (ae020c0) to head (6667f02).

Files with missing lines Patch % Lines
vyper/venom/analysis/variable_range/evaluators.py 80.48% 22 Missing and 18 partials ⚠️
vyper/venom/analysis/variable_range/analysis.py 86.23% 13 Missing and 17 partials ⚠️
vyper/venom/analysis/variable_range/value_range.py 82.35% 16 Missing and 2 partials ⚠️
vyper/venom/passes/assert_elimination.py 92.59% 1 Missing and 1 partial ⚠️
vyper/venom/ir_node_to_venom.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4790      +/-   ##
==========================================
- Coverage   93.29%   93.04%   -0.25%     
==========================================
  Files         140      145       +5     
  Lines       20277    20834     +557     
  Branches     3554     3687     +133     
==========================================
+ Hits        18917    19385     +468     
- Misses        912      963      +51     
- Partials      448      486      +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant