-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Move ConPTY to use til::bitmap #5024
Conversation
…so add associated tests.
…support method for checking if rectangle contains another, add test for that too.
…or iterator. Fix unsigned issues for x86.
…hods of all/any/none. also add convenience one() method in prediction of what conpty will be looking for.
…ve it to details namespace.
…e a bitmap already filled. Generalize the bit checking method in the tests.
…it fits nicely into vector emplace, start using bitmap in ConPTY (Vt renderer).
… printing. Update VT tracing to use the same strings. Roll out bitmap through most of VT.
…s and sizes, translation operator on the bitmap. A ton of tests for all that behavior. Replacing the rest of the VT renderer stuff with the invalidation map.
…idation, run codeformat pass.
|
Resolved by
and introduced
for remaining set
|
A choice snippet from
Yep, that's what I broke/fixed. |
Updating the code as follows, fixes this one and the
@DHowett-MSFT, @zadjii-msft, the only thing I didn't expect was the cursor to go back on. It wasn't there before in this test. Is it expected for the cursor to go back on when drawing is done? Under what circumstances should it not do that? |
This one It was looking for
and
Which no longer happen because the invalid region isn't intersecting rectangles anymore. |
…les (inclusive/exclusive bug.) Fix one of the tests to not be comparing to internal details based on a 0-size exclusive circumstance that only worked with or-rect. Fix importing of til for unit tests in the library includes so the WEX/TAEF templates show up appropriately (cascaded to changing renderervt.unittest lib compilation to use shared testing props so it works too.)
Tests all fixed. Still some more inclusive/exclusive juggling (which should be changed, probably in the next PR for DX, to use til objects in the Setting this for real review. I will reply with the perf screenshots in a bit. |
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.
Yea I don't think I have anything to block here. Lemme see those perf screenshots :)
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.
Love it. Seems totally cromulent to me
Old: https://thumbs.gfycat.com/FrigidVictoriousIcelandichorse-mobile.mp4 Not super dramatic anymore now that #4877 is merged... I'll follow up with some WPRs to try to confirm that it's doing less. I also expect we'll need to land the DX side to really see more smoothness here. |
@DHowett-MSFT had a follow up question about start/endpaint. After this change, more time is spent on |
…ments. Taking out the MUL for scaling since it's unused and confusing.
…ompiled this before the last push and it didn't fail.
Hello @miniksa! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
This reverts commit ca33d89.
Correct scrolling invalidation region for tmux in pty w/ bitmap Add tracing for circling and scrolling operations. Fix improper invalidation within AdjustCursorPosition routine in the subsection about scrolling down at the bottom with a set of margins enabled. ## References - Introduced with #5024 ## Detailed Description of the Pull Request / Additional comments - This occurs when there is a scroll region restriction applied and a newline operation is performed to attempt to spin the contents of just the scroll region. This is a frequent behavior of tmux. - Right now, the Terminal doesn't support any sort of "scroll content" operation, so what happens here generally speaking is that the PTY in the ConHost will repaint everything when this happens. - The PTY when doing `AdjustCursorPosition` with a scroll region restriction would do the following things: 1. Slide literally everything in the direction it needed to go to take advantage of rotating the circular buffer. (This would force a repaint in PTY as the PTY always forces repaint when the buffer circles.) 2. Copy the lines that weren't supposed to move back to where they were supposed to go. 3. Backfill the "revealed" region that encompasses what was supposed to be the newline. - The invalidations for the three operations above were: 1. Invalidate the number of rows of the delta at the top of the buffer (this part was wrong) 2. Invalidate the lines that got copied back into position (probably unnecessary, but OK) 3. Invalidate the revealed/filled-with-spaces line (this is good). - When we were using a simple single rectangle for invalidation, the union of the top row of the buffer from 1 and the bottom row of the buffer from 2 (and 3 was irrelevant as it was already unioned it) resulted in repainting the entire buffer and all was good. - When we switched to a bitmap, it dutifully only repainted the top line and the bottom two lines as the middle ones weren't a consequence of intersect. - The logic was wrong. We shouldn't be invalidating rows-from-the-top for the amount of the delta. The 1 part should be invalidating everything BUT the lines that were invalidated in parts 2 and 3. (Arguably part 2 shouldn't be happening at all, but I'm not optimizing for that right now.) - So this solves it by restoring an entire screen repaint for this sort of slide data operation by giving the correct number of invalidated lines to the bitmap. ## Validation Steps Performed - Manual validation with the steps described in #5104 - Automatic test `ConptyRoundtripTests::ScrollWithMargins`. Closes #5104
🎉 Handy links: |
Summary of the Pull Request
Moves the ConPTY drawing mechanism (
VtRenderer
) to use the fine-grainedtil::bitmap
individual-dirty-bit tracking mechanism instead of coarse-grained rectangle unions to improve drawing performance by dramatically reducing the total area redrawn.PR Checklist
Detailed Description of the Pull Request / Additional comments
GetDirtyArea()
interface fromIRenderEngine
to use a vector oftil::rectangle
instead of theSMALL_RECT
to banhammer inclusive rectangles.VtEngine
now holds and operates on thetil::bitmap
for invalidation regions. All invalidation operation functions that used to be embedded insideVtEngine
are deleted in favor of using the ones intil::bitmap
.VtEngine
tracing to use newtil::bitmap
on trace and the newto_string()
methods detailed below.til::bitmap
and complementary tests.til::bitmap
was set to 0,0,0,0 by default which means that|=
on it with eachset()
operation was stretching the rectangle from 0,0. Now it's astd::optional
so it has no value after just being cleared and will build from whatever the first invalidated rectangle is. Complementary tests added.til::bitmap
in theruns()
method since both VT and DX renderers will likely want to generate the set of runs at the beginning of a frame and refer to them over and over through that frame. Saves the iteration and creation and caches insidetil::bitmap
where the chance of invalidation of the underlying data is known best. It is still possible to iterate manually withbegin()
andend()
from the outside without caching, if desired. Complementary tests added.til::bitmap
and used in tests.translate()
method fortil::bitmap
which will slide the dirty points in the direction specified by atil::point
and optionally back-fill the uncovered area as dirty. Complementary tests added.til
typessize
,point
,rectangle
, andsome
into ato_string
method on each object such that it can be used in both ETW tracing scenarios AND in the TAEF templates uniformly. Adds a similar method forbitmap
._bitmap_const_iterator
such that it appears as a valid Input Iterator to STL collections and can be used in astd::vector
constructor as a range. Adds and cleans up operators on this iterator to match the theoretical requirements for an Input Iterator. Complementary tests added.til
which will allow some basic math operations (+, -, *, /) betweentil::size
andtil::point
and vice versa. Complementary tests added. Complementary tests added.til::rectangle
to allow scaling with basic math operations (+, -, *) versustil::size
and translation with basic math operations (+, -) againsttil::point
. Complementary tests added.til
objects. Complementary tests added.Validation Steps Performed