<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>275010</bug_id>
          
          <creation_ts>2024-05-31 18:04:29 -0700</creation_ts>
          <short_desc>[WGSL] api,operation,compute_pipeline,overrides:computed:* does not pass</short_desc>
          <delta_ts>2026-02-25 14:05:42 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebGPU</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mike Wyrzykowski">mwyrzykowski</reporter>
          <assigned_to name="Tadeu Zagallo">tzagallo</assigned_to>
          <cc>douglas.lilliequist</cc>
    
    <cc>mwyrzykowski</cc>
    
    <cc>tzagallo</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2039208</commentid>
    <comment_count>0</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2024-05-31 18:04:29 -0700</bug_when>
    <thetext>This test was added two days ago to the CTS. It triggers a RELEASE_ASSERT(is&lt;Target&gt;(source)); in downcast

https://gpuweb.github.io/cts/standalone/?q=webgpu:api,operation,compute_pipeline,overrides:computed:*

WGSL source is this:

      override c0: f32 = 0.;
      override c1: f32 = 0.;
      override c2: f32 = c0 * c1;

      struct Buf {
          data : array&lt;u32, 3&gt;,
      }

      @group(0) @binding(0) var&lt;storage, read_write&gt; buf : Buf;

      @compute @workgroup_size(1) fn main() {
          buf.data[0] = u32(c0);
          buf.data[1] = u32(c1);
          buf.data[2] = u32(c2);
      }

Backtrace:
(lldb) bt

    frame #0: 0x000000010a924d54 WebGPU`WTFCrashWithInfo(line=96, file=&quot;/Volumes/Data/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/TypeCasts.h&quot;, function=&quot;match_constness_t&lt;Source, Target&gt; &amp;WTF::downcast(Source &amp;) [Target = const WGSL::AST::IdentifierExpression, Source = const WGSL::AST::Expression]&quot;, counter=2) at Assertions.h:818:5
    frame #1: 0x000000010ad5a988 WebGPU`_ZN3WTF8downcastIKN4WGSL3AST20IdentifierExpressionEKNS2_10ExpressionEEERNSt3__111conditionalIXsr3stdE10is_const_vIT0_EENS7_9add_constIT_E4typeEu14__remove_constISB_EE4typeERS9_(source=0x000000015e060408) at TypeCasts.h:96:5
  * frame #2: 0x000000010ad5a76c WebGPU`WGSL::evaluate(expression=0x000000015e060408, constants=0x000000016e7b9b48) at WGSL.cpp:149:40
    frame #3: 0x000000010a9d1710 WebGPU`_ZN6WebGPU13createLibraryEPU19objcproto9MTLDevice11objc_objectRKNS_12ShaderModuleEPNS_14PipelineLayoutERKN3WTF6StringEP8NSStringjPK17WGPUConstantEntryRNS7_7HashMapIjNSG_IjyNS7_11DefaultHashIjEENS7_29UnsignedWithZeroKeyHashTraitsIjEENS7_10HashTraitsIyEENS7_15HashTableTraitsEEESI_SK_NSL_ISO_EESN_EEPU15__autoreleasingP7NSError(device=0x0000000112d1ffd0, shaderModule=0x00000001060ec4e0, pipelineLayout=0x00000001060bc0e0, untransformedEntryPoint=0x000000016e7b9f38, label=&quot;&quot;, constantCount=2, constants=0x0000000106088720, mininumBufferSizes=0x000000016e7b9f08, error=0x000000016e7b9e70) at Pipeline.mm:75:30
    frame #4: 0x000000010a99fd6c WebGPU`WebGPU::Device::createComputePipeline(this=0x00000001060ac580, descriptor=0x000000016e7ba198, isAsync=true) at ComputePipeline.mm:88:34
    frame #5: 0x000000010a9a1588 WebGPU`WebGPU::Device::createComputePipelineAsync(this=0x00000001060ac580, descriptor=0x000000016e7ba198, callback=0x000000016e7ba080) at ComputePipeline.mm:129:29
    frame #6: 0x000000010a9b25b8 WebGPU`wgpuDeviceCreateComputePipelineAsync(device=0x00000001060ac580, descriptor=0x000000016e7ba198, callback=(actual=0x000000032dc4b448 WebCore`WebCore::WebGPU::createComputePipelineAsyncCallback(WGPUCreatePipelineAsyncStatus, WGPUComputePipelineImpl*, WTF::String&amp;&amp;, void*) at WebGPUDeviceImpl.cpp:573), userdata=0x0000000168c3c5e0) at Device.mm:898:29
    frame #7: 0x000000032dc4b0b0 WebCore`WebCore::WebGPU::DeviceImpl::createComputePipelineAsync(WebCore::WebGPU::ComputePipelineDescriptor const&amp;, WTF::CompletionHandler&lt;void (WTF::RefPtr&lt;WebCore::WebGPU::ComputePipeline, WTF::RawPtrTraits&lt;WebCore::WebGPU::ComputePipeline&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::WebGPU::ComputePipeline&gt;&gt;&amp;&amp;, WTF::String&amp;&amp;)&gt;&amp;&amp;)::$_7::operator()(this=0x000000016e7ba2a8, backingDescriptor=0x000000016e7ba198) at WebGPUDeviceImpl.cpp:588:9
    frame #8: 0x000000032dc3da10 WebCore`auto WebCore::WebGPU::convertToBacking&lt;WebCore::WebGPU::DeviceImpl::createComputePipelineAsync(WebCore::WebGPU::ComputePipelineDescriptor const&amp;, WTF::CompletionHandler&lt;void (WTF::RefPtr&lt;WebCore::WebGPU::ComputePipeline, WTF::RawPtrTraits&lt;WebCore::WebGPU::ComputePipeline&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::WebGPU::ComputePipeline&gt;&gt;&amp;&amp;, WTF::String&amp;&amp;)&gt;&amp;&amp;)::$_7&gt;(descriptor=0x000000016e7ba3a0, convertToBackingContext=0x00000001060b8100, callback=0x000000016e7ba2a8) at WebGPUDeviceImpl.cpp:364:12
    frame #9: 0x000000032dc3d760 WebCore`WebCore::WebGPU::DeviceImpl::createComputePipelineAsync(this=0x0000000106128100, descriptor=0x000000016e7ba3a0, callback=0x000000016e7ba370) at WebGPUDeviceImpl.cpp:581:5
    frame #10: 0x0000000122a66eec WebKit`WebKit::RemoteDevice::createComputePipelineAsync(this=0x00000001061000c0, descriptor=0x000000016e7ba640, identifier=WebKit::WebGPUIdentifier @ 0x000000016e7ba408, callback=0x000000016e7ba618) at RemoteDevice.cpp:286:16</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2039209</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-05-31 18:06:00 -0700</bug_when>
    <thetext>&lt;rdar://problem/129090786&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2070679</commentid>
    <comment_count>2</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2024-10-25 16:19:00 -0700</bug_when>
    <thetext>This no longer crashes, but the test does not pass</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2174072</commentid>
    <comment_count>3</comment_count>
    <who name="Tadeu Zagallo">tzagallo</who>
    <bug_when>2026-01-22 05:36:50 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/57042</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2175694</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-01-27 22:53:42 -0800</bug_when>
    <thetext>Committed 306328@main (98bebfefcf92): &lt;https://commits.webkit.org/306328@main&gt;

Reviewed commits have been landed. Closing PR #57042 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2184942</commentid>
    <comment_count>5</comment_count>
    <who name="Tadeu Zagallo">tzagallo</who>
    <bug_when>2026-02-25 14:05:42 -0800</bug_when>
    <thetext>*** Bug 299363 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>