interplane.Get Omega
Read in your language

omega-pdf

Omega PDF: read and write PDF files in Omega

Brought by drakestapleton

branch main Branches Tags History

omega-pdf / corpus / SOURCES.txt

138 lines · 11784 bytes Raw Blame History
1omega-pdf S3 test corpus: where every file comes from, its licence, and the command that made it.
2Made on the Spark (Linux AArch64) on 2026-11-10. No file was downloaded.
3First-party files are Apache-2.0 (repository LICENSE). The only first-party generator of PDF bytes
4is tests/mkcases.om (Omega); no shell, Python or C program writes or edits corpus bytes. The installed
5tools below are producers or oracles only, never part of opdf.
6
7Tool versions (observed):
8 LibreOffice 24.2.7.2 420(Build:2) soffice --version
9 pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) pdflatex --version
10 GPL Ghostscript 10.02.1 gs --version
11 pdfinfo / pdftotext / pdffonts 24.02.0 (poppler) pdfinfo -v
12 omc sha256 6d1b1cf5a44803389a831b67f750ea4cd1c9f53edfde9d6d9241d7352887f1f8 (omega-mv 82e536e1, PIN)
13
14corpus/src: inputs (first-party, Apache-2.0)
15 prose.txt existing hand-typed prose (unchanged by this work)
16 encodings.tex existing LaTeX document (unchanged by this work); sets \pdfobjcompresslevel=2 and
17 \pdfminorversion=5, so pdfTeX writes object streams and a cross-reference stream
18 OMEGESE.md omega-mv 82e536e1 docs/one_layer/OMEGESE.md, Apache-2.0 (omega-mv LICENSE), 117022 bytes,
19 sha256 13329b3e1984d4ddceb6ec0ab8237012e901697b23c972300b87b66769034381; copied unchanged from
20 a local omega-mv 82e536e1 tree's docs/one_layer/OMEGESE.md (that tree is not a git
21 checkout; the same bytes are omega-zip 28e91f99 corpus/src/OMEGESE.md, which
22 omega-zip SOURCES.txt records as omega-mv 82e536e1 docs/one_layer/OMEGESE.md)
23 layout.fodt hand-written OpenDocument flat XML (new): A4 landscape page layout
24 (29.7 x 21 cm, print-orientation landscape), a 3-column 4-row table with borders,
25 bold and italic spans, two proportional font families (DejaVu Serif body,
26 DejaVu Sans heading/table). No template or third-party content.
27
28corpus/pdf: producer files. Built in scratch copies /tmp/opdf/corpus-build/a and .../b (two
29independent builds), each command run as `flock POOL taskset -c CORES nice -n 10 COMMAND`; the
30committed copy is the one from build a.
31 prose.pdf soffice -env:UserInstallation=file:///tmp/opdf/lo-profile --headless --infilter="Text (encoded):UTF8" --convert-to pdf prose.txt
32 omegese.pdf soffice -env:UserInstallation=file:///tmp/opdf/lo-profile --headless --infilter="Text (encoded):UTF8" --convert-to pdf OMEGESE.md
33 (built once in /tmp/opdf/corpus-build/om; renamed OMEGESE.pdf -> omegese.pdf; the throughput /
34 large-text case, Markdown kept as plain text; 369610 bytes, 37 pages, one embedded
35 LiberationMono subset)
36 layout.pdf soffice -env:UserInstallation=file:///tmp/opdf/lo-profile --headless --convert-to pdf layout.fodt
37 encodings.pdf SOURCE_DATE_EPOCH=1793750400 FORCE_SOURCE_DATE=1 pdflatex -interaction=nonstopmode encodings.tex
38 encodings-notounicode.pdf
39 SOURCE_DATE_EPOCH=1793750400 FORCE_SOURCE_DATE=1 pdflatex -interaction=nonstopmode -jobname=encodings-notounicode '\pdfgentounicode=0 \input{encodings}'
40 (TeX Live's pdftexconfig turns \pdfgentounicode on; setting it to 0 before \input
41 removes every ToUnicode CMap without editing encodings.tex, so no switch was added
42 to the source. pdffonts: the 4 Type 1 fonts are encoding "Custom", uni "no".)
43 Reproducibility: the two pdfTeX outputs are byte-identical across builds a and b
44 (encodings 7b9fa073..., encodings-notounicode 224fc1ef...). The LibreOffice outputs differ
45 between builds (creation date and document /ID); text, fonts and page geometry do not.
46 Embedded font subsets keep their own licences: Liberation Mono (Debian fonts-liberation: SIL-OFL-1.1),
47 DejaVu Sans/Serif (Debian fonts-dejavu-core: bitstream-vera), URW Nimbus Roman/Mono Type 1
48 (Debian texlive-fonts-recommended, TeX Live fonts/type1/urw; its licence was not separately
49 checked for this corpus and is that package's terms).
50
51corpus/gen and corpus/refuse: written by tests/mkcases.om, ours (Apache-2.0).
52 From the repository root, under a pool lock:
53 seed omc < tests/mkcases.om > build/mkcases && chmod +x build/mkcases && build/mkcases
54 where omc is omega-mv 82e536e1 seed/out/omc (sha above, PIN).
55 mkcases computes every xref offset, /Length, /Size, /Prev, /XRefStm, object-stream /First,
56 ASCIIHex, ASCII85, RunLength and LZW encodings, stored-block zlib with Adler-32 (RFC 1950/1951),
57 and PNG Up (Predictor 12) xref-stream rows. Two runs give byte-identical gen/ and refuse/
58 (62 files; sha256 manifest of `find gen refuse -type f | sort | xargs sha256sum` = b20f71628831cd9b650650e9c3eef6f0ed277fc7a292de279cdfe795798aeee0).
59 Standard-14 fonts are never embedded (Helvetica); type0.pdf names an unembedded Adobe-Japan1
60 CIDFontType0 (HeiseiKakuGo-W5), which Ghostscript substitutes without a warning.
61
62 Files in corpus/gen (valid; all pass the oracle in ORACLE.txt):
63 inherit two-level Pages tree: root has MediaBox [0 0 400 800], Rotate 90, Resources; a middle
64 Pages node adds nothing; page 1 inherits all three, page 2 overrides MediaBox
65 [0 0 500 750] and Rotate 180 but inherits Resources
66 winansi Helvetica /WinAnsiEncoding, codes 41..45 20 80 e9 82 -> "ABCDE €é‚"
67 macroman Helvetica /MacRomanEncoding, same codes -> "ABCDE ÄÈÇ"
68 standard Helvetica with no /Encoding (built-in StandardEncoding): 27 60 ae af b1 e1 fb -> ’ ‘ fi fl – Æ ß
69 differences Encoding dictionary, no BaseEncoding, Differences [65 /Aacute /fi /Lslash /adieresis /Euro]
70 tounicode simple font + ToUnicode: bfchar (incl. <42> -> <00660069> "fi" ligature and
71 <43> -> <d83dde00> surrogate pair U+1F600), bfrange increment <44><45> -> <0064>,
72 bfrange array <46><48> -> [X Y Z]
73 type0 Type0 /Identity-H, CIDFontType0 descendant, 2-byte codes, ToUnicode codespace <0000><ffff>
74 textops Tm Td TD T* ' " TL and TJ [(wide) -900 (gap)] (large negative adjustment = word gap)
75 lenref content /Length 6 0 R, the length object written before the stream
76 ahx content /ASCIIHexDecode (upper-case digits, '>' EOD)
77 a85 content /ASCII85Decode, 45 + 1 bytes (content ends in a space): 11 full groups and a final 1-byte group (2 chars), '~>' EOD
78 a85flate content [/ASCII85Decode /FlateDecode]; zlib 78 01 + stored block + Adler-32
79 xrefstm no classic table: /Type /XRef stream, /W [1 4 2], /FlateDecode (stored zlib),
80 /DecodeParms << /Predictor 12 /Columns 7 >> (PNG Up rows)
81 objstm page object 3 in /Type /ObjStm 6 (N 1, First 4) and an xref-stream type-2 entry; an
82 unreferenced direct copy of object 3 also stays in the body
83 incr one incremental update: new content object 5 ("Updated text"), full second table, /Prev
84 hybrid classic table (compressed object 3 omitted) + trailer /XRefStm to xref stream 9 holding
85 object 3's type-2 entry
86 carray /Contents [5 0 R 6 0 R], two independent streams
87 image /XObject /Im1 with /Filter /DCTDecode and arbitrary (non-JPEG) bytes, never drawn
88 lzw content /LZWDecode (Clear, 9-bit literal codes, EOD): valid file, opdf text refuses 62
89 Files in corpus/refuse, with the intended opdf exit code and the defect (command: opdf info/pages
90 for structural codes; opdf text for filter, font and zlib codes):
91 bad-startxref 60 startxref value 999999 points past the end of file
92 bad-xref-offset 60 xref offset of object 3 is one byte past "3 0 obj"; the bytes there parse as object
93 number 0 ("0 obj"), a malformed object header
94 bad-object-number 60 the bytes at object 3's offset read "9 0 obj"
95 missing-endstream 60 content stream ends with endobj, no endstream
96 wrong-length 60 content /Length is 9 more than the data before endstream
97 encrypted 61 trailer /Encrypt (Standard handler V 1 R 2; no /ID)
98 kids-cycle 63 Pages object 2 has /Kids [2 0 R]
99 prev-cycle 63 trailer /Prev is the offset of its own xref section
100 objstm-self 60 self-reference guard: the xref stream says object stream 6 is itself object 0
101 inside object stream 6; an object stream must have a type-1 (uncompressed) entry
102 (ISO 32000-1 7.5.7), so its own type-2 entry is malformed
103 nesting 63 page Resources (inherited from Pages) holds 70 nested arrays inside a dictionary
104 name-long 63 Pages dictionary holds a 300-byte name /AAA...
105 lzw-text 62 content /LZWDecode (text only; info/pages succeed)
106 runlength 62 content /RunLengthDecode, valid encoding; core implements no RunLength filter
107 cid-no-tounicode 65 Type0 Identity-H font without ToUnicode (text contract)
108 identity-v 65 Type0 Identity-V vertical writing (text contract)
109 bad-cmap 66 ToUnicode bfrange <41><48> with a 2-element array for 8 codes (text contract:
110 malformed CMap is 66, README "Exit codes"; tests/cases.txt r-bad-cmap)
111 vNN-FIXTURE NN content /FlateDecode whose bytes are 78 01 + corpus/s1refuse/FIXTURE.raw
112 (raw DEFLATE) or FIXTURE.zlib as is; NN is omega-zip's code for that fixture
113 w-objstm-ref 67 opdf split FILE 1 1 OUT (info and text succeed): valid file (gs and pdfinfo accept it,
114 see ORACLE.txt) whose page has /PieceInfo 6 0 R, where 6 is the /ObjStm holding
115 font object 4; the writer cannot copy an object stream as a resource
116 w-external 67 opdf split; 62 on opdf text: page content stream << /Length 0 /F (external-content.bin) >>
117 (external file stream, ISO 32000-1 7.3.8.2) with empty data
118 64 (I/O error) has no corpus file; tests/cases.txt r-io-dir gives a directory as the input (exit 64).
119 A regular file cannot make read/seek fail without fault injection.
120
121corpus/s1refuse: S1 fixtures copied unchanged from omega-zip commit 28e91f99b1a085e65eca460fe522b86bc043c156
122 (Radicle rad:z2Hxzn2TdMYH5oHb18ZYpP1ZY2SSb, Apache-2.0, made by its tests/mkcases.om per
123 its corpus/SOURCES.txt "corpus/refuse"; zl-adler/zl-trunc are its corpus/zlib/text.om.l6 with the
124 last byte changed / 2 bytes cut). Command for each FILE, in an omega-zip clone:
125 git -C OMEGA_ZIP show 28e91f99:corpus/refuse/FILE > corpus/s1refuse/FILE
126 Each copy is cmp-equal to that repository's working file. Code per file from its tests/cases.txt
127 (r-* inflate, rz-* zlib): 10 e-empty s-trunc f-trunc zl-trunc; 11 b-type3; 12 s-nlen;
128 13 d-manylen d-manydist; 14 d-clinc d-clover; 15 d-repfirst d-reppast; 16 d-litinc d-litover;
129 17 d-distinc d-distover; 18 d-noeob; 19 f-lit286; 20 f-dist30; 21 f-far; 30 zl-fcheck zl-cinfo
130 zl-method; 31 zl-dict; 32 zl-adler. omega-zip's oracle verdicts: its corpus/refuse/ORACLE.txt.
131
132corpus/expect: oracle outputs for every valid file NAME.pdf in pdf/ and gen/, and for refuse/w-objstm-ref.pdf
133(valid for info/text; refused only by split) (names are unique):
134 NAME.pdfinfo pdfinfo -rawdates FILE
135 NAME.box pdfinfo -f 1 -l N -box FILE (N = pdfinfo page count)
136 NAME.txt pdftotext -raw -enc UTF-8 FILE -
137corpus/ORACLE.txt: gs -q -dNOPAUSE -dBATCH -dPDFSTOPONERROR -dPDFSTOPONWARNING -sDEVICE=nullpage FILE
138 exit status and stderr, and the pdfinfo page count, for the same files.