-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[WGSL] Type checker should exit after encountering the first error #47246
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
[WGSL] Type checker should exit after encountering the first error #47246
Conversation
EWS run on previous version of this PR (hash e14eaa1) |
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.
✅ but does appear to have a failing WGSL test to fix
e14eaa1
to
ea1841a
Compare
EWS run on current version of this PR (hash ea1841a) |
https://bugs.webkit.org/show_bug.cgi?id=295038 rdar://154408433 Reviewed by Mike Wyrzykowski. In order to reduce the amount of code reachable from incorrect/malicious shaders, the type checker should immediately return after encountering the first error instead of trying to continue and report as many errors as possible at once. NOTE: this breaks many wgslc tests, but those are already broken due to a recent python upgrade and in the process of being migrated to TestWebKitAPI * Source/WebGPU/WGSL/AST/AST.h: * Source/WebGPU/WGSL/AST/ASTBitcastExpression.h: Removed. * Source/WebGPU/WGSL/AST/ASTExpression.h: (isType): * Source/WebGPU/WGSL/AST/ASTForward.h: * Source/WebGPU/WGSL/AST/ASTNode.h: * Source/WebGPU/WGSL/AST/ASTStatement.h: (isType): * Source/WebGPU/WGSL/AST/ASTStaticAssertStatement.h: Removed. * Source/WebGPU/WGSL/AST/ASTVisitor.cpp: (WGSL::AST::Visitor::visit): * Source/WebGPU/WGSL/AST/ASTVisitor.h: * Source/WebGPU/WGSL/BoundsCheck.cpp: (WGSL::BoundsCheckVisitor::visit): * Source/WebGPU/WGSL/CMakeLists.txt: * Source/WebGPU/WGSL/ConstantFunctions.h: (WGSL::zeroValue): * Source/WebGPU/WGSL/Constraints.cpp: (WGSL::concretize): * Source/WebGPU/WGSL/GlobalVariableRewriter.cpp: (WGSL::RewriteGlobalVariables::pack): (WGSL::bindingMemberForGlobal): (WGSL::bindingTypeForType): (WGSL::RewriteGlobalVariables::insertWorkgroupBarrier): (WGSL::RewriteGlobalVariables::storeInitialValue): * Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp: (WGSL::Metal::FunctionDefinitionWriter::visit): (WGSL::Metal::FunctionDefinitionWriter::serializeConstant): * Source/WebGPU/WGSL/TypeCheck.cpp: (WGSL::TypeChecker::TypeChecker): (WGSL::TypeChecker::declareBuiltins): (WGSL::TypeChecker::check): (WGSL::TypeChecker::visit): (WGSL::TypeChecker::visitStatements): (WGSL::TypeChecker::binaryExpression): (WGSL::TypeChecker::bitcast): (WGSL::TypeChecker::validateF16Usage): (WGSL::TypeChecker::visitAttributes): (WGSL::TypeChecker::analyze): (WGSL::TypeChecker::analyzeStatements): (WGSL::TypeChecker::unify): (WGSL::TypeChecker::introduceType): (WGSL::TypeChecker::convertValue): (WGSL::TypeChecker::convertValueImpl): (WGSL::TypeChecker::introduceValue): (WGSL::TypeChecker::introduceFunction): (WGSL::TypeChecker::allocateSimpleConstructor): (WGSL::TypeChecker::allocateTextureStorageConstructor): (WGSL::TypeChecker::texelFormat): (WGSL::TypeChecker::accessMode): (WGSL::TypeChecker::addressSpace): (WGSL::TypeChecker::setConstantValue): (WGSL::TypeChecker::lookupType): Deleted. (WGSL::TypeChecker::vectorFieldAccess): Deleted. (WGSL::TypeChecker::chooseOverload): Deleted. (WGSL::TypeChecker::infer): Deleted. (WGSL::TypeChecker::resolve): Deleted. (WGSL::TypeChecker::isBottom const): Deleted. (WGSL::TypeChecker::typeError): Deleted. * Source/WebGPU/WGSL/TypeStore.cpp: (WGSL::TypeStore::TypeStore): (WGSL::TypeStore::typeConstructorType): * Source/WebGPU/WGSL/TypeStore.h: (WGSL::TypeStore::bottomType const): Deleted. * Source/WebGPU/WGSL/Types.cpp: (WGSL::Type::dump const): (WGSL::Type::maybeSize const): (WGSL::Type::alignment const): (WGSL::Type::isConstructible const): (WGSL::Type::isStorable const): (WGSL::Type::isHostShareable const): (WGSL::Type::hasFixedFootprint const): (WGSL::Type::hasCreationFixedFootprint const): * Source/WebGPU/WGSL/Types.h: * Source/WebGPU/WGSL/generator/main.rb: * Source/WebGPU/WebGPU.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/296795@main
ea1841a
to
ffb2fe1
Compare
Committed 296795@main (ffb2fe1): https://commits.webkit.org/296795@main Reviewed commits have been landed. Closing PR #47246 and removing active labels. |
ffb2fe1
ea1841a