Re: Convolution based regtest comparison

Han-Wen Nienhuys <[email protected]>
Newsgroups gmane.comp.gnu.lilypond.devel
Message-ID <CAOw_e7aj8hFdipJSJrhhouxU959hp9Z83MwpGaKA79o=xWy4VA@mail.gmail.com>
On Sat, Jun 21, 2025 at 10:54 PM Luca Fascione <[email protected]> wrote:
> Here are some partial timings, taken on my mac laptop (2019, 2,3 GHz 8-Core Intel Core i9),
> all code single-threaded.
>
> Here's the execution log:
>
> Parsing scene '/Users/lukes/Documents/src/undvips/tex/schintro_outline.udps'
> Parse complete 1156.21 ms


This is plenty fast. IIRC, lilypond itself takes about 240s to run
through ~1200 regtests, so as long as time per test is around or below
200ms, we should be fine.

> Missing bits: if people think this idea has merit, we need something to stand in the role of my little UDPS file format. I see a couple different avenues

It doesn't matter too much, but if I may suggest a shade of bikeshed,
something based on json would be nice, so we can easily load data
across languages/systems.

>1. [..] Measure its performance (it seems to fail on GPL Ghostscript 10.05.1, I don't know why at the moment). Regrettably I have no notes on how long this step took when I was last working on this
>
> 2. Alternatively, and possibly much better, pivot and implement a similar idea using mupdf library, but using the PDF directly, sidestepping the PostScript entirely
> 3. Alternatively still, instrument some late layer of ... "Cairo" (say) to emit UDPS directly from the C++

If your PS hack provides final coordinates, I think that will be the
least amount of work. While mupdf is a nice, reading the dicts from
the PDF file is not enough: you still have to write a 2D graphics
stack so you can handle transformations (rotation, scaling,
translation), clipping, coloring etc.

In theory, 3. is also a nice approach, except Cairo doesn't support
this type of instrumentation (at least, I couldn't find any support
for it). You'd have to add a feature to Cairo in order to capture
commands after all the transformations have been applied, and just
before they go onto the raster.

> Lastly, my little test is already built to support multiple pages, and this could be advantageous in that it would save us to run
> all the warmup code over and over again. I guess I'm saying: if we can make it work for the whole set at once we could be looking at

which warmup are you concerned about? Except for font-loads, lilypond
outputs self-contained (e)ps in the ps backend. In cairo, the files
are fully contained. So you have to process the page and font setup
repeated for each file.


--
Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.