Skip to content

Add patches/README.md and CODEOWNERs for patches/ - #2517

Merged
ScottTodd merged 7 commits into
ROCm:mainfrom
ScottTodd:patches-codeowners-readme
Dec 11, 2025
Merged

ScottTodd merged 7 commits into
ROCm:mainfrom
ScottTodd:patches-codeowners-readme

Conversation

@ScottTodd

Copy link
Copy Markdown
Member

We're getting close to 0 patches across the ROCm projects but we've still had several disruptive patches land recently.

I want to keep a closer eye on changes to the patches subdirectory and put some guidelines in place for how the team should be thinking about them.

Some highlights from the doc:

  • Documenting how fetch_sources.py applies existing patches
  • Documenting how save_patches.sh saves new patches
  • Documenting how rocm-libraries and rocm-systems consume patches, resolve/remove patches, and can have their development blocked by patches not applying
  • A "Rules for creating patches" section that emphasizes that problematic commits should be reverted directly upstream and not patched - open source CI/CD takes priority over closed source CI/CD in open source code

ScottTodd and others added 6 commits December 10, 2025 15:24
Expand the "Working with patches" section to explain:
- How fetch_sources.py applies patches by default (--apply-patches and
  --patch-tag amd-mainline)
- How to use save_patches.sh to generate patch files from commits
- Technical details about .smrev files and git skip-worktree

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Explain how external repositories (rocm-libraries, rocm-systems) use
TheRock's patches in their CI workflows:
- The typical CI pattern of checking out TheRock and applying patches
- Example workflow snippet from rocm-libraries
- Links to actual workflow files
- Explanation of the safety valve for handling patch conflicts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…tion

- Show more complete workflow example with numbered steps
- Add new section on resolving patch conflicts
- Clarify when patches can be deleted vs when they block development
- Reword typical workflow description for clarity

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Expand the incomplete section with comprehensive guidelines:
- When patches are acceptable vs when they should NOT be used
- Commit message requirements with good/bad examples
- Patch lifecycle and maintenance responsibilities
- Preference for upstream fixes over patches

Emphasizes that patches are strongly discouraged and should be
temporary with a plan for removal.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Move "Prefer upstream fixes" to top for emphasis
- Simplify acceptable use cases for patches
- Remove redundant examples and lifecycle subsection
- Clarify that patches must be on path to upstream acceptance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

@geomin12 geomin12 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

great guide! some nits

Comment thread patches/README.md
./build_tools/save_patches.sh <base_tag> <project_name> <patch_subdir>

# Example: Save commits to hipBLASLt since the m/amd-mainline tag
./build_tools/save_patches.sh m/amd-mainline hipBLASLt amd-mainline

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is that m/ supposed to be there?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copied from the example in the script itself:

# Usage: save_patches.sh base_tag project_name patch_subdir
#
# Example:
# save_patches.sh m/amd-mainline hipBLASLt amd-mainline

We've had a long standing TODO there to pull the base commit from git submodule status or equivalent so that argument isn't needed. I often just manually look up what commit I want to stack patches on top of.

Comment thread patches/README.md Resolved
Comment thread patches/README.md Resolved
Comment thread patches/README.md Resolved
@jayhawk-commits

Copy link
Copy Markdown
Contributor

I will take a look tomorrow as it is already 8pm here.

Comment thread .github/CODEOWNERS Outdated
/rocm-systems/ @ROCm/TheRockInfra

# New patches are strongly discouraged. See patches/README.md.
/patches/ @ScottTodd

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't we be adding more eyes to this than just yourself. at least start with shadowing reviews and eventually ramp up?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Volunteers are welcome :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

To add some color here:

@amd-shiraz

Copy link
Copy Markdown
Contributor

@ScottTodd overall lgtm intention wise, i would love to understand later few things from the current workflow of system/libraries patches, who owns fixing conflicts if they don't own the patch etc. i will sync with you and others later on that. otherwise just some nit.

Comment thread patches/README.md Resolved

@marbre marbre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just minor nits + volunteering me as an additional codeowner.

Comment thread .github/CODEOWNERS Resolved
Comment thread patches/README.md Resolved
Comment thread patches/README.md Resolved
Co-authored-by: Marius Brehler <marius.brehler@gmail.com>
@ScottTodd ScottTodd changed the title Add patches/README.md and add myself as a CODEOWNER Add patches/README.md and CODEOWNERs for patches/ Dec 11, 2025
@ScottTodd
ScottTodd merged commit 9ac37c9 into ROCm:main Dec 11, 2025
9 checks passed
@ScottTodd
ScottTodd deleted the patches-codeowners-readme branch December 11, 2025 18:08
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Dec 11, 2025
rponnuru5 pushed a commit that referenced this pull request Dec 12, 2025
We're getting close to 0 patches across the ROCm projects but we've
still had several disruptive patches land recently.

I want to keep a closer eye on changes to the patches subdirectory and
put some guidelines in place for how the team should be thinking about
them.

Some highlights from the doc:

* Documenting how `fetch_sources.py` applies existing patches
* Documenting how `save_patches.sh` saves new patches
* Documenting how rocm-libraries and rocm-systems consume patches,
resolve/remove patches, and can have their development blocked by
patches not applying
* A "Rules for creating patches" section that emphasizes that
problematic commits should be reverted directly upstream and not patched
- open source CI/CD takes priority over closed source CI/CD in open
source code

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Marius Brehler <marius.brehler@gmail.com>
subodh-dubey-amd pushed a commit that referenced this pull request Dec 15, 2025
We're getting close to 0 patches across the ROCm projects but we've
still had several disruptive patches land recently.

I want to keep a closer eye on changes to the patches subdirectory and
put some guidelines in place for how the team should be thinking about
them.

Some highlights from the doc:

* Documenting how `fetch_sources.py` applies existing patches
* Documenting how `save_patches.sh` saves new patches
* Documenting how rocm-libraries and rocm-systems consume patches,
resolve/remove patches, and can have their development blocked by
patches not applying
* A "Rules for creating patches" section that emphasizes that
problematic commits should be reverted directly upstream and not patched
- open source CI/CD takes priority over closed source CI/CD in open
source code

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Marius Brehler <marius.brehler@gmail.com>
benrichard-amd pushed a commit to benrichard-amd/TheRock that referenced this pull request Jan 5, 2026
We're getting close to 0 patches across the ROCm projects but we've
still had several disruptive patches land recently.

I want to keep a closer eye on changes to the patches subdirectory and
put some guidelines in place for how the team should be thinking about
them.

Some highlights from the doc:

* Documenting how `fetch_sources.py` applies existing patches
* Documenting how `save_patches.sh` saves new patches
* Documenting how rocm-libraries and rocm-systems consume patches,
resolve/remove patches, and can have their development blocked by
patches not applying
* A "Rules for creating patches" section that emphasizes that
problematic commits should be reverted directly upstream and not patched
- open source CI/CD takes priority over closed source CI/CD in open
source code

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Marius Brehler <marius.brehler@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants