fix: classify device capabilities by platform#12454
Open
huhuanming wants to merge 9 commits into
Open
Conversation
huhuanming
force-pushed
the
codex/fix-device-performance-tier
branch
from
July 12, 2026 13:33
8606330 to
3c65344
Compare
huhuanming
force-pushed
the
codex/fix-device-performance-tier
branch
from
July 12, 2026 15:10
8a76c11 to
b585a2c
Compare
huhuanming
force-pushed
the
codex/fix-device-performance-tier
branch
from
July 12, 2026 15:26
b585a2c to
3558335
Compare
huhuanming
marked this pull request as ready for review
July 13, 2026 14:37
huhuanming
requested review from
ezailWang,
originalix,
revan-zhang and
sidmorizon
as code owners
July 13, 2026 14:37
huhuanming
enabled auto-merge (squash)
July 13, 2026 14:37
originalix
reviewed
Jul 13, 2026
6 tasks
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
navigator.hardwareConcurrency.Intent & Context
Previous classification mixed RAM and startup timing with CPU capability. It also relied on human-readable iOS marketing names, which can change when the device library updates.
This change makes device capability inputs deterministic, keeps memory independent from CPU, and lets each feature combine only the signals relevant to its workload.
Root Cause
Design Decisions
low,medium, andhightier labels in bundled native catalogs; no benchmark scores or source-data processing code is included.modelId -> tierlookup on iOS and do not read the user-editable device name or marketing model name.manufacturer -> model -> tiergrouped lookup on Android to avoid repeated manufacturer strings and composite-key allocation.hardwareConcurrencyas a medium-confidence concurrency proxy, not a CPU benchmark; browsers may reduce the value for privacy.mainandbgheaps are independent; each runtime resolves once if it imports the module.navigator.deviceMemoryon web/extension when available; keep unknown values unknown.unknown; each feature policy chooses its own fallback.Changes Detail
Risk Assessment
mainJS runtime. The nativebgruntime initializes independently and does not import the catalog or UI policy in this flow.mainandbgdo not share the cached object or deserialized data; if both import it, each resolves independently once. Native constants/storage are backed by native resources, but no JS readiness or object sharing is assumed across runtimes.Test plan
yarn agent:check --profile commit