[ExecuTorch][WebGPU] Unit tests for the WGSL shader-variant codegen#20728
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20728
Note: Links to docs will display an error until the docs builds have been completed. ❌ 5 New Failures, 2 Pending, 1 Unrelated FailureAs of commit 090cdc3 with merge base f4b01a8 ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
@claude throoughly review, check for overengineering, correctness, and areaas for modularization |
|
Claude finished @JCNTH's task in 2m 40s —— View job Review: WGSL shader-variant codegen unit tests
Solid, well-targeted test suite. The names are descriptive, the docstrings capture the why (the DD-009
Correctness
Overengineering
Modularization
Coverage gaps (optional, not blocking)
Nit
None of the above blocks the PR — the suggestions are hardening the drift-guard and closing a few inherited-branch gaps. Nice work on the byte-identity and DD-009 regression cases. |
SS-JIA
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Pull Request resolved: #20728 Additive coverage for the template engine added in the previous diff. Key additions (`test/test_wgsl_codegen.py`, `WgslTemplateEngineTest`): - `preprocess` `$if`/`$else` branch selection + `${...}` substitution + guarded-body indentation. - the DTYPE x VEC variant matrix and `SUFFIX` rules (`""` suppresses; defaults to `str(VALUE)`). - `parse_template_spec` — minimal-spec expansion, duplicate-key rejection (via the `UniqueKeyLoader`), top-level-key validation. - the 3 WGSL type-helpers (`buffer_scalar_type` / `buffer_gvec_type` / `accum_scalar_type`). - a byte-identity round-trip reproducing both committed `rms_norm` headers from the template + `rms_norm.yaml`. - a source-of-truth sync-lock asserting the shared `$`-block transpiler helpers and the `UniqueKeyLoader` stay character-identical to `gen_vulkan_spv.py` (guards against silent drift). ghstack-source-id: 401515160 @exported-using-ghexport Differential Revision: [D110660006](https://our.internmc.facebook.com/intern/diff/D110660006/)
Stack from ghstack (oldest at bottom):
Additive coverage for the template engine added in the previous diff.
Key additions (
test/test_wgsl_codegen.py,WgslTemplateEngineTest):preprocess$if/$elsebranch selection +${...}substitution + guarded-body indentation.SUFFIXrules (""suppresses; defaults tostr(VALUE)).parse_template_spec— minimal-spec expansion, duplicate-key rejection (via theUniqueKeyLoader), top-level-key validation.buffer_scalar_type/buffer_gvec_type/accum_scalar_type).rms_normheaders from the template +rms_norm.yaml.$-block transpiler helpers and theUniqueKeyLoaderstay character-identical togen_vulkan_spv.py(guards against silent drift).@exported-using-ghexport
Differential Revision: D110660006
Differential Revision: D110660006