Repository navigation
Conversation
DerivativeBounds only handled a Mul whose other operand was constant and a Div by a constant. Use constant_integer_bounds on a var-independent factor or denominator so that e.g. x / max(k, 1) is recognized as monotonic increasing. This lets sliding window slide over such footprints. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9664 +/- ##
==========================================
- Coverage 73.01% 72.97% -0.04%
==========================================
Files 266 266
Lines 83355 83374 +19
Branches 20474 20480 +6
==========================================
- Hits 60858 60840 -18
- Misses 16152 16153 +1
- Partials 6345 6381 +36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alexreinking
approved these changes
Nov 5, 2026
This branch has not been deployed
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
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.
Copilot says (description written by GitHub Copilot on behalf of @abadams):
is_monotonic'sDerivativeBoundsonly handled aMulwhere one operand is a constant, and aDivby a constant. Anything symbolic, likex / max(k, 1)with aParam k, fell back to "unknown", so sliding window and storage folding gave up on it.This PR generalizes both cases:
constant_integer_boundsof the independent operand.constant_integer_boundsproves it's strictly positive or strictly negative, the quotient moves the same way as the numerator (or the opposite way for a negative denominator), and by at most as much. Rounding matches the existing constant-denominator case: floor for the min, ceil for the max. Both bounds are clamped to include 0, because a step in the numerator can leave the quotient unchanged.This is a precision improvement, not a miscompile fix. It lets sliding window slide over footprints like
f(x / max(k, 1)). In the newsliding_windowtest,fis computed 35 times instead of 200.is_monotonicgets new check cases.Found while fuzzing the sliding-window rewrite stack (#9648); split out because it applies to main independently.
Checklist