test(metal): align storage-mode fixture with GPU policy - #275
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
kolkov
reviewed
Jul 24, 2026
kolkov
left a comment
Contributor
There was a problem hiding this comment.
Clean fix. The test injection was stale after #272 switched texture storage policy from hasUnifiedMemory to isAppleGPU — this aligns the fixture with the actual production predicate. Verified that CreateTexture (device.go:233) uses d.isAppleGPU, so the old hasUnifiedMemory toggle was a no-op for texture allocation. LGTM.
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
Queue.WriteTexturestorage-mode matrix throughDevice.isAppleGPU, the predicate production texture allocation actually usesRoot cause
The test added in #261 simulated Private and Shared texture allocation by changing
hasUnifiedMemory. After #272, texture allocation intentionally uses Apple GPU-family membership (isAppleGPU) instead, avoiding Shared texture policy on Intel/AMD devices.On Apple Silicon, the stale fixture therefore could not force the
private stagingcase:CreateTexturestill sawisAppleGPU=true, allocated Shared storage, and failed the expectation:This updates the test injection point to match the current policy. The Private-staging and Shared-direct data paths remain exercised on Apple GPUs; non-Apple GPUs continue to exercise the production-supported Private path.
Validation
CGO_ENABLED=0 GOWORK=off go test -count=1 ./hal/metal -run '^TestQueueWriteTextureLayeredShapes/1D_array/private_staging$' -vCGO_ENABLED=0 GOWORK=off go test -count=1 ./hal/metalCGO_ENABLED=0 GOWORK=off go test -count=1 ./...CGO_ENABLED=0 GOWORK=off go test -count=1 -tags rust ./...The complete local macOS default and Rust-tagged test runs now pass without excluding
hal/metal. This is deliberately separate from Android PR #268.