Skip to content
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

Don't interpret decayed data as we've failed to send tiny values #3368

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

TheBlueMatt
Copy link
Collaborator

When we're calculating the success probability for min-/max-bucket pairs and are looking at the 0th' min-bucket, we only look at the highest max-bucket to decide the success probability. We ignore max-buckets which have a value below BUCKET_FIXED_POINT_ONE to only consider values which aren't substantially decayed.

However, if all of our data is substantially decayed, this filter causes us to conclude that the highest max-bucket is bucket zero even though we really should then be looking at any bucket.

We make this change here, looking at the highest non-zero max-bucket if no max-buckets have a value above
BUCKET_FIXED_POINT_ONE.

This was included in the 0.0.125 release.

When we're calculating the success probability for min-/max-bucket
pairs and are looking at the 0th' min-bucket, we only look at the
highest max-bucket to decide the success probability. We ignore
max-buckets which have a value below `BUCKET_FIXED_POINT_ONE` to
only consider values which aren't substantially decayed.

However, if all of our data is substantially decayed, this filter
causes us to conclude that the highest max-bucket is bucket zero
even though we really should then be looking at any bucket.

We make this change here, looking at the highest non-zero
max-bucket if no max-buckets have a value above
`BUCKET_FIXED_POINT_ONE`.
@TheBlueMatt TheBlueMatt added this to the 0.1 milestone Oct 14, 2024
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.58%. Comparing base (46d8a0d) to head (41a91a3).
Report is 161 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3368      +/-   ##
==========================================
- Coverage   89.61%   89.58%   -0.03%     
==========================================
  Files         127      127              
  Lines      103533   103538       +5     
  Branches   103533   103538       +5     
==========================================
- Hits        92778    92754      -24     
- Misses       8056     8076      +20     
- Partials     2699     2708       +9     

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

Copy link
Contributor

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT

@jkczyz jkczyz self-requested a review November 12, 2024 15:14
Comment on lines +1840 to +1841
let selected_max = highest_max_bucket_with_full_points.unwrap_or(highest_max_bucket_with_points);
let max_bucket_end_pos = BUCKET_START_POS[32 - selected_max] - 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slightly confused, mostly i am missing something.
iiuc, we used to "ignore max-buckets which have a value below BUCKET_FIXED_POINT_ONE"
and we no longer want to do that,
so why not just track max_bucket instead of tracking two max buckets? if they are valid regardless of the value they hold (as long as they're not zero)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're picking the highest max-bucket which has some value to use as the max-bucket for calculation, but we don't really want to be looking at a really high max-bucket if its fairly far decayed and there's some other max-bucket that isn't (as) decayed. We could have some smarter heuristic here for that, of course, but CPU cycles in this code are very expensive so the naive over-under-one is picked.

Copy link
Contributor

@G8XSU G8XSU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@G8XSU G8XSU merged commit 4322b19 into lightningdevkit:main Nov 13, 2024
19 of 21 checks passed
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.

4 participants