<?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>289147</bug_id>
          
          <creation_ts>2025-03-04 22:54:51 -0800</creation_ts>
          <short_desc>[WebGPU] Memory barriers in vertex shader validation routines are problematic on M1</short_desc>
          <delta_ts>2025-03-10 08:27:53 -0700</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="Mike Wyrzykowski">mwyrzykowski</assigned_to>
          <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>2100530</commentid>
    <comment_count>0</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2025-03-04 22:54:51 -0800</bug_when>
    <thetext>[WebGPU] Visual difference on some sites between M1 and M2 Macs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100531</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-03-04 22:55:07 -0800</bug_when>
    <thetext>&lt;rdar://problem/146219177&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100533</commentid>
    <comment_count>2</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2025-03-04 23:01:42 -0800</bug_when>
    <thetext>M1s are triggering a context lost due to MTLCommandBuffer failure:

error	23:00:40.699875-0800	com.apple.WebKit.GPU	-[_MTLCommandBuffer didScheduleWithStartTime:endTime:error:], line 1020: error &apos;Execution of the command buffer was aborted due to an error during execution. Internal Error (00000100:Internal Error)&apos;
error	23:00:40.699908-0800	com.apple.WebKit.GPU	Execution of the command buffer was aborted due to an error during execution. Internal Error (00000100:Internal Error)
default	23:00:40.719243-0800	com.apple.WebKit.GPU	Encountered fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 &quot;Internal Error (00000100:Internal Error)&quot; UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x7067adcb0 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100757</commentid>
    <comment_count>3</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2025-03-05 14:58:57 -0800</bug_when>
    <thetext>If we ignore this error on M1s the page works as expected, need to figure out what error code 256 is
```
Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 &quot;Internal Error (00000100:Internal Error)&quot; UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x42dd31fb0 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;
Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 &quot;Internal Error (00000100:Internal Error)&quot; UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x43510cb00 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;
Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 &quot;Internal Error (00000100:Internal Error)&quot; UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x42ddf50e0 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;
Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 &quot;Internal Error (00000100:Internal Error)&quot; UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x142c9c810 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;
Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 &quot;Internal Error (00000100:Internal Error)&quot; UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x436b94e40 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;
Encountered non-fatal command buffer error Error Domain=MTLCommandBufferErrorDomain Code=1 &quot;Internal Error (00000100:Internal Error)&quot; UserInfo={NSLocalizedDescription=Internal Error (00000100:Internal Error), NSUnderlyingError=0x142ca24f0 {Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;}}, underlying error Error Domain=IOGPUCommandQueueErrorDomain Code=256 &quot;(null)&quot;
com.apple.WebKit.GPU.Development(40094) MallocStackLogging: msl_handle_memory_pressure_event: approaching memory limit. Starting stack-logging.
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101056</commentid>
    <comment_count>4</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2025-03-06 10:57:07 -0800</bug_when>
    <thetext>Ok great I root caused it. Too many completion handlers are being added to the MTLCommandBuffer, which appears to be exhausting some driver / kernel resource.

WebKit can manage this ourselves quite easily, I will change that</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101204</commentid>
    <comment_count>5</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2025-03-06 16:29:18 -0800</bug_when>
    <thetext>Further analysis indicates this is not due to the total number of completion handlers, but rather the way we are using memory barriers does not seem to work on M1 Macs.

We could split passes on M1s as this is not a codepath which should not be regularly triggered</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101209</commentid>
    <comment_count>6</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2025-03-06 16:45:29 -0800</bug_when>
    <thetext>Splitting render passes to validate like we do for Intel appears to resolve the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101276</commentid>
    <comment_count>7</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2025-03-06 21:30:04 -0800</bug_when>
    <thetext>Splitting the render passes is not needed, there is a simpler solution, I will implement that instead</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101281</commentid>
    <comment_count>8</comment_count>
    <who name="Mike Wyrzykowski">mwyrzykowski</who>
    <bug_when>2025-03-06 21:48:03 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/42069</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101927</commentid>
    <comment_count>9</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-03-10 08:27:50 -0700</bug_when>
    <thetext>Committed 291897@main (8f1919db1fce): &lt;https://commits.webkit.org/291897@main&gt;

Reviewed commits have been landed. Closing PR #42069 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>