fix(install): serialize cusum threshold crossing via cas#554
Draft
imjustprism wants to merge 2 commits intoendevco:mainfrom
Draft
fix(install): serialize cusum threshold crossing via cas#554imjustprism wants to merge 2 commits intoendevco:mainfrom
imjustprism wants to merge 2 commits intoendevco:mainfrom
Conversation
Greptile SummaryThis PR replaces the
Confidence Score: 5/5The change is a well-scoped concurrency fix with no new data paths, no schema changes, and symmetric treatment of both accumulator arms. The CAS loop correctly serializes threshold crossings, the No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fixes" | Re-trigger Greptile |
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.
Fixed
RegimeDetector::recordrace where two threads near the threshold both fireRisingfor one regime changeWhy
old path:
thread A and thread B both observe their post-add pos >= threshold (B's add happens after A's, so B sees an even larger sum). both reset to 0. both return
Rising. limiter applies 0.7x shrink twice (~0.49x) for one regime change. floor bounds damage but throughput recovery slows.Changed
CAS-guarded threshold crossing. only the thread that successfully transitions the over-threshold value to 0 returns
Rising. racers see 0 on retry, treat their delta as a fresh accumulation against the cleared sum.mirror logic on the
Falling(neg) path.Verified
bats not run (windows host lacks flock). CI bats covers it.
Need help on this PR? Tag
@codesmithwith what you need.