The 5 (out of 7) new tests that are added in this patch that were already working without the fixes are example1_test, example2_test, check_commutative_non_lowest_level_block_argument, check_commutative_small_similar_ancestor_tree, and check_commutative_equal_ancestor_traversal_different_size. Every new test you add with a proposed fix should be failing before the fix. That is the only way it demonstrates the existence of a fix.
! In D157528#4608458, @amandatang wrote:
When coming up with test cases, I was also considering coverage and other edge cases that would be nice to have checks for in case more changes are made in the future. That's why some of them do already work correctly without changes. I can add these in another separate patch following the 4 for these bug fixes.
Yes, this is orthogonal work and should be done in a completely different patch, thanks. Although I don't believe example1_test and example2_test add any new test coverage. I haven't looked at the other 3 tests in detail. Will do that once your patches are broken into multiple patches, as discussed.
Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Aug 25 2023
Aug 24 2023
Aug 23 2023
Bug 2 and bug 3 are related. When the visitedAncestor check in line 152 is removed, it causes block arguments to not be added to the ancestorQueue. Originally, block arguments are only added because nullptr is not in the visitedAncestor set, so either way, the logic is not sound despite being functional. There could also be additional block argument cast and check to make this more safe.
Aug 22 2023
@srishti-pm In terms of separating the bug fixes into their own patches and having test cases that illustrate each bug fix, it's very difficult to write tests for each bug fix in isolation when all 4 are present at the same time in the original code. The examples I provided in the summary each assume everything else is correct. Some of the bug fixes, when moved to their own commit, also caused existing and previously correct test cases to fail.
Thank you for working on this. There are a few issues here. Listing them below:-
- There are 7 new tests added in this patch. 5 of them work correctly without any bug fixes from your patch. Thus, all 5 of them should be removed/modified because they do not reflect the changes done in this patch. You should only add those tests that reflect the functional changes done in this patch. Upon looking closer into them, it seemed that some of them were directly pointing to a specific bug fix (for example @check_commutative_non_lowest_level_block_argument) but those tests were already working correctly before the fix.
- There are 4 bug fixes being offered by this patch. Each of them warrants a separate commit of its own for better readability and ease of review and because they are all orthogonal to each other but fix the same utility. Please create one commit (and thus one patch) for each of the 4 fixes. The first fix can be done here and thus only 3 more commits are needed to be created for the 3 other fixes. Each commit will showcase test(s) that illustrate that specific bug fix. Further, since you are also doing cleanup, feel free to perform cleanup in any subset of these 4 commits.
- Regarding bug 1: No need to explain what an ancestor key entry is and how it is compared. This detail is a black box with respect to this bug and is thus an unnecessary detail to add here. Thus, remove these lines: Each ancestor key entry consists of a type (block_argument, non_constant_op and constant_op in increasing order) and an op name if it is an op (empty for block arguments). An ancestor key entry is smaller if its type is smaller or if it has a smaller op name lexicographically.
- Regarding bug 2: You mention: To fix this, visitedAncestors and its corresponding checks are removed completely. I think some explanation is needed on how the utility works with them removed and whether you have done something else to potentially do what they were doing, but now, correctly. A BFS requires some way to keep track of the visited nodes of the tree.
Aug 21 2023
Aug 18 2023
Aug 16 2023
Use strict weak ordering in the operand comparison method
Aug 15 2023
Aug 14 2023
@srishti-pm Let me know if these two examples make sense
Aug 10 2023
Aug 9 2023
Can you make the summary precise? It's a bit long-winded and the bugs aren't clear from the summary. If you can explain a bug in one line or with a small example, it will be great. You don't need to explain the older functionality in detail.
Jul 20 2023
Jul 19 2023
Jul 18 2023
Here's a patch that fixes the issue: https://reviews.llvm.org/D155637
This broke the bot, can you fix or revert?+ /vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/bin/FileCheck /vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/test/python/dialects/shape.py error: missing shape attribute Traceback (most recent call last): File "/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/test/python/dialects/shape.py", line 17, in <module> def testConstShape(): File "/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/test/python/dialects/shape.py", line 11, in run f() File "/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/test/python/dialects/shape.py", line 26, in testConstShape def const_shape_tensor(arg): File "/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/tools/mlir/python_packages/mlir_core/mlir/dialects/_func_ops_ext.py", line 190, in decorator return_values = f(*func_args, **func_kwargs) File "/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/test/python/dialects/shape.py", line 30, in const_shape_tensor x = shape.ConstShapeOp([1, 2]) File "/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/tools/mlir/python_packages/mlir_core/mlir/dialects/_shape_ops_gen.py", line 278, in __init__ results = _ods_ir.InferTypeOpInterface(ConstShapeOp).inferReturnTypes( ValueError: Failed to infer result types
Jul 17 2023
Jul 14 2023
Use function overloading
Use function overloading
Jul 13 2023
Jul 12 2023
Jul 11 2023
Address final comments
Jul 10 2023
Jul 7 2023
Jul 6 2023
Jun 13 2023
Pull new changes and fix build failure
Jun 5 2023
Use one getGetterName method and logic to handle attributes beginning with has
Jun 1 2023
Reverted changes for AttrName getters and fixed tests
May 31 2023
One thing that's kind of popped up while reading the review is that this going to skew towards attributes with certain naming schemes, which needs to be documented. This is a bit because I feel that 'is' doesn't read well for a number of different cases.