fix(dxil): gg 61/61 — array-of-vector flattening, fine.wgsl fixed (BUG-DXIL-041)#71
Merged
Conversation
Add mathMinArgs() that maps MathFunction to required argument count. dot/cross/distance/reflect/step/pow/atan2 require 2, mix/smoothstep/ clamp/fma require 3. Catches dot(v) with 1 arg at lowering time instead of crashing in SPIR-V backend with nil pointer dereference. Fixes gogpu/wgpu#170
…ad (BUG-DXIL-041) fine.wgsl "Invalid record" caused by 3 bugs in flattened array<vec4,N>: (1) GEP index not scaled by vecWidth, (2) single-scalar load instead of vec4 load, (3) garbage component IDs from missing pendingComponents. gg production: 58/59 → 61/61 (0 failures). Fixes BUG-DXIL-041.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…anup, tmp/ exclusion Extract constants: errExpectedParameterName/MemberName/VariableName/Type (parser.go), semPosition/semTarget (semantic.go), hlslFloat (resources.go), samplerHeapName/comparisonSamplerHeapName (sampler_heap.go), outcomeSkip (corpus.go). Remove 4 unused //nolint:gosec. Exclude wgsl/lexer.go and wgsl/token.go keyword maps from goconst. Exclude tmp/ from lint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes BUG-DXIL-041:
fine.wgsl"Invalid record" DXIL validation failure.gg production: 58/59 → 61/61 (0 failures, 100%)
Root cause
array<vec4<f32>, N>locals flattened to[16 x float]had 3 bugs:pendingComponentsFix
tryLoadVectorFromFlatArray()— loads vecWidth consecutive scalarsscaleIndexForVecArray()— scales dynamic index by vecWidthtryLocalVarAccessIndex— scales constant index by vecWidth4 integration tests with WGSL→DXIL→IDxcValidator roundtrip.
Test plan
go test -run TestDxilValGGProduction— 61/61 (0 failures)go test -run TestDxilValSummary— 161/170go test -run TestDxilDxcGolden— 105 diff=0go test -run TestRustReference— 100%golangci-lint— clean