Repository navigation
clr: Fix packet batch write logic - #2236
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a race condition in packet batch write logic where the CP fetcher could read malformed packets. The fix ensures all packet headers are invalidated before writing packet bodies, then validates headers in a specific order to prevent the fetcher from accessing incomplete packets.
- All packets in a batch now have their headers invalidated before copying to the queue (previously only the first packet)
- Headers are validated in two stages: inner packets (indices 1 to N-1) first, then the first packet header last to trigger batch execution
- System scope modifications are now applied to saved header copies rather than modifying packet objects directly
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
saleelk
force-pushed
the
users/saleelk/bulkpackets
branch
from
December 9, 2025 13:29
be73f22 to
11cdb20
Compare
* When writing bulk packets always invalidate packet headers, Its possible that the CP fetcher can have multiple packets in flight. In such cases we may end up with a malformed packet because the writes are not complete yet CP finds a valid header.
saleelk
force-pushed
the
users/saleelk/bulkpackets
branch
from
December 9, 2025 17:20
11cdb20 to
778f623
Compare
gandryey
approved these changes
Dec 9, 2025
systems-assistant Bot
pushed a commit
to ROCm/clr
that referenced
this pull request
Dec 11, 2025
* When writing bulk packets always invalidate packet headers, Its possible that the CP fetcher can have multiple packets in flight. In such cases we may end up with a malformed packet because the writes are not complete yet CP finds a valid header. [rocm-systems] ROCm/rocm-systems#2236 (commit 1063548)
xuchen-amd
pushed a commit
that referenced
this pull request
Dec 16, 2025
* When writing bulk packets always invalidate packet headers, Its possible that the CP fetcher can have multiple packets in flight. In such cases we may end up with a malformed packet because the writes are not complete yet CP finds a valid header.
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.
Motivation
Technical Details
JIRA ID
Test Plan
Test Result
Submission Checklist