Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f37648d6131256c4df0763551328f4669b30c88f
      
https://github.com/WebKit/WebKit/commit/f37648d6131256c4df0763551328f4669b30c88f
  Author: Mike Wyrzykowski <[email protected]>
  Date:   2025-12-05 (Fri, 05 Dec 2025)

  Changed paths:
    M Source/WebGPU/WebGPU/BindableResource.h
    M Source/WebGPU/WebGPU/Buffer.h
    M Source/WebGPU/WebGPU/Buffer.mm
    M Source/WebGPU/WebGPU/CommandBuffer.mm
    M Source/WebGPU/WebGPU/CommandEncoder.h
    M Source/WebGPU/WebGPU/CommandEncoder.mm
    M Source/WebGPU/WebGPU/Device.h
    M Source/WebGPU/WebGPU/Device.mm
    M Source/WebGPU/WebGPU/ExternalTexture.h
    M Source/WebGPU/WebGPU/ExternalTexture.mm
    M Source/WebGPU/WebGPU/QuerySet.h
    M Source/WebGPU/WebGPU/QuerySet.mm
    M Source/WebGPU/WebGPU/Texture.h
    M Source/WebGPU/WebGPU/Texture.mm
    M Source/WebGPU/WebGPU/TextureView.h
    M Source/WebGPU/WebGPU/TextureView.mm

  Log Message:
  -----------
  macOS/iPadOS 26 memory leak in com.apple.Webkit.GPU process when running 
simple WebGPU app
https://bugs.webkit.org/show_bug.cgi?id=303203
rdar://165488672

Reviewed by Tadeu Zagallo.

For resource validation purposes, the specification requires us to store
which resources and currently used by which command encoders and command buffers
so we can prevent data races.

We were tracking all the command encoders a resource was used in, but we only
cleared this list when the resource was destroyed.

A resource may live for the lifetime of an application and used in many command
encoders.

An application creating lots of command encoders could start to observe
a slow memory increase over ~30 minutes to several hours.

Test: existing CTS buffer mapping and command encoder
validation tests continue to pass.

* Source/WebGPU/WebGPU/BindableResource.h:
(WebGPU::TrackedResource::removeEncoder const):
* Source/WebGPU/WebGPU/Buffer.h:
* Source/WebGPU/WebGPU/Buffer.mm:
(WebGPU::Buffer::setCommandEncoder const):
* Source/WebGPU/WebGPU/CommandBuffer.mm:
(WebGPU::CommandBuffer::makeInvalid):
(WebGPU::CommandBuffer::makeInvalidDueToCommit):
* Source/WebGPU/WebGPU/CommandEncoder.h:
* Source/WebGPU/WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::~CommandEncoder):
(WebGPU::CommandEncoder::computeSize):
(WebGPU::CommandEncoder::trackEncoder):
(WebGPU::CommandEncoder::clearTracking):
(WebGPU::CommandEncoder::trackEncoderForBuffer):
(WebGPU::CommandEncoder::trackEncoderForTexture):
(WebGPU::CommandEncoder::trackEncoderForTextureView):
(WebGPU::CommandEncoder::trackEncoderForExternalTexture):
(WebGPU::CommandEncoder::trackEncoderForQuerySet):
* Source/WebGPU/WebGPU/ExternalTexture.h:
* Source/WebGPU/WebGPU/QuerySet.h:
* Source/WebGPU/WebGPU/Texture.h:
* Source/WebGPU/WebGPU/TextureView.h:

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



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

Reply via email to