-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconfigure emulation flags #10910
Comments
cc @wildlyinaccurate I have a feeling you'd have been much happier with the above proposal, so you wouldn't have had to do all the investigation in catchpoint/WebPageTest.agent#297. But curious for your thoughts. :) also cc @benschwarz @alekseykulikov @mattzeunert |
Related: I think we may need something like |
Sounds great, love it 👍
Basically required to do the above, SGTM 👍
Sounds like good housekeeping given the above 👍
Feels a little weird that
Speak of the 👿 Yeah let's do that instead :)
This is the one I don't understand :) Sounds like it's just returning us to the old days of duplicate flags controlling the same thing. |
Old comment from #9377 (review)
Not sure if I completely agree with this, but just splitting up all our emulation options so that they don't have interactions (unexpected or otherwise) anymore does have a certain appeal. Most people will still use the presets, and the people heavily tweaking will want to heavily tweak anyways. |
discussed. plan:
updated:
|
Thanks for the ping @paulirish ✌️
SGTM.
Yeah, for completeness I think it'd be good to be able to set some properties that explain the test environment more deeply. I raised this on #7053 but never took it anywhere. |
oh word! k we'll break off my number 4 into #7053. perfect. |
Thanks for your great work on lighthouse! I've experienced some different scores when running lighthouse on CI than when running locally in regards to the total blocking time. After some research, I think this is due to the I was wondering if there's a way to normalize this behaviour across environments, so the score would be the same, regardless of the machine? Obviously, there would be some minimum CPU requirements, but ideally from there on the result would be the same. I'm not sure if this is somehow possible practically? |
I think you'd be interested in the saga of #9085 and the resulting calibration documentation @amannn :) tl;dr - we tried to do this, but it's very, very difficult and even benchmarks built by dedicated benchmark companies can't predict machine performance well enough to normalize Lighthouse scores, so a single contributor here using 20% of their time won't be able to solve it either :/ |
@patrickhulce Oh right, that calibration guide is really helpful! I definitely understand that this is a hard problem. Thank you for your help! |
An extra check I wanted to add on top of #11779 It was described back in #10910 > the TestedAsMobileDevice logic correctly handles real-mobile-device, but doesn't handle external UA emulation. We could detect there's external UA emulation being applied and throw if we don't see configuration that matches. Or with the proposal implemented, we may just log a warning to let them know we see i We can only check this sort of mismatch after we've gathered the host UA, so it can't be done earlier.
TLDR: The emulation flags are awkward and there's implicit assumptions made. We should fix that and support our varied usecases with first-class settings. Key idea: get rid of
emulatedFormFactor=none
.DevTools, Calibre, and WPT are three lighthouse clients that handle emulation previous to lighthouse running. In DevTools' case, only screen emulation is applied, and lighthouse is expected to apply its own network emulation. And calibre's case, both emulations are applied and the intent is for a lighthouse to not apply double emulation anywhere. LH on WPT supports a few approaches and everyone's been confused at some point.
We introduced the illustrious
internalDisableDeviceScreenEmulation
flag (#9377) to solve this. (However even with this, LH will still overwrite any previously set userAgentOverride). But ifemulatedFormFactor
(#6098) isnone
and external UA emulation is applied, you don't get correct scoring.This is messy and I think that there's an opportunity to completely redefine this configuration to be more clear.
Goals
Starting Proposal
emulatedFormFactor
toformFactor
. This is the key flag and the value must be eithermobile
ordesktop
,none
(néeprovided
) is no longer a valid option. Our perf metrics and 3 SEO metrics change their behavior based on mobile v desktop, so it seems important to make this an explicit user contract.disableScreenEmulation
anddisableNetworkEmulation
.internalDisableDeviceScreenEmulation
. Throw if this oremulatedFormFactor
are used.TestedAsMobileDevice
bool and just use theformFactor
enum of'desktop'|'mobile'
.The combination of these allows us to support the below user stories with clear expectations. It also prevents the case of a using incorrect scoring accidentally.
User stories
I believe we have 4 user stories to support (right?)
formFactor
is set.formFactor
is set via the mobile/desktop radio, andscreenEmulation
is false.formFactor
is set, and bothscreenEmulation: false, throttlingMethod: 'provided'
.emulatedUserAgent
is set as desired.--no-screenEmulation
and--throttling.cpuSlowdownMultiplier=1
. (--formFactor=mobile
is the default already)Extra thoughts and questions
--formFactor=mobile
or do we make it (annoyingly) required?emulated-form-factor=none
. We could also detect a potential double-emulation scenario here and warn to make sure flags are correctly setup.References
disableDeviceEmulation
flag before v5 #7044The text was updated successfully, but these errors were encountered: