Skip to content

[ExecuTorch][WebGPU] Generate logical and arithmetic binary shader variants - #21451

Merged
meta-codesync[bot] merged 6 commits into
gh/JCNTH/201/basefrom
gh/JCNTH/201/head
Aug 7, 2026
Merged

[ExecuTorch][WebGPU] Generate logical and arithmetic binary shader variants#21451
meta-codesync[bot] merged 6 commits into
gh/JCNTH/201/basefrom
gh/JCNTH/201/head

Conversation

@JCNTH

@JCNTH JCNTH commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Generate byte-identical logical and arithmetic binary variants from shared WGSL families

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:

  • Generate logical AND/OR from one operator-token manifest.
  • Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
  • Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
@exported-using-ghexport

Differential Revision: D113979789

Differential Revision: D113979789

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21451

Note: Links to docs will display an error until the docs builds have been completed.

❌ 53 New Failures, 30 Pending

As of commit 2b217e5 with merge base 28a7fac (image):

NEW FAILURES - The following jobs have failed:

  • Cadence Build & Test / cpu-test / test-aot / test-aot (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID CF78:1BBE8E:4C015D0:10153E55:6A760B52 and timestamp 2026-08-07 16:44:02 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • Cadence Build & Test / cpu-test / test-ops / test-ops (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID A104:157945:882A12D:1C96357C:6A760B50 and timestamp 2026-08-07 16:44:00 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / nxp-build-test / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-arm-backend-no-driver (test_pytest_ops_no_target) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-arm-backend-no-driver (test_run_tosa) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID AD88:1E52A0:7989503:198D0E60:6A760BD6 and timestamp 2026-08-07 16:46:14 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-arm-cortex-m-size-test (bare_metal) / linux-job (gh)
    Error: Input required and not supplied: path
  • pull / test-eval_llama-wikitext-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID DBB8:3E0BFE:80DA549:1B543B13:6A760B34 and timestamp 2026-08-07 16:43:32 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-llama_runner_eager-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID B3F2:3B7ED2:366F83F:B9333B0:6A760B6B and timestamp 2026-08-07 16:44:27 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-lora-linux / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-lora-multimethod-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID A4C2:7E39:8E9FED9:1E330FD6:6A760B86 and timestamp 2026-08-07 16:44:54 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-mediatek-models-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID E1A6:36BA82:39BF608:C47AAF6:6A760B43 and timestamp 2026-08-07 16:43:48 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (add_mul, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 92C6:32268B:3690E3F:B9D3576:6A760B9B and timestamp 2026-08-07 16:45:15 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (add_mul, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (add, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID BCCA:AE1C7:38C78BE:C0B8DEB:6A760BAB and timestamp 2026-08-07 16:45:31 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (add, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 9A9C:8A136:4B3C15E:FF2DD3F:6A760B9F and timestamp 2026-08-07 16:45:19 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (emformer_transcribe, portable, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (emformer_transcribe, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID D716:437B0:4B58348:FEDF860:6A760B8B and timestamp 2026-08-07 16:44:59 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (ic3, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID DBA4:157945:885E23C:1CA14092:6A760BAE and timestamp 2026-08-07 16:45:34 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (ic3, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (linear, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID E888:1600F6:37866DC:BCBB7BF:6A760BB3 and timestamp 2026-08-07 16:45:39 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (linear, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID C954:1E52A0:797163E:1987F462:6A760BA3 and timestamp 2026-08-07 16:45:24 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (mobilebert, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID CDD6:157945:88584EE:1CA00553:6A760BA3 and timestamp 2026-08-07 16:45:23 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (mobilebert, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (mv2, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID C40C:1638AE:3859671:BF8AE43:6A760B74 and timestamp 2026-08-07 16:44:36 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (mv2, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (resnet18, portable, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID C3E6:37B3D4:36E0C9B:BAAECE9:6A760B91 and timestamp 2026-08-07 16:45:05 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux (resnet18, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (resnet50, portable, linux.2xlarge) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux (resnet50, xnnpack-quantization-delegation, linux.2xlarge) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID C28C:3A30F6:4B547FF:FEBDB55:6A760B7F and timestamp 2026-08-07 16:44:47 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (mv3, portable, buck2, linux.2xlarge, executorch-ubuntu-22.04-clang12) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 937C:165769:8C685D2:1D7505D2:6A760B78 and timestamp 2026-08-07 16:44:40 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (mv3, portable, cmake, linux.2xlarge, executorch-ubuntu-22.04-clang12) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID E4AE:2069FC:33D03D4:B097147:6A760B7D and timestamp 2026-08-07 16:44:45 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (mv3, xnnpack-quantization-delegation, buck2, linux.2xlarge, executorch-u... / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 9B40:11CC5B:3649CA4:B8B3CD3:6A760B63 and timestamp 2026-08-07 16:44:19 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (mv3, xnnpack-quantization-delegation, cmake, linux.2xlarge, executorch-u... / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID EBDA:C930:8976A13:1CF83C64:6A760B6B and timestamp 2026-08-07 16:44:27 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (vit, portable, buck2, linux.2xlarge, executorch-ubuntu-22.04-clang12) / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-models-linux-basic (vit, portable, cmake, linux.2xlarge, executorch-ubuntu-22.04-clang12) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 9C1E:4723F:36AA4C0:B9DB625:6A760B60 and timestamp 2026-08-07 16:44:16 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (vit, xnnpack-quantization-delegation, buck2, linux.2xlarge, executorch-u... / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID B5A6:AA848:864CE4D:1C3947D7:6A760BA4 and timestamp 2026-08-07 16:45:24 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-models-linux-basic (vit, xnnpack-quantization-delegation, cmake, linux.2xlarge, executorch-u... / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 87A0:1B7A58:8D87E45:1DB04A2C:6A760B5A and timestamp 2026-08-07 16:44:10 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-multimodal-linux (gemma3-4b) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID C818:3D3924:83B73AC:1BC42D86:6A760B95 and timestamp 2026-08-07 16:45:09 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-parakeet-xnnpack-linux / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / test-phi-3-mini-runner-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID C036:37837C:83000F4:1B7C946C:6A760B82 and timestamp 2026-08-07 16:44:50 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-qnn-direct-build-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 93A4:36966A:36E6D0E:BB65D03:6A760BCF and timestamp 2026-08-07 16:46:07 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-qnn-wheel-packages-linux (3.10) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 98D4:3AEFE2:8EE884A:1E17EBE4:6A760B59 and timestamp 2026-08-07 16:44:09 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-qnn-wheel-packages-linux (3.11) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID BEEA:1638AE:384D1D2:BF613E0:6A760B51 and timestamp 2026-08-07 16:44:01 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-qnn-wheel-packages-linux (3.12) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID DDBA:1DE33:4E237D4:1098CDB8:6A760B7E and timestamp 2026-08-07 16:44:46 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-qnn-wheel-packages-linux (3.13) / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 9888:B0E22:3F7F12C:D751F06:6A760B65 and timestamp 2026-08-07 16:44:21 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-samsung-models-linux / linux-job (gh)
    Error: Input required and not supplied: path
  • pull / test-samsung-quantmodels-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID DA56:11CC5B:366D376:B92C948:6A760BCB and timestamp 2026-08-07 16:46:03 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-setup-linux-gcc / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID DD06:1BCB3:3832E71:BF0F545:6A760B4E and timestamp 2026-08-07 16:43:58 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-voxtral-realtime-xnnpack-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID DC78:3757C1:8C29970:1D84DCCC:6A760B4B and timestamp 2026-08-07 16:43:55 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-vulkan-models-linux / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 8D86:957DF:4FD697A:1114714D:6A760BCD and timestamp 2026-08-07 16:46:05 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / test-vulkan-operators-linux / linux-job (gh)
    ##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory
  • pull / unittest / macos / macos-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID E87B:35B914:83725DD:1BA7D4ED:6A760B4A and timestamp 2026-08-07 16:43:54 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting
  • pull / unittest-nxp-neutron / linux-job (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID D518:3440A9:367D5D1:B976A89:6A760B98 and timestamp 2026-08-07 16:45:12 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@JCNTH

JCNTH commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

v

@JCNTH

JCNTH commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@claude Double check for need of changes, modulariziation opportunity, etc

@claude

claude Bot commented Jul 29, 2026

Copy link
Copy Markdown

Claude finished @JCNTH's task in 1m 58s —— View job


Review: WebGPU logical binary shader variants

  • Read the full PR diff vs base
  • Compare against Vulkan binary_op_buffer reference
  • Assess correctness, modularization opportunities, drift risks
  • Post review feedback

The shader consolidation is clean and correct. The generated logical_and_wgsl.h / logical_or_wgsl.h are byte-identical to before (only the @generated from provenance line changed), the $if OP == "&" branch keeps each comment accurate, and the new roundtrip test locks the template → expansion → embedded header → registry chain. The deterministic truth-table generators are a genuine improvement over the old random-seed masks — they now cover all four Boolean pairs (FF/FT/TF/TT) in byte order plus word-boundary shapes (words63/64/65), and test_logical_binary_case_contract pins the exact payloads. No correctness issues found.

The @claude ask was "double check for need of changes, modularization opportunity" — so, focusing on that:

Main modularization opportunity: the two handler .cpp files still duplicate ~130 lines

The PR unified the shaders but left logical_and/LogicalAnd.cpp and logical_or/LogicalOr.cpp as near-identical files. A diff shows they differ only in:

  • the WGSL constant (kLogicalAndWGSL vs kLogicalOrWGSL) and workgroup constant,
  • the op-name strings in error messages / dispatch labels ("logical_and" vs "logical_or"),
  • the params struct name (LogicalAndParams vs LogicalOrParams — identical layout),
  • the two WEBGPU_REGISTER_OP lines.

Everything else — validation, uniform setup, pipeline/bind-group construction, the resize hook — is byte-for-byte the same. This is exactly the drift risk the PR set out to eliminate at the shader layer, just moved down to the host layer.

The repo already has the pattern to fix this: boolean_op/BooleanOp.cpp consolidates 7 ops (eq/ne/le/ge/lt/gt.Scalar + logical_not) behind a single dispatch_bool_op(...) helper parameterized by (wgsl, wg_size_x, op_name), with thin per-op registration shims. Applying the same shape here — a single logical_binary/LogicalBinary.cpp with dispatch_logical_binary(graph, args, wgsl, wg_size_x, op_name) and two 1-line impls — would collapse the two files into one and put the handler in the same directory as the shader it dispatches (right now shaders live in logical_binary/ while handlers stay in logical_and/ + logical_or/, which is a bit split). This also mirrors Vulkan more faithfully, where binary_op_buffer is one shader family and one host dispatch path.

If you want this, I'm happy to implement it — it's a mechanical consolidation and the existing test_logical_binary_template_roundtrip_byte_identical already validates the shader/registry side; the handler hash assertions in that test would need their paths updated to the new single file.

Minor: test-fixture module ownership

LOGICAL_BINARY_CASES, logical_binary_gen_a, and logical_binary_gen_b now live in test/ops/test_logical_and.py and are imported by test_logical_or.py, test_bitwise.py, cases.py, and test_generator.py. Having the OR / bitwise / codegen tests reach into the AND test module for shared fixtures is slightly surprising. Consider a small shared helper (e.g. test/ops/logical_binary_fixtures.py) so the shared truth-table generators have a neutral home — parallels the runtime logical_binary/ consolidation. Low priority; purely organizational.

Nit

  • test_logical_and.py _logical_binary_gen: the guard is numel % len(pattern) != 0 but the error string is hard-coded "...numel % 4 == 0". Fine today (len(pattern) == 4), just a latent inconsistency if the pattern length ever changes.

Net: no blocking issues — the shader-side work is solid and well-tested. The one worthwhile follow-up is folding the two duplicate handlers into a single dispatch_logical_binary à la BooleanOp.cpp; that completes the anti-drift goal end to end rather than stopping at the shader layer.

[ghstack-poisoned]
@JCNTH JCNTH changed the title [ExecuTorch][WebGPU] Generate logical binary shader variants [ExecuTorch][WebGPU] Generate logical and arithmetic binary shader variants Jul 30, 2026
  fbsource master

[ghstack-poisoned]
@meta-codesync
meta-codesync Bot merged commit 04abf89 into gh/JCNTH/201/base Aug 7, 2026
128 of 182 checks passed
@meta-codesync
meta-codesync Bot deleted the gh/JCNTH/201/head branch August 7, 2026 17:21
@meta-codesync
meta-codesync Bot temporarily deployed to cherry-pick-bot August 7, 2026 17:21 Inactive
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
JCNTH added a commit that referenced this pull request Aug 7, 2026
…riants

Pull Request resolved: #21451

**Generate byte-identical logical and arithmetic binary variants from shared WGSL families**

Logical AND/OR and four arithmetic binary kernels duplicated shader skeletons and broadcast logic. This consolidates logical AND/OR behind one packed-Boolean family and minimum/pow/floor_divide/mul into the existing binary family, with a permanent mixed-rank broadcast contract.

Key changes:
- Generate logical AND/OR from one operator-token manifest.
- Generate minimum, pow, floor_divide, and mul beside the existing div/sub variants.
- Lock same-shape and mixed-rank expressions, exact payloads/workgroups, PTE delegation, and broadcast boundary cases.

No runtime C++ dispatch, bindings, pipeline construction, workgroups, or expanded shader payloads change. Four standalone WGSL inputs are removed, and future compatible variants require manifest entries instead of copied kernels. This follows the Vulkan binary-family pattern.

Co-authored-with: Claude Code.
ghstack-source-id: 411961479
@exported-using-ghexport

Differential Revision: [D113979789](https://our.internmc.facebook.com/intern/diff/D113979789/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants