-
Notifications
You must be signed in to change notification settings - Fork 59
Update LLVM version, 2025 Q4 #2122
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
Merged
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
df0c822
Update LLVM version
rniczh e7d2a5b
Update .dep-versions
rniczh b1082d0
Fix formatting
rniczh 9e8e1f2
Merge branch 'main' into rniczh/update-llvm-version-20251009
rniczh c06245b
mock register_traceback_file_exclusion
rniczh 28ba2da
Merge branch 'main' into rniczh/update-llvm-version-20251009
rniczh 4024075
fix formatting
rniczh 496fc73
fix formatting
rniczh 3fb8611
fix pylint
rniczh 0e1543c
fix pylint
rniczh 0795360
merge from upstream
rniczh 87b7de2
update commit hash
rniczh 61cc8b4
fix coverage
rniczh 5fc49be
revert
rniczh 21b9097
fix coverage
rniczh 45b3f9d
fix pylint
rniczh 3d07aac
patch ods_cext with patcher
rniczh 11aee12
move the patch to jax_primitives.py
rniczh 096d7a2
fix formatting
rniczh f9f7763
fix formatting
rniczh 875ef7c
Merge branch 'main' into rniczh/update-llvm-version-20251009
rniczh 73d8713
remove redundant
rniczh 6b518df
Update frontend/catalyst/jax_primitives.py
rniczh cb5df00
resolve conflict
rniczh 0b4591a
Merge branch 'main' into rniczh/update-llvm-version-20251009
rniczh 2ccfbae
try to fix decompose failure
rniczh 028ad0e
fix decomp
rniczh 8add623
fix test
rniczh f4615f3
fix
rniczh 3a71e65
fix
rniczh 0545b4b
fix
rniczh 1a093cb
test
rniczh 22870fa
CI test
rniczh 5e93dbd
fix decomp
rniczh 257a203
fix formatting
rniczh b3c57c6
Merge branch 'main' into rniczh/update-llvm-version-20251009
rniczh 6dafb84
fix
rniczh fd46638
update
rniczh 1b5a08d
Merge branch 'rniczh/update-llvm-version-20251009' of github.com:Penn…
rniczh 82068da
update and trigger compiler to recompile hpp
rniczh 9c9ba77
include decompose impl
rniczh 0f1e68a
update
rniczh 828b9ae
formatting
rniczh cd5aad3
debug CI
rniczh df79232
formatting
rniczh b37de9d
debug on CI
rniczh 0bce06b
fix
rniczh f537360
fix
rniczh 9360e8d
fix
rniczh 232ca6c
fix
rniczh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| # Copyright 2025 Xanadu Quantum Technologies Inc. | ||
|
|
||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
|
|
||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| """Tests for the jax_extras.patches module""" | ||
|
|
||
| from catalyst.jax_extras.patches import mock_attributes | ||
|
|
||
|
|
||
| # pylint: disable=missing-class-docstring,missing-function-docstring | ||
| class TestMockAttributes: | ||
| """Test the mock_attributes function and MockAttributeWrapper class.""" | ||
|
|
||
| def test_mock_attributes_returns_mocked_value(self): | ||
| """Test that accessing a mocked attribute returns the mocked value.""" | ||
|
|
||
| class DummyClass: | ||
| def __init__(self): | ||
| self.original_attr = "original" | ||
|
|
||
| obj = DummyClass() | ||
| mocked = mock_attributes(obj, {"mocked_attr": "mocked_value"}) | ||
|
|
||
| # Access the mocked attribute - this should come from the attrs dict | ||
| assert mocked.mocked_attr == "mocked_value" | ||
|
|
||
| def test_mock_attributes_returns_original_value(self): | ||
| """Test that accessing an unmocked attribute returns the original value.""" | ||
|
|
||
| class DummyClass: | ||
| def __init__(self): | ||
| self.original_attr = "original" | ||
|
|
||
| obj = DummyClass() | ||
| mocked = mock_attributes(obj, {"mocked_attr": "mocked_value"}) | ||
|
|
||
| # Access the original attribute - this should come from the original object | ||
| # This tests the else branch in __getattr__ | ||
| assert mocked.original_attr == "original" | ||
|
|
||
| def test_mock_attributes_with_methods(self): | ||
| """Test that calling original methods works through the wrapper.""" | ||
|
|
||
| class DummyClass: | ||
| def __init__(self): | ||
| self.value = 42 | ||
|
|
||
| def get_value(self): | ||
| return self.value | ||
|
|
||
| obj = DummyClass() | ||
|
|
||
| def mocked_method(): | ||
| return "mocked" | ||
|
|
||
| mocked = mock_attributes(obj, {"mocked_method": mocked_method}) | ||
|
|
||
| # Access the mocked method | ||
| assert mocked.mocked_method() == "mocked" | ||
|
|
||
| # Access the original method - tests the getattr fallback | ||
| assert mocked.get_value() == 42 | ||
|
|
||
| def test_mock_attributes_with_callable(self): | ||
| """Test mocking with callable attributes like lambda functions.""" | ||
|
|
||
| class DummyClass: | ||
| def __init__(self): | ||
| self.original_func = lambda x: x * 2 | ||
|
|
||
| obj = DummyClass() | ||
| mocked = mock_attributes(obj, {"new_func": lambda x: x * 3}) | ||
|
|
||
| # Access the mocked callable | ||
| assert mocked.new_func(5) == 15 | ||
|
|
||
| # Access the original callable - tests the getattr fallback | ||
| assert mocked.original_func(5) == 10 | ||
|
|
||
| def test_mock_attributes_override_existing(self): | ||
| """Test that mocking can override existing attributes.""" | ||
|
|
||
| class DummyClass: | ||
| def __init__(self): | ||
| self.attr = "original" | ||
|
|
||
| obj = DummyClass() | ||
| mocked = mock_attributes(obj, {"attr": "overridden"}) | ||
|
|
||
| # The mocked value should take precedence | ||
| assert mocked.attr == "overridden" | ||
|
|
||
| def test_mock_attributes_stores_original(self): | ||
| """Test that the original object is accessible through the wrapper.""" | ||
|
|
||
| class DummyClass: | ||
| def __init__(self): | ||
| self.value = 100 | ||
|
|
||
| obj = DummyClass() | ||
| mocked = mock_attributes(obj, {}) | ||
|
|
||
| # The wrapper should store the original object | ||
| assert mocked.original is obj | ||
| assert mocked.original.value == 100 |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.