release: v0.18.0 - #86
Merged
Merged
Conversation
Add Capabilities type (ir.CapFloat64, ir.CapShaderInt64, ir.CapShaderFloat16) matching Rust naga valid::Capabilities bitflags. WGSL lowerer now rejects f64/i64/u64/f16 unless the caller enables the corresponding capability. LowerWithSource remains permissive (CapAll) for backward compatibility. LowerWithCapabilities provides strict mode for runtime use. CompileOptions.Capabilities defaults to 0 (strict). 32 test cases covering reject/accept per type, struct fields, function params, constructors, vec/mat aliases, atomics, CapAll, combined caps.
Capability checks now live in ir.ValidateWithCapabilities — the single gate between lowerer and backends. Matches Rust naga architecture: lowerer is permissive, validator enforces capabilities, backends trust validated IR. Removed checkScalarWidth from WGSL lowerer, removed LowerWithCapabilities and LowerWithWarningsAndCapabilities. Validator checks Scalar, Vector, Matrix, and Atomic types for width-capability compliance. +84/-450 lines — less code, better architecture, zero duplication.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
ir.ValidateWithCapabilities(module, caps)as single gate between lowerer and backends, matching Rust naga architectureir.Capabilitiestype —CapFloat64,CapShaderInt64,CapShaderFloat16,CapAllCompileOptions.Capabilities— default strict (0), rejects f64/i64/u64/f16 unless enabledTest plan
go build ./...go test ./... -count=1— all 25 packages passgolangci-lint run --timeout=5m— 0 issuesTestRustReference— 100%TestValidateWithCapabilities— 38 tests: scalar/vector/matrix/atomic, reject/accept, backward compat