Repository navigation
Reduce terminal test overhead while preserving full parity checks - #25151
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe terminal oracle now compares buffer ranges directly and formats only the first differing row. Parity tests queue terminal chunks in FIFO order and wait for parser completion. The frame-chunking reference caches measured byte lengths for repeated code points. A report records hosted timing comparisons and parity evidence. Priority: ⬇️ Low Estimated code review effort: Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established for these test-support changes. Merge after the required CI checks pass. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 6 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- In-place grid comparison —
serialize-grid-cell-descriptors.tsreplaces thebufferRows+compareRowSetsstring-array path withcompareBufferRows, which reuses one scratchCellper buffer, trims trailing blank rows, and formats only the first differing row. AsameCellFieldsfast path skips descriptor construction when public cell getters agree and falls back to the frozencellDescriptorpolicy on any difference or clipping. - Callers migrated —
serialize-grid-roundtrip.tsupdated to the new 8-argument signature; the old exports have no remaining consumers. - Batched parity writes —
writeChunksToTerminalqueues every chunk and resolves on the finalwritecallback instead of awaiting each chunk. - Frame oracle memoization — the legacy splitter caches pure per-part byte counts; an algebra-only test that never invoked production was deleted.
- Tests — the serializer tests now validate
compareBufferRowsagainst the frozen allocating oracle with flag-loss / blank / clipped / color-policy controls, and a new file covers the batched writer (FIFO order, empty batch, async OSC barrier, serial equivalence).
The fast path was traced field-by-field against cellDescriptor (including blank-cell, inverse-foreground, and clipping gates) and the installed @xterm/headless cell semantics — no case where sameCellFields returns true while the descriptors differ. The deleted frame test was genuinely tautological: reaching the chunk loop already guarantees rawLength === data.length, making shouldDelayFinalSeq unreachable. The new tests can fail: a fast path that missed a real difference would return null while expectComparisonParity asserts equality against the non-null frozen oracle diff.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

ELI5
Terminal regression tests spend less time allocating cell descriptions and waiting between input chunks. Three hosted comparisons retain their meaningful checks and reduce complete focused invocations by 25.6–77.5%.
What Changed
Compare serializer cells in place and format the first differing row for diagnostics. Queue every original parity-test chunk in order and await the final parser callback. Memoize the independent legacy frame oracle's byte measurements. Remove its algebra-only case, which never called production.
Why
These are measured costs in our slowest CI tests. Reusing scratch cells and parser scheduling preserves seeds, chunk boundaries, full buffers and failure detection. The frame case we removed still passed when its production generator always threw.
Linked Issue
N/A — internal CI optimization.
Visual Proof
N/A — test support only; application behavior is unchanged.
Testing
Review
Cell comparison retains the original effective-color/blank/clipped policy and exact first-mismatch diagnostics. Scratch cells stay local. The parity helper waits through asynchronous parser continuation; independent terminal completion order is handled only when comparing capture records.
Agent skill upstream boundary
Checklist