Discussion:
[tex-k] Output of TL's cweave is incompatible with Knuth's cweave
Igor Liferenko
2016-05-15 02:05:00 UTC
Permalink
Hi all,

For example, 'bdd14.idx' from Knuth's example programs has swapped
index entries for 'verbose' and 'Verbose' with TL's cweave.

Steps to reproduce:

wget http://www-cs-faculty.stanford.edu/~uno/programs/bdd14.w
cweave bdd14.w
cp bdd14.idx bdd14.idx-TL

Now change hash_size from 8501 to 353 (both in common.w and cweave.w),
recompile and do this:

cweave bdd14.w
cp bdd14.idx bdd14.idx-DEK

See the difference:
diff bdd14.idx-DEK bdd14.idx-TL

Not sure if it is a bug in cweb.
I propose to leave hash_size 353 by default in TL's cweb - this will
work just fine in all cases.

Regards,
Igor
Karl Berry
2016-05-18 22:56:05 UTC
Permalink
Hi Igor,

Thanks for the report, as always.

For example, 'bdd14.idx' from Knuth's example programs has swapped
index entries for 'verbose' and 'Verbose' with TL's cweave.
...
Now change hash_size from 8501 to 353 (both in common.w and cweave.w),

I haven't looked into the code, but it sure seems like a bug to me that
the size of the hash table should affect the index output. Not
necessarily a bug for Knuth, but a bug. Added to the list ...

I propose to leave hash_size 353 by default in TL's cweb -

I suppose that lookups in longer hash chains are surely irrelevant on
today's computers, so there's no real reason to change from Knuth's
value. On the other hand the results "should" be the same regardless of
hash size.

Also, FYI, there is no principle that TL's cweb should be identical to
Knuth's. Indeed, I intend to look into using Andreas Scherer's cwebbin
(http://ctan.org/pkg/cwebbin) in TL, I just didn't manage to get to it
this year. (I miss you Peter!!)

Knuth told me explicitly that it was fine with him if TL's cweb was
enhanced with whatever "upward compatible" changes, such as Andreas has
worked on. Any changes are likely to cause discrepancies with his
original, and this will not be a bug in either his code or the new code ...

Happy hacking,
Karl

Loading...