feat(allowlist): add Shader Languages support - #975
Conversation
Add .glsl/.hlsl/.wgsl/.metal to the supported file types allowlist, a shared shader.md review rule doc covering precision/NaN handling, texture and buffer bounds safety, cross-stage binding layout contracts, compute-shader synchronization, and GPU-specific performance/security pitfalls, and register the glob-to-rule mapping in system_rules.json. No conventional test-file exclusion pattern exists for shader source files, matching the tracking issue's guidance. Part of the language-allowlist expansion tracked in alibaba#470.
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s). |
wu21-web
left a comment
There was a problem hiding this comment.
Site documentation updates missing, update at pages/src/content/docs/<locale>/review-rules.md.
|
@wu21-web Thanks for the catch — docs added in the latest commit. Updated Note: the ja/ru/zh translations are my best effort — please have a native speaker double-check the phrasing before merge. |
|
@wakqasahmed I will review jp and zh for you, but please reslove the merge conflicts first. |
…-languages-support # Conflicts: # internal/config/allowlist/allowed_ext_test.go # internal/config/allowlist/supported_file_types.json # internal/config/rules/system_rules.json # internal/config/rules/system_rules_test.go # pages/src/content/docs/en/review-rules.md # pages/src/content/docs/ja/review-rules.md # pages/src/content/docs/ru/review-rules.md # pages/src/content/docs/zh/review-rules.md
|
@wu21-web Resolved — rebased onto latest |
wu21-web
left a comment
There was a problem hiding this comment.
Approved. Why did you say "the ja/ru/zh translations are my best effort" 🤔 , they didn't need a review really. Good job though.
|
Hi @wu21-web — just checking in on this one, it's been about 5 days with CI green and mergeable. Is there anything needed from our side to help move it forward, or any rough idea on timing? No rush, just following up. Thanks for the review! |
|
@wakqasahmed Merge conflicts, please rebase branch main.
|
…-languages-support # Conflicts: # internal/config/allowlist/allowed_ext_test.go # internal/config/allowlist/supported_file_types.json # internal/config/rules/system_rules.json
|
@wu21-web Rebased again — merged latest main and resolved conflicts in supported_file_types.json, allowed_ext_test.go, and system_rules.json (they were conflicting with the newly-merged Solidity/Vyper allowlist entries). Ran go test on the allowlist and rules packages, both green. Should be conflict-free now. |
Summary
.glsl,.hlsl,.wgsl,.metalto the supported file types allowlistallowed_ext_test.godocuments this explicitly (matching the existing Prisma precedent)internal/config/rules/rule_docs/shader.md, a shared shader review rule doc covering precision/NaN propagation, texture and buffer bounds safety (including non-uniform control flow around texture sampling and compute writes), cross-stage binding/layout contracts (std140/std430, register/space, @binding/@group), compute-shader synchronization (barriers, race conditions), GPU performance anti-patterns (dynamic branching, texture-dependent reads), and security/portability concerns (untrusted buffer indices, vendor-specific intrinsics without fallback)**/*.{glsl,hlsl,wgsl,metal} -> shader.mdinsystem_rules.jsonPart of the language-allowlist expansion tracked in #470.
Closes #974
Test plan
go test ./internal/config/allowlist/... -run 'TestIsAllowedExt|TestIsExcludedPath' -v— PASSgo test ./internal/config/rules/... -run TestResolve_DefaultRules -v— PASSgofmt -s -l .— cleango vet ./internal/config/...— cleango run scripts/verify-english-only.go— clean (423 files scanned, no unapproved non-English text)