fix: fix fps safe zone with higher frame rates#345
Open
Almouro wants to merge 4 commits into
Open
Conversation
✅ Deploy Preview for flashlight-docs canceled.
|
1a11c97 to
2e91890
Compare
A10s has 8 cores, not 4
2e91890 to
61160dd
Compare
38319d3 to
06e1be7
Compare
Contributor
Flashlight Automated Report 🔦 |
There was a problem hiding this comment.
Pull request overview
Fixes the FPS "safe zone" band on the web report so it scales to the device's actual refresh rate (e.g., 90/120 Hz) instead of being hard-coded to 57–60. The refresh rate is now persisted on each TestCaseResult via a new specs.refreshRate field, plumbed from profiler.detectDeviceRefreshRate() at write time and consumed by FPSReport through Report.getRefreshRate(). Also corrects the Samsung A10s core-count copy from 4 to 8.
Changes:
- Persist
specs.refreshRateon test results in the test command and the iOS-instruments writer, and tighten thespecsfield onTestCaseResult/AveragedTestCaseResult. - Compute the FPS safe-zone interval dynamically from
reports[0].getRefreshRate()(95% of target → target). - Update the CPU explanation copy and corresponding snapshots from 4 cores/400% to 8 cores/800%.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/types/index.ts | Changes specs from optional to DeviceSpecs | undefined on result types. |
| packages/commands/test/src/writeReport.ts | Populates specs.refreshRate via profiler.detectDeviceRefreshRate(). |
| packages/commands/test/src/tests/writeResults.ts | Mocks detectDeviceRefreshRate returning 120. |
| packages/commands/test/src/tests/measurePerformance.test.ts | Adds detectDeviceRefreshRate mock and updated snapshot expectation. |
| packages/platforms/ios-instruments/src/writeReport.ts | Adds specs.refreshRate using the existing FAKE_FPS constant. |
| packages/core/web-reporter-ui/src/sections/FPSReport.tsx | Switches prop to reports and derives the safe-zone band from refresh rate. |
| packages/core/web-reporter-ui/ReporterView.tsx | Passes selectedReports to FPSReport; adds placeholder specs: undefined. |
| packages/core/web-reporter-ui/src/sections/ReportSummary/Explanations.tsx | Updates Samsung A10s core count from 4 to 8. |
| packages/core/web-reporter-ui/tests/snapshots/ReporterView.test.tsx.snap | Snapshot updates for the copy change. |
| packages/commands/measure/src/tests/snapshots/measure.test.tsx.snap | Snapshot updates for the copy change. |
| yarn.lock | Bumps caniuse-lite and adds an empty uid line for the linked eslint plugin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| iterations: TestCaseIterationResult[]; | ||
| type?: TestCaseResultType; | ||
| specs?: DeviceSpecs; | ||
| specs: DeviceSpecs | undefined; |
| averageHighCpuUsage: { [processName: string]: number }; | ||
| type?: TestCaseResultType; | ||
| specs?: DeviceSpecs; | ||
| specs: DeviceSpecs | undefined; |
Comment on lines
+12
to
+18
| const fpsAnnotationInterval = useMemo(() => { | ||
| const targetFps = reports[0].getRefreshRate(); | ||
|
|
||
| return [ | ||
| { y: Math.floor(0.95 * targetFps), y2: targetFps, color: "#158000", label: "Safe Zone" }, | ||
| ]; | ||
| }, [reports]); |
Comment on lines
+125
to
+127
| specs: { | ||
| refreshRate: FAKE_FPS, | ||
| }, |
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.
No description provided.