-
Notifications
You must be signed in to change notification settings - Fork 26
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
benchmark baseline check
doesn't respect threshold-tolerances when checking baseline against static thresholds
#275
Comments
@hassila I'm writing some real benchmarks now, and the benchmarks target needs to depend on a big monolithic target. While I see this as mostly a Swift/SwiftPM problem that builds take soooo long, I also notice that the benchmark package doesn't need to build the benchmarking target the second time as we're checking static thresholds vs already-calculated baselines. So hopefully there can be a command or something so "check" can skip building or running anything at all, and only perform checks with what is saved on disk. |
Yes, it is a known problem unfortunately: swiftlang/swift-package-manager#7210 Would be great if you can ping in that issue and explain the issue above - maybe we can add a "--skip-build" to work around it (but it really should be done by SwiftPM, we just use the official API and it rebuilds always...). |
Sure, but I'm skeptical about when will SwiftPM maintainers get to any issues. As always I'm open to submitting a PR if needed. |
It is a bit tricky, as we use the build to also get us the paths to the resulting built executables - which are needed. I tried a quick and dirty I am open to suggestions/PR:s (still worth pinging in the case though, I do think the more noise there is about something, the more likely it is to be fixed... The squeaky wheel gets the grease.) |
This issue should be fixed by #284 now, if you can please have a go testing against that (it will be merged fairly soon). |
swift package --disable-sandbox \
benchmark thresholds check \
"${{ github.head_ref || github.ref_name }}" \
--check-absolute-path $PWD/Benchmarks/Thresholds/ \
--no-progress \
--format markdown did still build the benchmarks, unlike |
It needs to build the benchmarks for the |
For what it's worth this issue is resolved now. Also, for some reason, using: swift package --disable-sandbox \
benchmark baseline update \
"${{ github.head_ref || github.ref_name }}"
swift package --disable-sandbox \
benchmark thresholds check \
"${{ github.head_ref || github.ref_name }}" \
--path $PWD/Benchmarks/Thresholds/ \
--no-progress \
--format markdown No longer builds the whole benchmarks target twice. |
Glad to hear it is working better now - the build is a bit of a mystery of swiftpm I think - it should only rebuild what's needed between runs. Are there any differences on os/runtime environments between your tests when it failed vs now? Should try to nail down the related swiftpm bug probably - maybe this can help track down some more info. |
Not really no environment differences. |
Perhaps - I haven't nailed down exactly when it rebuilds, just that it's way too often. Happy to hear results if your try it. |
But maybe close this issue then and we can discuss the builds separately? |
I mean we can even close this issue and keep talking 😛 |
@hassila I couldn't find out why SwiftPM is deciding to not totally build the benchmark target from the ground up. Right now, majority of the times it won't re-build the whole target. But sometimes it does. Even with no code changes (e.g. rerunning the same GitHub Action can result in a different behavior... perhaps the .build cache was updated and caused the different behavior). I did try removing |
Yeah... thanks for trying - hope eventually figuring it out to try to fix root cause... |
@hassila This "caching sometimes works and sometimes not" situation is flaky enough that I decided to not rely on it and just only do 1 check instead of running comparison, then reading result, then doing the check. |
This is also why I've filed this issue: #288 |
@hassila interesting observation: It's been a few days I've added Also for the record, using |
Hmm, that is weird - if that is correct, it would imply that building in debug somehow invalidates the release build - we're just calling into the SwiftPM API and ask for a release build (and all normal caching should happen...). |
@hassila right ... this is definitely a bug somewhere ...
It would have been nice if it was that simple. The problem is it isn't consistent in invalidating the release build either. Or at least i haven't noticed the pattern. Just to confirm, |
benchmark baseline check
doesn't respect threshold-tolerances when checking already-acquired baseline which is on disk, against static thresholds.json
files.Apparently it's because the benchmarks are not loaded so the tool falls back to the strict threshold-tolerances.
This makes our benchmarks fail even though we have less than 1% and 100ms of fluctuations.
The text was updated successfully, but these errors were encountered: