- Notifications
You must be signed in to change notification settings - Fork 803
[Diagnostics] Improve recursion diagnostics, specifically for library shaders #5858
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
[Diagnostics] Improve recursion diagnostics, specifically for library shaders #5858
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
45388fb to 006e78e Compare This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
| The new "CheckReachability" function is unused, but was helpful during iteration, and satisfies the description of the CallGraphWithRecurseGuard class. The class advertised that checking for reachability efficiently was one feature that was provided, but there isn't a function to do that explicitly, so I figured I'd add the function here. |
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.
Looks like the right direction! I think too much effort was made to keep the patch constant function special in the output. I think eliminating that requirement will simplify a lot.
tools/clang/test/HLSLFileCheck/hlsl/functions/recursion/patch_constant_func_recursion.hlsl Show resolved Hide resolved
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.
Merp. I concur with the comments that Chris made that I've thumbed. I have some pushback on at least one, I'm not prepared to approve just yet if only because I think Chris had some good points.
Thanks for the responses to my earlier comments!
| ✅ With the latest revision this PR passed the C/C++ code formatter. |
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 had one small comment, but otherwise this looks good.
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 think some of Chris's comments still need addressing, but I'm satisfied with what's here
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 just noticed that a lot of the end-to-end filecheck tests seem like they could be SemaHLSL verifier tests. Did you consider that?
Previously, there would be no recursion validation performed on any function declarations in library shaders. This PR adds code that validates that no function declarations that are found inside library shaders are recursive. The diagnostics aren't repeated, since there's logic to prevent the same diagnostic from being emitted by 2 similar ancestors of the same recursive function. The PR also adjusts recursion detection for shaders in non-library cases, and improves the original diagnostic by adding information about the name of the function that is recursive. The PR is meant to complete the work on issue #5789. However, more work needs to be done for full accuracy.
The PR checks all function declarations in the translation unit for the library shader case, when it should really only be checking a subset of function declarations. This issue is filed here: #5857
Fixes #5789