Skip to content

Skip validating witness operands to fix tests in debug build #7009

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gtong-nv
Copy link
Contributor

@gtong-nv gtong-nv commented May 6, 2025

Fixes #6933

@gtong-nv gtong-nv requested a review from a team as a code owner May 6, 2025 05:13
@csyonghe
Copy link
Collaborator

csyonghe commented May 6, 2025

What’s the rationale for disabling validation in witness tables?

@gtong-nv gtong-nv marked this pull request as draft May 6, 2025 05:50
@gtong-nv
Copy link
Contributor Author

gtong-nv commented May 6, 2025

What’s the rationale for disabling validation in witness tables?

Sorry, this is not meant to be the final solution, but I'd like to test out if there are other failed tests in CI, because this is the only failed test I can reproduce locally.
For this change, I'm not familair how the witness table works, but I saw errors
internal error 40007: IR validation failed: def must come before use in same block in autodiff tests such as dynamic-dispatch-custom-bwd-derivative.slang, which is caused by
https://github.com/shader-slang/slang/blob/master/source/slang/slang-ir-validate.cpp#L180, when the operandValue in not in the seenInsts

I'm not sure if this is expected, as it seems working fine depiste of this validation error?

@csyonghe
Copy link
Collaborator

csyonghe commented May 6, 2025

IR validation errors like this is usually due to some other code breaking the assumption.

Our IR is designed around the assumption that an operand should be defined in a place that this visible to the inst, that means the operand itself needs to be either a global Inst, or defined in some parent of the inst, or in a basic block that dominates the current Inst.

The only exception we allow is when the Inst is a decoration. If we need to add other exceptions, we need to understand why first. Usually breaking this assumption means there is a bug.

This is similar to fixing other test failures: we usually don't fix test failures by deleting the test, unless we are certain that the test is obsolete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable debug testing on linux and fix issues.
2 participants