Skip to content

Update WebGPU#8955

Draft
shoaibkamil wants to merge 31 commits into
mainfrom
shoaibkamil/webgpu_use_promises
Draft

Update WebGPU#8955
shoaibkamil wants to merge 31 commits into
mainfrom
shoaibkamil/webgpu_use_promises

Conversation

@shoaibkamil
Copy link
Copy Markdown
Contributor

Update to latest WebGPU, Node, Dawn, and emscripten versions. Use a promise-based API instead of old-style tick-based APIs. This unifies the backend, but requires specific support for timed waits on promises. Dawn is currently the only implementation that has this.

Shoaib Kamil and others added 30 commits December 15, 2025 17:42
- Replace WGPUShaderModuleWGSLDescriptor with WGPUShaderSourceWGSL
- Replace WGPUProgrammableStageDescriptor with WGPUComputeState
- Convert all string fields from const char* to WGPUStringView
- Update callbacks to use *CallbackInfo structures (WGPUBufferMapCallbackInfo, etc)
- Replace WGPU_*_INIT macros with explicit field initialization
- Change wgpuBufferReference to wgpuBufferAddRef
- Update WGPUConstantEntry.key to use WGPUStringView
- Initialize WGPUDeviceDescriptor.defaultQueue and uncapturedErrorCallbackInfo explicitly

Co-authored-by: AI Assistant (Cursor/Claude)
- Update callback signatures to use WGPUStringView and userdata2
- Replace WGPURequiredLimits/WGPUSupportedLimits with WGPULimits
- Fix WGPUStringView field initialization (data/length)
- Update device descriptor to use deviceLostCallbackInfo structure
- Convert wgpuAdapterRequestDevice/wgpuInstanceRequestAdapter to use callback info structures
- Change wgpuAdapterGetLimits return type check to WGPUStatus

Co-authored-by: AI Assistant (Cursor/Claude)
- Define NULL and SIZE_MAX in mini_webgpu.h for freestanding runtime
- Replace explicit field initialization with WGPU_*_INIT macros
- Replace ~(size_t)0 with WGPU_STRLEN for clarity

Co-authored-by: AI Assistant (Cursor/Claude)
Co-authored-by: AI Assistant (Cursor/Claude)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e_promises

# Conflicts:
#	doc/WebGPU.md
#	src/LLVM_Runtime_Linker.cpp
#	src/runtime/CMakeLists.txt
#	vcpkg-configuration.json
- Add vcpkg overlay port for Dawn that forces SHARED library build
  (required for runtime dlopen loading in JITModule.cpp)
- Add arm64-osx-halide vcpkg triplet with dynamic linkage override
- Update FindHalide_WebGPU.cmake to resolve Dawn via vcpkg CMake config
  with Apple framework dependencies (Metal, IOSurface, etc.)
- Fix 32-bit ARM runtime target to use generic i386 to avoid
  cross-compilation issues
- Move arm64-osx-halide and x64-osx-halide triplets to cmake/vcpkg-triplets/
  (the canonical location per vcpkg-configuration.json); remove the shadowing
  copies from cmake/vcpkg/triplets/
- Fix both triplets to use static linkage for all packages except Dawn, which
  must remain a shared library for dlopen loading; add missing
  VCPKG_CMAKE_SYSTEM_NAME and VCPKG_OSX_ARCHITECTURES to arm64-osx-halide
- Drop the now-redundant cmake/vcpkg/triplets entry from vcpkg-configuration.json
- Fix JITModule.cpp: when HL_WEBGPU_NATIVE_LIB is not set the fallback library
  search was incorrectly skipped (error was still empty, making the guard false);
  change condition to `env_libname.empty() || !error.empty()` so the search runs
  when no env var is provided
- doc/WebGPU.md: update Dawn vcpkg port version, fix triplet description, remove
  duplicate HL_WEBGPU_NATIVE_LIB/HL_WEBGPU_NODE_BINDINGS note

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@66c7898). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/LLVM_Runtime_Linker.cpp 0.00% 7 Missing ⚠️
src/JITModule.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8955   +/-   ##
=======================================
  Coverage        ?   69.79%           
=======================================
  Files           ?      255           
  Lines           ?    77531           
  Branches        ?    18538           
=======================================
  Hits            ?    54110           
  Misses          ?    17959           
  Partials        ?     5462           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant