Skip to content

feat(quality): add DeviceFromView and idiom device rules - #2727

Open
houko wants to merge 1 commit into
mainfrom
feat/issue-1485-device-view-idiom-rules
Open

houko wants to merge 1 commit into
mainfrom
feat/issue-1485-device-view-idiom-rules

Conversation

@houko

@houko houko commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Issue #1485's remaining slice: DeviceFromEnv cannot fill Device.GPU because a game only gets its GPU device inside a gpu.View's OnReady, and a web game could not override Classify's idiom defaults because a device rule required a model, which browsers never report. This adds quality.DeviceFromView(env, dev), which returns the environment's device with GPU set from dev.Capabilities(); lets quality.DeviceRule match an optional idiom (phone, tablet, desktop, mac, tv or watch) with no model; and applies the no-compute or no-compressed-texture-formats Low cap on every OS rather than only on the web. The quality YAML schema moves to version 2, so a version: 1 file must change its version. Tests cover the web phone, tablet and desktop capability matrix, rule matching by OS and idiom, the DeviceFromView path through a real gpu.View device, and the new validation errors. The docs/en and docs/zh guides, the File Formats page, a changelog fragment and an agent note are updated.

Related issue

Fixes #1485

Verification

  • gofmt -l . produces no output
  • go tool nsgo test ./... passes from the repository root — not run; the affected packages pass: go tool nsgo test ./pkg/quality/... ./internal/repocheck/..., and go tool nsgo test ./pkg/quality -- -race
  • go tool nsgo check -target macos,windows,linux,android,web passes from the repository root — go tool nsgo check passes; the cross-target run is left to CI
  • go tool nsgo check -target ios,ios_simulator passes (if on macOS with Xcode) — left to CI
  • bun run build passes (for docs/ or website/ changes) — not run locally because the website dependencies were not installed; left to CI
  • Both docs/en/ and docs/zh/ updated (when applicable)

Also ran go run ./tools/changelog check and bun run verify-notes; both pass.

Screenshots

None: this adds an API helper and a quality configuration field, with no visible UI change.

Acceptance for every editor PR

Not an editor PR.

DeviceFromView fills Device.GPU from the device a gpu.View reports in OnReady, and device rules can match a web operating system by idiom with no model. Classify starts a device whose known GPU lacks compute or compressed texture formats at Low on every operating system, and the quality YAML schema moves to version 2.
@github-actions github-actions Bot added size/M documentation Improvements or additions to documentation area/agents pkg/quality enhancement New feature or request labels Dec 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agents documentation Improvements or additions to documentation enhancement New feature or request pkg/quality size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quality: every browser starts at Medium, phones included, and the start level ignores what the GPU backend can do

1 participant