Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 30e039895da8c29af07171f2e838c3344f5c842a
      
https://github.com/WebKit/WebKit/commit/30e039895da8c29af07171f2e838c3344f5c842a
  Author: Tadeu Zagallo <[email protected]>
  Date:   2026-03-09 (Mon, 09 Mar 2026)

  Changed paths:
    M LayoutTests/fast/webgpu/array-length-pointer-parameter-expected.txt
    M LayoutTests/fast/webgpu/array-length-pointer-parameter.html
    A LayoutTests/fast/webgpu/nocrash/fuzz-309316-expected.txt
    A LayoutTests/fast/webgpu/nocrash/fuzz-309316.html
    M 
LayoutTests/http/tests/webgpu/webgpu/shader/validation/functions/alias_analysis-expected.txt
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebGPU/WGSL/AST/ASTIdentityExpression.h
    A Source/WebGPU/WGSL/AliasAnalysis.cpp
    A Source/WebGPU/WGSL/AliasAnalysis.h
    M Source/WebGPU/WGSL/BoundsCheck.cpp
    M Source/WebGPU/WGSL/WGSL.cpp
    M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WGSL/shaders/array-length-pointer2.wgsl

  Log Message:
  -----------
  Re-land "[WGSL] webgpu:shader,validation,functions,alias_analysis:* is 
failing"
https://bugs.webkit.org/show_bug.cgi?id=309316
rdar://171856049

Reviewed by Mike Wyrzykowski.

The original change landed in 308067@main, and while the actual AliasAnalysis 
pass
appears to be correct, it caused an issue: alias analysis must run after pointer
rewriting, and bounds checking (previously) assumed that it had to run before 
pointer
rewriting. To satisfy the alias analysis constraint I moved pointer rewriting 
earlier
in the pipeline, but that caused certain AST nodes to be visited multiple times 
during
bounds checking, since pointer rewriting can alias nodes. To fix I simply kept 
track
of which nodes bounds checking had already visited and avoided visiting any 
nodes twice.

Test: Tools/TestWebKitAPI/Tests/WGSL/shaders/array-length-pointer2.wgsl
* LayoutTests/fast/webgpu/array-length-pointer-parameter-expected.txt:
* LayoutTests/fast/webgpu/array-length-pointer-parameter.html:
* 
LayoutTests/http/tests/webgpu/webgpu/shader/validation/functions/alias_analysis-expected.txt:
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebGPU/WGSL/AST/ASTIdentityExpression.h:
* Source/WebGPU/WGSL/AliasAnalysis.cpp: Added.
(WGSL::MemoryLocation::MemoryLocation):
(WGSL::MemoryLocation::parameter):
(WGSL::MemoryLocation::global):
(WGSL::MemoryLocation::local):
(WGSL::MemoryLocation::kind const):
(WGSL::MemoryLocation::id const):
(WGSL::MemoryLocation::isParameter const):
(WGSL::MemoryLocation::isGlobal const):
(WGSL::MemoryLocation::operator== const):
(WGSL::MemoryLocation::dump const):
(WGSL::MemoryLocation::hashTableDeletedValue):
(WTF::StringTypeAdapter<WGSL::MemoryLocation>::StringTypeAdapter):
(WTF::StringTypeAdapter<WGSL::MemoryLocation>::length const):
(WTF::StringTypeAdapter<WGSL::MemoryLocation>::is8Bit const):
(WTF::StringTypeAdapter<WGSL::MemoryLocation>::writeTo const):
(WGSL::add):
(WGSL::MemoryLocationHashTraits::emptyValue):
(WGSL::MemoryLocationHashTraits::constructDeletedValue):
(WGSL::MemoryLocationHashTraits::isDeletedValue):
(WGSL::FunctionInfo::FunctionInfo):
(WGSL::AliasAnalysis::AliasAnalysis):
(WGSL::AliasAnalysis::run):
(WGSL::AliasAnalysis::visit):
(WGSL::AliasAnalysis::getRootIdentifier const):
(WGSL::AliasAnalysis::read):
(WGSL::AliasAnalysis::write):
(WGSL::aliasAnalysis):
* Source/WebGPU/WGSL/AliasAnalysis.h: Added.
* Source/WebGPU/WGSL/WGSL.cpp:
(WGSL::staticCheck):
(WGSL::prepareImpl):
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WGSL/shaders/array-length-pointer2.wgsl:

Canonical link: https://commits.webkit.org/308919@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to