Make complexity estimates hold up under gVisor - #76
Merged
Merged
Conversation
In production two of the four reference solutions got the wrong class: runs there carry some 150 ms of fixed cost and CPU time comes in 10 ms steps, so the small runs the fit leaned on were mostly noise. A size now counts once the solution's own time is at least the run's fixed cost, short runs are timed twice and the faster kept, and only the largest sizes are fitted. Two Sum gets one more input size so it clears the floor at three sizes. A result faster than expected no longer reads as a match.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedNext included review available in 21 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch was successfully deployed
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.
What and why
After #75 was deployed, I measured the four reference solutions on the production runner. Two got the wrong class:
Raw timings on the server show why:
The fit gave too much weight to small runs, which were mostly fixed cost and noise. Changes in
app/runner/complexity.py:MIN_MEASURABLE_MS), so an error in that estimate stays a fraction of what's measured.REPEAT_BELOW_SECONDSare timed twice and the faster run is kept, since scheduling only ever adds time. Longer runs aren't repeated, which leaves a slow solution time for one more size.FITTED_POINTSsizes are fitted.Other changes:
ComplexityPanelsays "Faster than the expected" instead of "Matches" when the measured class is below the expected one.Deploying
V14 is a migration. Merge, then run
./infra/deploy.shon the host.How this was verified
complexity.pythree times on the production runner through the real sandbox path (runsc, the problems' own memory limits), with the four reference solutions plus nested-loop Two Sum and triple-loop 3Sum. All 18 results were correct:make test: 141 passed, 6 skipped. It includes the check that every analyzable problem's reference solution measures as expected, which now also runs Two Sum at a million numbers. Web lint and type check pass.