Repository navigation
test(motion): a retarget behind a block fails by name when starved #10784
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ import { | |
| countBetween, | ||
| markElement, | ||
| pageTimesOnControls, | ||
| requireFrames, | ||
| startBusyControl, | ||
| startScreencast, | ||
| traceRendering, | ||
|
|
@@ -907,15 +908,16 @@ for (const how of ['in a task', 'in a frame callback of the page'] as const) { | |
| ahead: second, | ||
| controlStarts: [controlStart, secondStart], | ||
| }); | ||
| const timed = tracked.flatMap(f => { | ||
| const dated = tracked.flatMap(f => { | ||
| const at = pageTime.get(f.t); | ||
| if (f.box == null || at == null) { | ||
| return []; | ||
| } | ||
| return at >= run.call - 50 && at <= run.end + 150 | ||
| ? [{x: f.box.x - MARKER_INSET, at}] | ||
| : []; | ||
| return [{x: f.box.x - MARKER_INSET, at}]; | ||
| }); | ||
| const timed = dated.filter( | ||
| ({at}) => at >= run.call - 50 && at <= run.end + 150, | ||
| ); | ||
| // The frames fit the first curve up to a start at or after the block's | ||
| // end. After that start, they fit a spring from the value and the velocity | ||
| // on screen there. `skip` fits the same frames to the call's own clock | ||
|
|
@@ -981,15 +983,33 @@ for (const how of ['in a task', 'in a frame callback of the page'] as const) { | |
| description: JSON.stringify({read, timed}), | ||
| }); | ||
| // The compositor showed the first curve through the block, and the frames | ||
| // after it show the call. | ||
| expect(read.inBlock, JSON.stringify(read)).toBeGreaterThanOrEqual(3); | ||
| expect(read.after, JSON.stringify(read)).toBeGreaterThanOrEqual(3); | ||
| // after it show the call. A loaded runner can present no frame for over | ||
| // 100 ms after the block. Too few frames there cannot tell the call's | ||
| // clock from the screen's, so such a run fails by name, with its gaps. | ||
| // The gaps are read on the controls' clock, past the window's edges too. | ||
| const onClock = dated.map(({x, at}) => ({t: at, x})); | ||
| requireFrames(onClock, { | ||
| min: 3, | ||
| during: 'the first curve played through the block', | ||
| where: frame => frame.t > run.call && frame.t < run.end, | ||
| }); | ||
| requireFrames(onClock, { | ||
| min: 3, | ||
| during: 'the call played in the 130 ms after the block', | ||
| where: frame => frame.t > run.end + 20 && frame.t <= run.end + 150, | ||
| }); | ||
| // Within 4 px everywhere: the marker and the controls are read at whole | ||
| // px, so each read adds up to a px. | ||
| expect(read.worst, JSON.stringify(read)).toBeLessThanOrEqual(4); | ||
| expect( | ||
| read.worst, | ||
| `the frames miss the call, started at a frame after the block from the value and the velocity on screen there, by ${read.worst.toFixed(1)} px (at most 4 px): ${JSON.stringify(read)}`, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking: `the frames miss the call, started at a frame after the block from the value and the velocity on screen there, by ${read.worst.toFixed(2)} px (at most 4 px): ${JSON.stringify(read)}`, |
||
| ).toBeLessThanOrEqual(4); | ||
| // The call's own clock misses the same frames by far more, so the case | ||
| // tells the two apart. | ||
| expect(read.skip, JSON.stringify(read)).toBeGreaterThan(20); | ||
| expect( | ||
| read.skip, | ||
| `the call's own clock fits the same frames within ${read.skip.toFixed(1)} px, so the case cannot tell the two apart (it needs over 20 px): ${JSON.stringify(read)}`, | ||
| ).toBeGreaterThan(20); | ||
| }); | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking:
onClockkeeps the cast's stamp order, but itstis the controls' clock. Under load, a frame stamped late sits after frames it came before, andrequireFramesreads gaps between array neighbours, so the reported longest gap can grow: frames at 5, 30, 47 and 160 ms after the block report 113 ms in time order and 130 ms when the frame at 30 is stamped late. The frame count and the pass or fail do not change.inPresentationOrderis already exported by the harness.