Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ffb2fe10b66b6053346e1a49e667dabaa5cdf99d
      
https://github.com/WebKit/WebKit/commit/ffb2fe10b66b6053346e1a49e667dabaa5cdf99d
  Author: Tadeu Zagallo <[email protected]>
  Date:   2025-06-30 (Mon, 30 Jun 2025)

  Changed paths:
    M Source/WebGPU/WGSL/AST/AST.h
    R Source/WebGPU/WGSL/AST/ASTBitcastExpression.h
    M Source/WebGPU/WGSL/AST/ASTExpression.h
    M Source/WebGPU/WGSL/AST/ASTForward.h
    M Source/WebGPU/WGSL/AST/ASTNode.h
    M Source/WebGPU/WGSL/AST/ASTStatement.h
    R Source/WebGPU/WGSL/AST/ASTStaticAssertStatement.h
    M Source/WebGPU/WGSL/AST/ASTVisitor.cpp
    M Source/WebGPU/WGSL/AST/ASTVisitor.h
    M Source/WebGPU/WGSL/BoundsCheck.cpp
    M Source/WebGPU/WGSL/CMakeLists.txt
    M Source/WebGPU/WGSL/ConstantFunctions.h
    M Source/WebGPU/WGSL/Constraints.cpp
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/TypeCheck.cpp
    M Source/WebGPU/WGSL/TypeStore.cpp
    M Source/WebGPU/WGSL/TypeStore.h
    M Source/WebGPU/WGSL/Types.cpp
    M Source/WebGPU/WGSL/Types.h
    M Source/WebGPU/WGSL/generator/main.rb
    M Source/WebGPU/WGSL/wgslc.cpp
    M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj

  Log Message:
  -----------
  [WGSL] Type checker should exit after encountering the first error
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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to