Skip to content

Full-display erases repeatedly visit cleared predecessor rows #199

Done

Description

@tony

Summary

On #149, a full-display erase checks incoming wraps separately for rows whose predecessor was just cleared. The extra work is visible on redraw-heavy streams. The history-boundary correction in #153 must still hold.

Reproduction

  1. At the source PR head, run the same byte stream through the public terminal and count predecessor checks.
uv run python - <<'PY'
from cProfile import Profile
from pstats import Stats
from libvt import Terminal

term = Terminal(rows=24, cols=80)
redraw = b"\x1b[H" + b"row0 " * 14 + b"\x1b[0K\r\n" + b"row1 " * 14 + b"\x1b[1K\x1b[2J"
with Profile() as profile:
    term.feed(redraw * 400)
print(sum(v[0] for fn, v in Stats(profile).stats.items() if fn[2] == "_sever_incoming_wrap"))
PY

Expected

Full-row erases handle the boundary with surviving content once and preserve wrap links, protected cells and snapshot isolation wherever they still matter.

Actual

The probe records 10,000 calls. Seven shuffled single-CPU rounds measured 4.48 MiB/s on master, 3.75 on #149, and 3.85 on #193. These measurements cover the byte stream above.

Environment

Benchmark conditions

Linux aarch64, CPython 3.13.14, 80 columns by 24 rows, one pinned CPU, measurements after warm-up. The integrated head was 4c0bf02.

References

The repeated checks enter in the row clearing change. #153 tracks incoming history wraps and #149 owns the correction. Preserve selective DEC erases, wide-cell boundaries, BCE and held frames. Measure partial erases and unchanged print paths as controls.

Activity

  1. added
    bug
    p2
    area:core
    topic:performance
    python
    on Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugp2pythontopic:performance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions