Stabilize TUI diff pipeline test layout synchronization#13678
Draft
warp-dev-github-integration[bot] wants to merge 1 commit into
Draft
Stabilize TUI diff pipeline test layout synchronization#13678warp-dev-github-integration[bot] wants to merge 1 commit into
warp-dev-github-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Oz <oz-agent@warp.dev>
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.
Description
Stabilizes
diff_pipeline_computes_added_lines_and_ghost_blocksby synchronizing the assertion with completion of the asynchronous ghost-block layout.Root cause
expand_diffscomputes the removed-line temporary blocks synchronously, butRenderState::add_temporary_blocksonly enqueues aLayoutTemporaryBlockaction. The char-cell render state's ghost list is updated later when the layout channel processes that action.The test previously polled the ghost list for at most 100
yield_now()calls. Yielding gives other tasks an opportunity to run, but it does not establish that the queued layout action has completed. Under scheduler contention, the loop could exhaust its arbitrary iteration budget while the ghost list was still empty, producing the intermittentleft: 0, right: 1assertion. This is a test synchronization race, not an incorrect diff result.Fix
Subscribe to
CodeEditorModelEvent::LayoutInvalidatedbefore expanding the diff, and resolve a one-shot waiter only when the corresponding render-state snapshot contains ghost blocks. The assertion now has a state-based completion condition instead of a scheduler-dependent polling budget.Linked Issue
No linked issue; this addresses a reported CI flake.
ready-to-specorready-to-implement.Testing
Baseline contention reproduction: 512 exact test runs at concurrency 8; 150 failed with an empty ghost list.
Fixed contention verification: 512 exact test runs at concurrency 8; all passed.
cargo test -p warp_tui diff_pipeline_computes_added_lines_and_ghost_blocks -- --test-threads=1cargo test -p warp_tui --lib(102 passed)cargo clippy -p warp_tui --all-targets --tests -- -D warningscargo fmt --all -- --checkI have manually tested my changes locally with
./script/run(test-only change)Agent Mode
CHANGELOG-NONE
Conversation: https://staging.warp.dev/conversation/82e4d2ed-5e41-49ea-92bd-dc043589797a
Run: https://oz.staging.warp.dev/runs/019f5d59-a819-7a86-bfd1-18060a7b68f9
Co-Authored-By: Oz oz-agent@warp.dev
This PR was generated with Oz.