This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch tymux-10-quiet-head
in repository terminology.

View the commit online.

commit 093ea52e0e5ceeca8590ba8613d6b0e3734394dc
Author: Boris Faure <[email protected]>
AuthorDate: Fri Nov 6 22:10:43 2026 +0000

    tests/bench: add a fill corpus
    
    No corpus used DECFRA or DECALN, so tybench could not measure a change
    to the rectangle and screen fills. The corpus is DECFRA rectangles of
    random size, under default, palette and 256-colour backgrounds since
    DECFRA keeps each cell's colours, with a DECALN now and then.
---
 tests/bench/gen_corpus.py | 29 ++++++++++++++++++++++++++++-
 tests/meson.build         |  3 ++-
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/tests/bench/gen_corpus.py b/tests/bench/gen_corpus.py
index 31b95735..55599a03 100644
--- a/tests/bench/gen_corpus.py
+++ b/tests/bench/gen_corpus.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 """Generate deterministic benchmark corpora for tybench.
 
-Six workloads, chosen so that a change to one part of the intake path shows up
+Seven workloads, chosen so that a change to one part of the intake path shows up
 in one column rather than being averaged away:
 
   plain-ascii  long lines of printable ASCII, almost no escapes. The pure
@@ -18,6 +18,8 @@ in one column rather than being averaged away:
                to be benchmarked with a small --chunk.
   rep          a character then REP (CSI b), as curses draws rules and fills
                when terminfo has rep. Exercises the REP expansion.
+  fill         DECFRA rectangles under default and set colours, and DECALN.
+               Exercises the rectangle and screen fills.
 
 Output is byte-identical across runs (fixed seed, no clock, no locale) so that
 numbers from different days are comparable.
@@ -187,7 +189,32 @@ def gen_rep(target):
     return bytes(out[:cut])
 
 
+def gen_fill(target):
+    """DECFRA rectangles, some under an SGR colour, a DECALN now and then."""
+    rng = _rng("fill")
+    out = bytearray()
+    cut = 0
+    while len(out) < target:
+        if rng.random() < 0.05:
+            seq = "\033#8"
+        else:
+            top, left = rng.randint(1, 24), rng.randint(1, 80)
+            sgr = rng.choice(["\033[0m", "\033[0;%dm" % rng.randint(31, 37),
+                              "\033[0;48;5;%dm" % rng.randint(0, 255)])
+            seq = "%s\033[%d;%d;%d;%d;%d$x" % (sgr, rng.randint(33, 126), top, left,
+                                              rng.randint(top, 24),
+                                              rng.randint(left, 80))
+        out += (seq + rng.choice(WORDS)).encode("ascii")
+        # Whole sequences only, as in gen_sgr.
+        if len(out) <= target:
+            cut = len(out)
+    if cut == 0:
+        cut = len(out)
+    return bytes(out[:cut]) + b"\033[0m\n"
+
+
 GENERATORS = {
+    "fill": gen_fill,
     "plain-ascii": gen_plain_ascii,
     "rep": gen_rep,
     "scroll": gen_scroll,
diff --git a/tests/meson.build b/tests/meson.build
index f91af066..7aaba949 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -99,7 +99,7 @@ if benchmarks
   # generator is deterministic so the bytes are reproducible. It writes to
   # @OUTDIR@ so that what it produces is what 'output' declares.
   bench_corpus = custom_target('bench-corpus',
-      output: ['plain-ascii', 'rep', 'scroll', 'sgr', 'strings', 'unicode'],
+      output: ['fill', 'plain-ascii', 'rep', 'scroll', 'sgr', 'strings', 'unicode'],
       command: [python3,
                 meson.current_source_dir() / 'bench' / 'gen_corpus.py',
                 '@OUTDIR@'],
@@ -109,6 +109,7 @@ if benchmarks
   benchmark('pty-intake',
             tybench,
             args: ['-i', '5',
+                   bench_corpus_dir / 'fill',
                    bench_corpus_dir / 'plain-ascii',
                    bench_corpus_dir / 'rep',
                    bench_corpus_dir / 'scroll',

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to