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. |
zadjii-msft
left a comment
There was a problem hiding this comment.
Yea I don't think I have anything to block here. Lemme see those perf screenshots :)
DHowett-MSFT
left a comment
There was a problem hiding this comment.
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::bitmapindividual-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 fromIRenderEngineto use a vector oftil::rectangleinstead of theSMALL_RECTto banhammer inclusive rectangles.VtEnginenow holds and operates on thetil::bitmapfor invalidation regions. All invalidation operation functions that used to be embedded insideVtEngineare deleted in favor of using the ones intil::bitmap.VtEnginetracing to use newtil::bitmapon trace and the newto_string()methods detailed below.til::bitmapand complementary tests.til::bitmapwas 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::optionalso it has no value after just being cleared and will build from whatever the first invalidated rectangle is. Complementary tests added.til::bitmapin 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::bitmapwhere 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::bitmapand used in tests.translate()method fortil::bitmapwhich will slide the dirty points in the direction specified by atil::pointand optionally back-fill the uncovered area as dirty. Complementary tests added.tiltypessize,point,rectangle, andsomeinto ato_stringmethod 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_iteratorsuch that it appears as a valid Input Iterator to STL collections and can be used in astd::vectorconstructor as a range. Adds and cleans up operators on this iterator to match the theoretical requirements for an Input Iterator. Complementary tests added.tilwhich will allow some basic math operations (+, -, *, /) betweentil::sizeandtil::pointand vice versa. Complementary tests added. Complementary tests added.til::rectangleto allow scaling with basic math operations (+, -, *) versustil::sizeand translation with basic math operations (+, -) againsttil::point. Complementary tests added.tilobjects. Complementary tests added.Validation Steps Performed