Re: [NTG-context] Re: TeX run : 8
Hi Patrick,
Patrick Gundlach
Hello again,
I have tried your small file (the one you have sent me) an a vanilla tetex 3.0 and an older texlive (I had to dig out my iBook -- anybody wants to buy a used iBook?) and both were two runs.
Ah, not so fast, Patrick. I can reproduce your problem:
$ ls -lR .: total 4 drwxr-xr-x 4 pg pg 136 Mar 2 20:27 PARTS -rw-r--r-- 1 pg pg 117 Mar 2 20:28 TEST.tex
./PARTS: total 8 -rw-r--r-- 1 pg pg 40 Mar 2 20:27 ONE.tex -rw-r--r-- 1 pg pg 40 Mar 2 20:27 TWO.tex
(so setup is TEST.tex in all capitals and ONE.tex and TWO.tex in subdir, tetex 3.0). Now I run
texexec --pdf test.tex
(lowercase test.tex !)
and I get:
[...]
utility file analysis : another run needed TeX run : 8
[...]
Note that the standard OS X filesystem is case preserving, but not case sensitive when accessing a file. So accessing test.tex would be happy with a file called TEST.tex. It is possible to create a pure case sensitive HFS+ filesystem, but it isn't necessary to reproduce the problem. (It would probably avoid it, though).
Patrick
So I made a new setup: new files/folders and every names lowercase (folders, files, references). The first time I executed texexec --pdf test.tex it looked good: 2 runs! Then I executed texexec --pdf test.tex once more and now it was 8 runs again! Does this make sense? Steffen
Hello Steffen, it is starting to make fun! ok, clean setup, all lowercase. 8 runs. Now texutil --purgeall. 2 runs. purge again. 8 runs. purge again. 2 runs. No purge. 8 runs. Purge. 8 runs. 2 runs. purge. 4 runs (!!!). purge. 2 runs. purge. 8 runs. 3 runs. purge. 5 runs. purge. 5 runs. purge. 8 runs. -> 8, 2, 8, 2, 8, 8, 2, 4, 2, 8, 3, 5, 5, 8 I'll stop here. This looks a bit like the fibonacci numbers to me, but the 4 must be an error. Is it full moon? Patrick (no need to put me in cc anymore, I woke up)
Patrick Gundlach wrote:
ok, clean setup, all lowercase. 8 runs. Now texutil --purgeall. 2 runs. purge again. 8 runs. purge again. 2 runs. No purge. 8 runs. Purge. 8 runs. 2 runs. purge. 4 runs (!!!). purge. 2 runs. purge. 8 runs. 3 runs. purge. 5 runs. purge. 5 runs. purge. 8 runs.
-> 8, 2, 8, 2, 8, 8, 2, 4, 2, 8, 3, 5, 5, 8
can you patch texexec to provide some info about the file compare? (filesizes or so) what puzzles me is that the tui/tuo does not change Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hello Hans, [...]
can you patch texexec to provide some info about the file compare? (filesizes or so)
done, see attachment.
what puzzles me is that the tui/tuo does not change
the .tuo file changes. % TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004 / Files % % parts/one.tex (2) % parts/two.tex (2) % test (2) % TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004 / Files % % parts/two.tex (2) % parts/one.tex (2) % test (2) % TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004 / Files % % parts/two.tex (2) % test (2) % parts/one.tex (2) % TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004 / Files % % parts/two.tex (2) % test (2) % parts/one.tex (2) Patrick -- ConTeXt wiki: http://contextgarden.net
Patrick Gundlach wrote:
Hello Hans,
[...]
can you patch texexec to provide some info about the file compare? (filesizes or so)
done, see attachment.
now this is weird! % parts/one.tex (2) % parts/two.tex (2) % test (2) % parts/two.tex (2) % parts/one.tex (2) % test (2) % parts/two.tex (2) % test (2) % parts/one.tex (2) it looks like some flushing problem of write nodes, can you do the same with the tui file? the code in context that does this is: \def\registerfileinfo[#1#2]#3% {\writestatus\m!systems{#1#2 file #3 at line \the\inputlineno}% \immediatewriteutility{f #1 {#3}}} does it run ok when you define this as: \def\registerfileinfo[#1]#2{} if so, it may be a problem in the tex binary (immediate writes not flushed ok) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hello Hans, do you still want me to try this?
it looks like some flushing problem of write nodes, can you do the same with the tui file?
the code in context that does this is:
\def\registerfileinfo[#1#2]#3% {\writestatus\m!systems{#1#2 file #3 at line \the\inputlineno}% \immediatewriteutility{f #1 {#3}}}
does it run ok when you define this as:
\def\registerfileinfo[#1]#2{}
if so, it may be a problem in the tex binary (immediate writes not flushed ok)
-- ConTeXt wiki: http://contextgarden.net
Patrick Gundlach wrote:
do you still want me to try this?
not if we assume that indeed perl hashes are organized differently per run so, for the moment let stick to the texutil sort patch thanks for testing; i'll post a new beta later Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hi, I don't know enough of perl, perhaps the hash %Files should be sorted before output (texutil.pl)? sub FlushFiles { print TUO "%\n" . "% $Program / Files\n" . "%\n" ; foreach $File (keys %Files) { print TUO "% $File ($Files{$File})\n" } Patrick -- ConTeXt wiki: http://contextgarden.net
I think you've nailed it. Nice debugging! Taco Patrick Gundlach wrote:
Hi,
I don't know enough of perl, perhaps the hash %Files should be sorted before output (texutil.pl)?
sub FlushFiles { print TUO "%\n" . "% $Program / Files\n" . "%\n" ; foreach $File (keys %Files) { print TUO "% $File ($Files{$File})\n" }
Patrick
Hello again,
I don't know enough of perl, perhaps the hash %Files should be sorted before output (texutil.pl)?
good point, Patrick :-) this does the trick: sub FlushFiles { print TUO "%\n" . "% $Program / Files\n" . "%\n" ; foreach $File (sort keys %Files) { print TUO "% $File ($Files{$File})\n" } print TUO "%\n" ; $NOfFiles = keys %Files ; (in texutil.pl, see the _sort_ keys %Files) But I don't know if this is a good solution. Patrick (no more "8 runs") -- ConTeXt wiki: http://contextgarden.net
Patrick Gundlach wrote:
Hi,
I don't know enough of perl, perhaps the hash %Files should be sorted before output (texutil.pl)?
sub FlushFiles { print TUO "%\n" . "% $Program / Files\n" . "%\n" ; foreach $File (keys %Files) { print TUO "% $File ($Files{$File})\n" }
That could be a way out, but before that i want you to check the order in the tui files. [if it's indeed the perl hash, (maybe i should make it an array), then it looks like perl uses a different hash strategy each run and on each os] Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
At Thu, 03 Mar 2005 12:59:18 +0100, Hans Hagen wrote:
[if it's indeed the perl hash, (maybe i should make it an array), then it looks like perl uses a different hash strategy each run and on each os]
Indeed, perl 5.8.1 introduced randomised hash functions to avoid the "hash collision" attacks that were being published at the time. You can never assume hash traversal order will be constant across different hashes. See the discussion in the beginning of `perldoc perl581delta' (and a followup in perl582delta). -- - Gus
Thursday, March 3, 2005 Hans Hagen wrote:
Patrick Gundlach wrote:
Hi,
I don't know enough of perl, perhaps the hash %Files should be sorted before output (texutil.pl)?
sub FlushFiles { print TUO "%\n" . "% $Program / Files\n" . "%\n" ; foreach $File (keys %Files) { print TUO "% $File ($Files{$File})\n" }
That could be a way out, but before that i want you to check the order in the tui files.
[if it's indeed the perl hash, (maybe i should make it an array), then it looks like perl uses a different hash strategy each run and on each os]
http://search.cpan.org/~nwclark/perl-5.8.6/pod/perlfaq4.pod#Data:_Hashes_(As...) -- Giuseppe "Oblomov" Bilotta
Giuseppe Bilotta wrote:
[if it's indeed the perl hash, (maybe i should make it an array), then it looks like perl uses a different hash strategy each run and on each os]
The most relevant bit of documentation is this: http://search.cpan.org/dist/perl/pod/perl581delta.pod#Hash_Randomisation So yes, it is perl, and it is on purpose. There might be more locations in ConTeXt's perl scripts that need an additional 'sort'. Greetings, Taco
On Fri, 4 Mar 2005, Taco Hoekwater wrote:
Giuseppe Bilotta wrote:
[if it's indeed the perl hash, (maybe i should make it an array), then it looks like perl uses a different hash strategy each run and on each os]
The most relevant bit of documentation is this:
http://search.cpan.org/dist/perl/pod/perl581delta.pod#Hash_Randomisation
So yes, it is perl, and it is on purpose.
There might be more locations in ConTeXt's perl scripts that need an additional 'sort'.
Hello, for those, who don't want to update: export PERL_HASH_SEED=0 in $HOME/.profile works very nicely. Greetings, Peter -- http://pmrb.free.fr/contact/
Hello Peter,
for those, who don't want to update: export PERL_HASH_SEED=0 in $HOME/.profile works very nicely.
is this reliable? Patrick -- ConTeXt wiki: http://contextgarden.net
On Tue, 8 Mar 2005, Patrick Gundlach wrote:
for those, who don't want to update: export PERL_HASH_SEED=0 in $HOME/.profile works very nicely.
is this reliable?
It seems to me. At least on Linux: since a long time I've been used to get always 8 runs with my procuct-files, and now I get only 1 or 2 runs. Cheers, Peter -- http://pmrb.free.fr/contact/
participants (7)
-
Angus Lees
-
Giuseppe Bilotta
-
Hans Hagen
-
Patrick Gundlach
-
Peter Münster
-
Steffen Wolfrum
-
Taco Hoekwater