Debian Codegraph @

texk/web2c/etexdir/etrip/etripman.tex

raw
1 % The e-TRIP manual: How to validate e-TeX - last modified 25 Aug 2004
2 %
3 % some e-TeX numbers
4 %
5 \def\minps{32000} % minimum pool_size for e-TRIP test
6 \def\minms{3200} % minimum max_string for e-TRIP test
7 %
8 \def\extracs{66} % additional multiletter control sequences
9 \def\extrasv{2} % additional save stack positions
10 \def\extrabf{23} % additional input buffer positions
11 \def\extramw{38} % additional memory words dumped
12 %
13 \font\eighttt= cmtt8
14 \font\eightrm= cmr8
15 \font\rtitlefont= cmr7 scaled\magstep5
16 \font\ititlefont= cmmi7 scaled\magstep5
17 \def\titlefont{\rtitlefont \textfont1=\ititlefont}
18 \def\eTeX{$\varepsilon$-\TeX}
19 \def\NTS{NTS}
20 \let\mc=\eightrm
21 \rm
22 \let\mainfont=\tenrm
23
24 \def\.#1{\hbox{\tt#1}}
25 \def\\#1{\hbox{\it#1\/\hskip.05em}} % italic type for identifiers
26
27 \parskip 2pt plus 1pt
28 \baselineskip 12pt plus .25pt
29
30 \def\verbatim#1{\begingroup \frenchspacing
31 \def\do##1{\catcode`##1=12 } \dospecials
32 \parskip 0pt \parindent 0pt
33 \catcode`\ =\active \catcode`\^^M=\active
34 \tt \def\par{\ \endgraf} \obeylines \obeyspaces
35 \input #1 \endgroup}
36 % a blank line will be typeset at the end of the file;
37 % if you're unlucky it will appear on a page by itself!
38 {\obeyspaces\global\let =\ }
39
40 \def\verblines#1 {$$\frenchspacing \global\count255=-#1
41 \abovedisplayskip=0pt \belowdisplayskip=\abovedisplayskip
42 \def\do##1{\catcode`##1=12 }\dospecials
43 \def\par{\cr\noalign{\global\advance\count255by1 }%
44 \ifnum\count255<0 \else \egroup $$\fi}%
45 \obeylines \obeyspaces
46 \halign\bgroup\indent\tt##\hfil\cr}
47
48 \output{\shipout\box255\global\advance\pageno by 1} % for the title page only
49 \null
50 \vfill
51 \centerline{\titlefont A torture test for \eTeX}
52 \vskip 6pt
53 \centerline{({\sl Version 2.2, August 2004\/})}
54 \vskip 18pt
55 \centerline{by The \NTS\ Team}
56 \vskip 6pt
57 \centerline{Peter Breitenlohner, Max-Planck-Institut f\"ur Physik, M\"unchen}
58 \vskip 6pt
59 \centerline{Bernd Raichle, Institut f\"ur Informatik, Universit\"at Stuttgart}
60 \vfill
61 \centerline{\vbox{\hsize 4in
62 \noindent Programs that claim to be implementations of \eTeX\ are
63 supposed to be able to process the test routines described in this
64 report, producing the outputs described in this report.}}
65 \vskip 24pt
66 {\baselineskip 9pt
67 \eightrm\noindent
68 The preparation of this report was supported in part by DANTE,
69 Deutschsprachige Anwendervereinigung \TeX\ e.V.\hfil\break
70 `\TeX' is a trademark of the American Mathematical Society.
71
72 }\pageno=0\eject
73
74 \output{\shipout\vbox{ % for subsequent pages
75 \baselineskip0pt\lineskip0pt
76 \hbox to\hsize{\strut
77 \ifodd\pageno \hfil\eightrm\firstmark\hfil
78 \mainfont\the\pageno
79 \else\mainfont\the\pageno\hfil
80 \eightrm\firstmark\hfil\fi}
81 \vskip 10pt
82 \box255}
83 \global\advance\pageno by 1}
84 \let\runninghead=\mark
85 \outer\def\section#1.{\noindent{\bf#1.}\quad
86 \runninghead{\uppercase{#1} }\ignorespaces}
87
88 \section Introduction.
89 The program \TeX82 by D.E.~Knuth is in the public domain, and its
90 algorithms are published; he has done this since he does not want to
91 discourage its use by placing proprietary restrictions on the software.
92 However, he doesn't want faulty imitations to masquerade as \TeX\
93 processors, since users want \TeX\ to produce identical results on
94 different machines. He has copyrighted the programs so that he has some
95 chance to forbid unauthorized copies; he explicitly authorizes copying
96 of correct \TeX\ implementations, and not of incorrect ones! In order
97 to determine, what is a correct implementation of \TeX, he has devised
98 a test suite for \TeX, the \.{TRIP} test [1].
99
100 The program \eTeX\ by `The \NTS\ Team' extends the capabilities of \TeX\
101 by adding a relatively small amount (less than 10 per cent) of code; it
102 is in the public domain, and its algorithms (beyond those of \TeX) are
103 published. This report has been inspired by and is based on the
104 \.{TRIP} manual. It describes the \.{e-TRIP} test, a test suite that
105 allows one to determine whether what one has is a correct implementation
106 of \eTeX.
107
108 If somebody claims to have a correct implementation of \eTeX, we will
109 not believe it until we see that the \.{e-TRIP} test is performed
110 properly. We propose, in fact, that a program must meet two criteria
111 before it can justifiably be called \eTeX: (1)~The person who wrote it
112 must be happy with the way it works at his or her installation; and
113 (2)~the program must produce the correct results from the \.{e-TRIP}
114 test. Hence we are planning to do whatever we can to suppress any
115 systems that call themselves \eTeX\ without meeting conditions (1)
116 and~(2). We have copyrighted the program (1994,98 by The \NTS\ Team,
117 1999-2004 by P.~Breitenlohner) so that we have some chance to forbid
118 unauthorized copies; we explicitly authorize copying of correct \eTeX\
119 implementations, and not of incorrect ones!
120
121 The process of generating an \eTeX\ implementation for a particular
122 system [2] is based on that of generating a \TeX\ implementation for the
123 same system. Moreover, when \eTeX\ is used in compatibility mode, it is
124 supposed to be 100 per cent compatible with \TeX. Thus a correct \eTeX\
125 implementation, when running in compatibility mode, must pass the
126 \.{TRIP} test. In fact, the first part of the \.{e-TRIP} test for a
127 particular implementation of \eTeX\ consists in performing the standard
128 \.{TRIP} test (a)~for \eTeX\ in compatibility mode and (b)~for \eTeX\ in
129 extended mode. The deviations in the test output from step~(a) should,
130 of course, be limited to those explicitly allowed by Knuth and described
131 in Appendix~A, item~5 of the \.{TRIP} manual. Any additional deviations
132 in the test output from step~(b) must be accounted for by \eTeX's
133 additional algorithms and are described in detail in this report. Once
134 an \eTeX\ implementation has passed these preliminary tests, it should be
135 subjected to the second part of the \.{e-TRIP} test. There the extended
136 features and algorithms of \eTeX\ are tested under normal circumstances
137 as well as in situations a normal user would never dream of (in the
138 spirit of the \.{TRIP} test).
139
140 The remainder of this report consists of appendices, whose contents ought
141 to be described briefly here:
142
143 Appendix A explains in detail how to carry out the first part of the
144 test of \eTeX, given copies of the files described in the \.{TRIP}
145 manual.
146
147 Appendix B explains how to carry out the \eTeX\ specific test, given
148 copies of the files described in the other appendices.
149
150 Appendix C is \.{eTRIP.TEX}, a fiendish test file for \eTeX.
151
152 Appendix D is \.{eTRIP.PL}, the property-list description of a
153 special font called \.{etrip}.
154
155 Appendix E is \.{eTRIPIN.LOG}, a correct transcript file \.{eTRIP.LOG}
156 that results if \.{e-TRIPTEX} is applied to \.{eTRIP.TEX}.
157 This run of \.{e-TRIPTEX} also creates a binary format file called
158 \.{eTRIP.FMT} (or similar).
159
160 Appendix F is a correct transcript file \.{eTRIP.LOG} that results if
161 \.{e-TRIPTEX} or any other version of \eTeX\ is applied to \.{eTRIP.TEX}
162 with format \.{eTRIP.FMT}.
163
164 Appendix G is \.{eTRIP.TYP}, the symbolic version of a correct output
165 file \.{eTRIP.DVI} that was produced at the same time as the
166 \.{eTRIP.LOG} file of Appendix~F.
167
168 Appendix H is \.{eTRIP.OUT}, a short file written out and read in by
169 \eTeX\ when it processes \.{eTRIP.TEX}.
170
171 Appendix I is \.{eTRIP.FOT}, an abbreviated version of Appendix F that
172 appears on the user's terminal during the run that produces
173 \.{eTRIP.LOG}.
174
175 \vskip 24pt plus 24pt
176 \section References.
177 \item {[1]}
178 {\sl A torture test for \TeX\/},
179 by Donald E.~Knuth, Stanford Computer Science Report~1027.
180
181 \item {[2]}
182 {\sl How to generate \eTeX\/},
183 by The \NTS\ Team (Peter Breitenlohner and Phil Taylor).
184
185 \item {[3]}
186 {\sl The \.{WEB} system of structured documentation\/},
187 by Donald E.~Knuth, Stanford Computer Science Report~980.
188
189 \item {[4]}
190 {\sl \TeX ware\/}, by Donald E.~Knuth and David R.~Fuchs,
191 Stanford Computer Science Report~1097.
192
193 \vfill\eject
194
195 \section Appendix A: How to test \eTeX\ (part 1).
196
197 \item{0.} Let's assume that you have copies of the files \.{TRIP.TEX},
198 \.{TRIP.PL}, \.{TRIPIN.LOG}, \.{TRIP.LOG}, \.{TRIP.TYP}, and
199 \.{TRIP.FOT} as described in Appendices~B, C, D, E, F, and~G of the
200 \.{TRIP} manual [1] (in a safe place so that these ``master'' files will
201 not be clobbered). Furthermore, let's suppose that you have a working
202 \.{WEB} system [3], and that you have working programs \.{PLtoTF} and
203 \.{DVItype}, as described in the \TeX ware report [4]. Finally let's
204 assume that you are able to generate \eTeX\ as described in [2].
205
206 \item{1.} Use \.{PLtoTF} to convert \.{TRIP.PL} into \.{TRIP.TFM};
207 install \.{TRIP.TFM} in the standard file area for \TeX\ font metric
208 files (or set a suitable environment variable or similar such that these
209 files will be found by the program).
210
211 \item{2.} Generate \.{e-TRIPTEX}, a special version of \.{e-INITEX}.
212 The parameters for \.{e-TRIPTEX} should agree with those for \.{TRIPTEX}
213 (as described in [1]), except that you should set \\{pool\_size} to a
214 value $\ge\minps$ and \\{max\_strings} to a value $\ge\minms$.
215
216 \item{3.} Perform the \.{TRIP} test as described in Appendix~A,
217 items~3--7 of [1], with \.{e-TRIPTEX} as prepared in step~2. The program
218 will run in compatibility mode and should therefore be fully compatible
219 with \.{TRIPTEX} as described in [1]; apart from the allowed differences
220 listed in item~5, the test output should deviate from the master files in
221 the following \eTeX-specific point (and only in this one):
222
223 \itemitem{a)} The name and version by which the program announces itself
224 will be different; the extension of the format file produced during the
225 first \.{e-TRIPTEX} run may be different.
226
227 \def\bs{{\char`\\}}
228 \def\sp{{\char'40}}
229
230 \item{4.} Perform steps 3--7 of the \.{TRIP} test once again with
231 \.{e-TRIPTEX}. During the first run type `\.{*\bs input\sp trip}'
232 instead of `\.{\bs input\sp trip}', as a consequence \.{e-TRIPTEX} will
233 run in extended mode. During the second run type `\.{\&trip\sp\bs
234 toksdef\bs tokens=0\sp\bs input\sp trip}' instead of `\.{\sp\&trip\sp\sp
235 trip\sp}'. The test output should differ from that of step~3 above in
236 the following respects (and only in these):
237
238 \itemitem{a)} The date and\slash or time will naturally be different.
239
240 \itemitem{b)} The message `\.{entering extended mode}' will appear on
241 the terminal and in the \.{TRIP.LOG} files.
242
243 \itemitem{c)} The input `\.{*\bs input trip}' instead of
244 `\.{\bs input trip}' is recorded in the first \.{TRIP.LOG} file;
245 similarly the input `\.{\&trip\sp\bs toksdef\bs tokens=0\sp\bs input\sp
246 trip}' instead of `\.{\sp\&trip\sp\sp trip\sp}' is recorded in the
247 second \.{TRIP.LOG} file.
248
249 \itemitem{d)} The following 6 lines (the last of them blank) will be
250 missing from the first \.{TRIP.LOG} file\verblines 6
251 ! Bad register code (256).
252 l.29 ...{1} \toksdef\tokens=256
253 \show\errorstopmode
254 A register number must be between 0 and 255.
255 I changed this one to zero.
256
257
258 \itemitem{e)} The first \.{TRIP.LOG} file will report the dumping of
259 \extramw~additional memory words.
260
261 \itemitem{f)} If the date has changed, the number of string characters
262 dumped by the first \.{e-TRIPTEX} run may vary by $\pm2$.
263
264 \itemitem{g)} Both \.{e-TRIPTEX} runs report \extracs~additional
265 multiletter control sequences (in the \.{TRIP.LOG} files).
266
267 \itemitem{f)} The second \.{e-TRIPTEX} run reports the unfinished
268 group(s) when the program terminates; there are three additional lines
269 (the first of them blank) on the terminal and in the \.{TRIP.LOG}
270 file\verblines 3
271
272 ### semi simple group (level 1) entered at line 429 (begingroup)
273 ### bottom level
274 The second \.{TRIP.LOG} does not contain six lines\verblines 1
275 {restoring \fam=-1}
276 one line\verblines 1
277 {restoring \displayindent=0.0pt}
278 and one line\verblines 1
279 {restoring current font=\ip}
280 Ten lines displaying an \.{\bs hbox} contain the additional text
281 `\.{, display}'.
282 Finally the second \.{TRIP.LOG} reports the additional use of
283 \extrabf~input buffer (\.{b}) and \extrasv~save (\.{s}) stack positions.
284
285 \vfill\eject
286
287 \section Appendix B: How to test \eTeX\ (part 2).
288
289 \item{5.} Assume that you have copies of the ``master'' files
290 \.{eTRIP.TEX}, \.{eTRIP.PL}, \.{eTRIPIN.LOG}, \.{eTRIP.LOG},
291 \.{eTRIP.TYP}, \.{eTRIP.OUT}, and \.{eTRIP.FOT}, as in Appendices C, D,
292 E, F, G, H, and~I (again in a safe place).
293
294 \item{6.} Use \.{PLtoTF} to convert \.{eTRIP.PL} into \.{eTRIP.TFM};
295 install \.{eTRIP.TFM} in the standard file area for \TeX\ font metric
296 files (or set a suitable environment variable or similar).
297
298 \item{7.} Run \.{e-TRIPTEX}; in response to the `\.{**}' prompt, type
299 `\.{*etrip}'. You should get an output file \.{eTRIP.LOG} that matches
300 the file \.{eTRIPIN.LOG} (Appendix~E). Contrary to the analogous step
301 in the \.{TRIP} test (steps~3 and~4 above) there should be no error
302 messages; lines in the output saying ``Emergency stop'' would indicate
303 that you have performed this test with a standard \TeX\ or with \eTeX\
304 in compatibility mode.
305
306 \item{8.} Run \.{e-TRIPTEX} again; this time type
307 `\.{\&etrip{\char'40}etrip}'. You should get outputs \.{eTRIP.LOG},
308 \.{eTRIP.DVI}, and \.{eTRIP.OUT}. Furthermore, your terminal should
309 receive output that matches \.{eTRIP.FOT} (Appendix~I). Once again, the
310 terminal will be getting no output during the middle part of this test.
311
312 \item{9.} Compare the \.{eTRIP.LOG} file from step 8 with the ``master''
313 \.{eTRIP.LOG} file of step~5. There should be no lines saying
314 ``Emergency stop'' (see above) or ``Bug in your e-TeX implementation'';
315 there should be perfect agreement between these files except in the
316 following respects:
317
318 \itemitem{a)} The dates and possibly the file names will naturally be
319 different.
320
321 \itemitem{b)} Glue settings in the displays of \TeX\ boxes are subject
322 to system-dependent rounding, so slight deviations are permissible.
323 However, such deviations apply only to the `\.{glue set}' values that
324 appear at the end of an \.{\char'134hbox} or \.{\char'134vbox} line; all
325 other numbers should agree exactly, since they are computed with integer
326 arithmetic in a prescribed system-independent manner.
327
328 \itemitem{c)} The amount of space in kerns that are marked ``for
329 accent'' are, similarly, subject to system-dependent rounding.
330
331 \itemitem{d)} If you had different values for \\{stack\_size},
332 \\{buf\_size}, etc., the corresponding capacity values will be different
333 when they are printed out at the end.
334
335 \itemitem{e)} Help messages may be different; indeed, the author of
336 \TeX\ encourages non-English help messages in versions of \TeX\ for
337 people who don't understand English as well as some other language.
338 Similarly, \eTeX\ could well be used with non-English help messages.
339
340 \itemitem{f)} The total number and length of strings at the end may well
341 be different.
342
343 \itemitem{g)} If your \eTeX\ uses a different memory allocation or
344 packing scheme or \.{DVI} output logic, the memory usage statistics may
345 change.
346
347 \item{10.} Use \.{DVItype} to convert your file \.{eTRIP.DVI} to a file
348 \.{eTRIP.TYP}. The following options should be set when using
349 \.{DVItype}:
350 $$\vbox{\halign{#\hfil&\hfil#\cr
351 Output level = 2\cr
352 Starting page = \.{*.*.*.*.*.*.*.*.*.*}\hskip-20pt\cr
353 Number of pages = 1000000&(this is the default)\cr
354 Resolution = 7227/100&(this is one point per pixel)\cr
355 New magnification = 0&(this is the default)\cr}}$$
356 The resulting file should agree with the master \.{eTRIP.TYP} file of
357 step~5, except that some of the values might be a little off due to
358 floating-point rounding discrepancies. Furthermore there may be
359 differences between `\\{right}' and `\\w' and `\\x' commands, and
360 between `\\{down}' and `\\y' and `\\z'; the key thing is that all
361 characters and rules and \\{xxx}'s should be in almost the same
362 positions as specified in Appendix~G. If you have set
363 \\{dvi\_buf\_size} to 800, then your \.{DVI} file should be virtually
364 identical to the one supplied.)
365
366 \vfill\eject
367
368 \section Appendix C: The \.{eTRIP.TEX} file.
369 The contents of the test routine are prefixed here with line numbers,
370 for ease in comparing this file with the error messages printed later;
371 the line numbers aren't actually present.
372 \runninghead{APPENDIX C: \.{eTRIP.TEX} (CONTINUED)}
373
374 \vskip 8pt
375 \begingroup\count255=0
376 \everypar{\global\advance\count255 by 1
377 \hbox to 20pt{\sevenrm\hfil\the\count255\ \ }}
378 \verbatim{etrip.tex}
379 \endgroup
380 \vfill\eject
381
382 \section Appendix D: The \.{eTRIP.PL} file.
383 At the moment the \.{eTRIP.PL} file is just a copy of \.{TRIP.PL} as
384 described in Appendix~C of [1].
385
386 \section Appendix E: The \.{eTRIPIN.LOG} file.
387 When \.{e-TRIPTEX} makes the \.{eTRIP.FMT} file, it also creates a file
388 called \.{eTRIP.LOG} that looks like this.
389 \runninghead{APPENDIX E: \.{eTRIPIN.LOG} (CONTINUED)}
390
391 \vskip8pt
392 \verbatim{etripin.log}
393 \vfill\eject
394
395 \section Appendix F: The \.{eTRIP.LOG} file.
396 Here is the major output of the \.{e-TRIP} test; it is generated by
397 running \.{e-TRIPTEX} and loading \.{eTRIP.FMT}, then reading
398 \.{eTRIP.TEX}.
399 \runninghead{APPENDIX F: \.{eTRIP.LOG} (CONTINUED)}
400
401 {\let\tt=\eighttt\leftskip 1in\baselineskip 9pt plus .1pt minus .1pt
402 \vskip8pt
403 \verbatim{etrip.log}
404 }
405 \vfill\eject
406
407 \section Appendix G: The \.{eTRIP.TYP} file.
408 Here is another major component of the test. It shows the output of
409 \.{DVItype} applied to the file \.{eTRIP.DVI} that was created at the
410 same time Appendix F was produced.
411 \runninghead{APPENDIX G: \.{eTRIP.TYP} (CONTINUED)}
412
413 {\let\tt=\eighttt\leftskip 1in\baselineskip 9pt plus .1pt minus .1pt
414 \vskip8pt
415 \verbatim{etrip.typ}
416 }
417 \vfill\eject
418
419 \section Appendix H: The \.{eTRIP.OUT} file.
420 This short file was written out once and read in several times, during
421 the time Appendix F was being produced. There are only four lines.
422 \runninghead{APPENDIX H: \.{eTRIP.OUT} (CONTINUED)}
423
424 \vskip8pt
425 \verbatim{etrip.out}
426 \vfill\eject
427
428 \section Appendix I: The \.{eTRIP.FOT} file.
429 This shows what appeared on the terminal while Appendix F was being
430 produced.
431 \runninghead{APPENDIX I: \.{eTRIP.FOT} (CONTINUED)}
432
433 \vskip8pt
434 \verbatim{etrip.fot}
435
436 \vfill\end