-
Notifications
You must be signed in to change notification settings - Fork 795
[SYCL] Add ABI symbols tests against release branch #19860
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
Conversation
Before this PR our approach was to have `sycl_symbols_[linux|windows]-sycl.dump` files in trunk that always capture the current state of symbols exported from `libsycl.so`/`sycl.dll` We highlighted added/removed symbols separately and considered "added" symbols as being OK while "removed" meant an ABI break. That works fine by is a bit too verbose. Also, not all "removed" are bad. If we've just added a symbol in a previous commit and are reverting it now, the backward ABI compatibility against the last release isn't being broken. I don't think we promise any backward compatibility between arbitrary builds in the trunk (`origin/sycl`), only the compatibility against previous official minor releases with the same major version. This PR adds two more tests that track what we promise better. I've modified our `sycl/tools/abi_check.py` to allow ignoring "added" symbols and only check against symbols that are being removed. I've also copied `sycl_symbols*.dump` from the `sycl-rel-6_3` branch into the trunk under `sycl_symbols*-sycl-rel-6_3.dump` names and started running the testing for them in that new mode. Those **must** never fail, unless we're incrementing the major version or the break is intentional and approved (hence dedicated `CODEOWNERS` who can approve such changes). I'm also adding a step to the `sycl-nightly.yml` workflow to ensure that those copies in trunk match the release branch. That would be handy if we were to cherry-pick some changes that add new symbols to the ongoing release.
0a4001f to
38547e5
Compare
| check_abi_symbols: | ||
| name: Check ABI symbols tests match release branch | ||
| runs-on: [Linux, build] | ||
| if: github.repository == 'intel/llvm' | ||
| container: ghcr.io/intel/llvm/ubuntu2404_build | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| sparse-checkout: | | ||
| sycl/test/abi | ||
| - run: | | ||
| git fetch origin sycl-rel-6_3 | ||
| git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_linux.dump sycl/test/abi/sycl_symbols_linux-sycl-rel-6_3.dump | ||
| git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_windows.dump sycl/test/abi/sycl_symbols_windows-sycl-rel-6_3.dump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified pass in https://github.com/intel/llvm/actions/runs/17161188384/job/48690624194
Verified "expected/intentional" fail in https://github.com/intel/llvm/actions/runs/17161006785
|
Technically, we could remove old "trunk" tests and only use the new ones and reduce the noise. I'm not doing it here for the following reasons:
|
.github/workflows/sycl-nightly.yml
Outdated
| git fetch origin sycl-rel-6_3 | ||
| git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_linux.dump sycl/test/abi/sycl_symbols_linux-sycl-rel-6_3.dump | ||
| git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_windows.dump sycl/test/abi/sycl_symbols_windows-sycl-rel-6_3.dump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Instead of hardcoding the release version (6.3), can we like have a variable: Something like:
LAST_SYCL_REL_VER="6_3"
git fetch origin sycl-rel-$LAST_SYCL_REL_VER
git diff --exit-code -I "^# RUN" origin/sycl-rel-$LAST_SYCL_REL_VER:sycl/test/abi/sycl_symbols_linux.dump sycl/test/abi/sycl_symbols_linux-sycl-rel-$LAST_SYCL_REL_VER.dump
git diff --exit-code -I "^# RUN" origin/sycl-rel-$LAST_SYCL_REL_VER:sycl/test/abi/sycl_symbols_windows.dump sycl/test/abi/sycl_symbols_windows-sycl-rel-$LAST_SYCL_REL_VER.dump
It would make it easier to update the release version for future releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to leave it to the next update. Not exactly sure how it's going to look like. The code-duplication is isolated, and we can remove it if it starts to grow.
uditagarwal97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I think that strictly speaking, we do. Otherwise we wouldn't have ABI-breaking windows which are only 3-4 weeks long and would allow breaking ABI during a whole period between latest non-ABI-breaking release X and the upcoming ABI-breaking release X+1 |
Historically, we've allowed breaks within a short window of the corresponding symbols being introduced, but it is a little bit of a gray area. |
What if we need to roll back some commit that introduces a new ABI? |
That is what @steffenlarsen has been referring to as "gray area". I guess the question here is how short the window for a "hotfix" is. For example, if it all happened within a day, then likely absolutely no one has seen it. If it happened within a few days, then it may already disrupt someone's workflow. For the record: I'm not trying to say that we shouldn't do "hotfix" ABI-breaks (like reverting accidentally added exported symbol or something) if that is done quickly. But I still do think that we care about preserving ABI between arbitrary builds in the trunk ( |
Those windows are about breaking ABI compatibility with the latest official release though, so I'm not sure how applicable that is.
Why? How would it be different for the user if the "break" is because something from yesterday is being reverted/"broken" vs something from a few weeks ago? |
Before this PR our approach was to have
sycl_symbols_[linux|windows]-sycl.dumpfiles in trunk that always capture the current state of symbols exported fromlibsycl.so/sycl.dllWe highlighted added/removed symbols separately and considered "added" symbols as being OK while "removed" meant an ABI break. That works fine by is a bit too verbose. Also, not all "removed" are bad. If we've just added a symbol in a previous commit and are reverting it now, the backward ABI compatibility against the last release isn't being broken.I don't think we promise any backward compatibility between arbitrary builds in the trunk (
origin/sycl), only the compatibility against previous official minor releases with the same major version.This PR adds two more tests that track what we promise better. I've modified our
sycl/tools/abi_check.pyto allow ignoring "added" symbols and only check against symbols that are being removed. I've also copiedsycl_symbols*.dumpfrom thesycl-rel-6_3branch into the trunk undersycl_symbols*-sycl-rel-6_3.dumpnames and started running the testing for them in that new mode. Those must never fail, unless we're incrementing the major version or the break is intentional and approved (hence dedicatedCODEOWNERSwho can approve such changes).I'm also adding a step to the
sycl-nightly.ymlworkflow to ensure that those copies in trunk match the release branch. That would be handy if we were to cherry-pick some changes that add new symbols to the ongoing release.