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 d35491424b9d7ab049d0cde60d1af845b1616c49
Author: Boris Faure <[email protected]>
AuthorDate: Fri Nov 6 21:14:55 2026 +0000

    tests/bench: add a REP corpus
    
    No corpus used REP (CSI b), so tybench could not measure a change to
    it. Curses emits it to draw rules and fills when the terminfo entry
    has rep: the corpus is a cursor move, a character, then a REP of it of
    up to a line, with ASCII and box-drawing characters alike.
---
 tests/bench/gen_corpus.py | 23 ++++++++++++++++++++++-
 tests/meson.build         |  3 ++-
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/tests/bench/gen_corpus.py b/tests/bench/gen_corpus.py
index 2b17b088..31b95735 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.
 
-Five workloads, chosen so that a change to one part of the intake path shows up
+Six 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
@@ -16,6 +16,8 @@ in one column rather than being averaged away:
   strings      long OSC titles, sixel DCS, kitty graphics APC and long SGR
                parameter lists. Exercises sequences that span many reads,
                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.
 
 Output is byte-identical across runs (fixed seed, no clock, no locale) so that
 numbers from different days are comparable.
@@ -167,8 +169,27 @@ def gen_strings(target):
     return bytes(out[:cut]) + b"\033[0m\n"
 
 
+def gen_rep(target):
+    """Cursor moves, a character and a REP of it, between short words."""
+    rng = _rng("rep")
+    out = bytearray()
+    cut = 0
+    while len(out) < target:
+        ch = rng.choice("-=_.#* \u2500\u2501\u2550\u2588")
+        seq = "\033[%d;%dH%s\033[%db%s" % (rng.randint(1, 24), rng.randint(1, 10),
+                                         ch, rng.randint(1, 79), rng.choice(WORDS))
+        out += seq.encode("utf-8")
+        # Whole sequences only, as in gen_sgr.
+        if len(out) <= target:
+            cut = len(out)
+    if cut == 0:
+        cut = len(out)
+    return bytes(out[:cut])
+
+
 GENERATORS = {
     "plain-ascii": gen_plain_ascii,
+    "rep": gen_rep,
     "scroll": gen_scroll,
     "sgr": gen_sgr,
     "strings": gen_strings,
diff --git a/tests/meson.build b/tests/meson.build
index bd7a9299..f91af066 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', 'scroll', 'sgr', 'strings', 'unicode'],
+      output: ['plain-ascii', 'rep', 'scroll', 'sgr', 'strings', 'unicode'],
       command: [python3,
                 meson.current_source_dir() / 'bench' / 'gen_corpus.py',
                 '@OUTDIR@'],
@@ -110,6 +110,7 @@ if benchmarks
             tybench,
             args: ['-i', '5',
                    bench_corpus_dir / 'plain-ascii',
+                   bench_corpus_dir / 'rep',
                    bench_corpus_dir / 'scroll',
                    bench_corpus_dir / 'sgr',
                    bench_corpus_dir / 'unicode'],

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

Reply via email to