Skip to content

release: v0.18.0 - #86

Merged
kolkov merged 3 commits into
mainfrom
release/v0.18.0
Aug 2, 2026
Merged

release: v0.18.0#86
kolkov merged 3 commits into
mainfrom
release/v0.18.0

Conversation

@kolkov

@kolkov kolkov commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Unified capability-based validator (WGSL frontend accepts f64 and u64, deferring the failure to the backend #85, ADR-002) — ir.ValidateWithCapabilities(module, caps) as single gate between lowerer and backends, matching Rust naga architecture
  • ir.Capabilities typeCapFloat64, CapShaderInt64, CapShaderFloat16, CapAll
  • CompileOptions.Capabilities — default strict (0), rejects f64/i64/u64/f16 unless enabled

Test plan

  • go build ./...
  • go test ./... -count=1 — all 25 packages pass
  • golangci-lint run --timeout=5m — 0 issues
  • TestRustReference — 100%
  • TestValidateWithCapabilities — 38 tests: scalar/vector/matrix/atomic, reject/accept, backward compat
  • Benchmark: 0 B/op, 0 allocs, ~87 ns/module

kolkov added 3 commits August 2, 2026 09:56
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

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.46809% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
naga.go 16.66% 10 Missing ⚠️
wgsl/internal/lower/lower.go 71.42% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@kolkov
kolkov merged commit 936bb45 into main Aug 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant