[tex-k] mf.ch Issue
mail at timstadelmann.de
Fri Aug 6 08:24:21 CEST 2021
I’ve re-implemented a number of algorithms used in Metafont for a - still incomplete - personal computer graphics project. In this context,
I use the mf program as a reference implementation for semi-automated testing. This has been quite helpful for quickly narrowing down bugs in my code. However, I got stuck finding the root cause for occasional small deviations in pen generation until I resigned to using a debugger on the c file generated by web2c to compare intermediate values and spotted the missing term in mf instead.
I have not looked into the trap test. However, it seems plausible that it might have missed the issue. For most inputs, the generated pens are either identical or differ only in the choice of the starting point of the list, which would not have an effect on the final raster output. Only for a small subset of inputs the actual point positions differ. Depending on the stroked path the raster output could still be identical.
> Am 06.08.2021 um 01:14 schrieb Karl Berry <karl at freefriends.org>:
> Tim, thank you very much for the report. I'm very impressed that you
> found this! How did you discover it? Are you actually using Metafont to
> the extent of examining precise pixel output?
> I suspect this is not intentional.
> You're right that it's not intentional. (Based on the formatting of the
> code, I think I'm the one who made that change, 30+ years ago. I even
> very vaguely remember it coming up.)
> I am somewhat surprised that the trap test did not catch this mistake.
> I'll investigate and perhaps report that to Knuth.
> I suspect the problem with limited preprocessor argument lengths is long
> gone. I'll try eliminating the change and we'll see. --thanks much, karl.
More information about the tex-k