Repository navigation
Conversation
ISO 19005-2 6.2.8.3 limits the number of colour channels to 1, 3 or 4 and asks for one bit depth over the colour channels. The rule counted every channel, as veraPDF does, so a JP2 file of one grey and one opacity channel was reported, and so was an RGB file whose opacity channel has another depth. The channel definition box says which channels are colour: its type-0 entries, or every channel when the file has none (ISO/IEC 15444-1 I.5.3.6). The rule reads the box with the bounds it applies to its other boxes and reports nothing about colour channels when the box is shorter than its count or names a channel the codestream lacks. Tests 2, 3 and 4 already ran with or without /ColorSpace; parity tests against veraPDF now pin that and each case where the two differ. The catalog notes and the divergence record say where veraPDF differs. Findings are a report, so no saved byte changes.
Review round 1 found that the colour-channel count treated every codestream component as a channel and read cdef only in jp2h. A palette file's channels are the entries of its component mapping box (ISO/IEC 15444-2 M.5.1.2), and a JPX compositing layer header can replace the jp2h channel definition with its own cdef or an Opacity box (M.11.7, M.11.7.6). The rule now numbers channels through cmap when a palette applies, takes a palette channel's depth from its column, and reads the first layer header. A cdef that does not list every channel exactly once (no entries, a count the channel count or the bytes do not support, a repeated or out-of-range channel, trailing bytes), a second cdef, palette, mapping or Opacity box in one header, and a file with codestream header or registration boxes are all not trusted the same way: tests 1 and 5's uniformity half report nothing, so malformed input yields no finding main did not already report. The repeat check uses a seen array, so the cost is linear in the channel count. The tests pin every malformed shape, the palette and layer cases, and the new veraPDF parity cases. The CHANGELOG now lists the findings that appear as well as those that disappear, and the divergence and v2.4 conformance docs match.
…alls (#792) The trust gate of the colour-channel rule was written from an idea of the boxes. It distrusted files the clauses allow (a channel with several descriptions, a codestream header or registration box on one codestream) and trusted files they forbid (a palette without values, a reserved channel type, a repeated type and association pair, a mapping type 0 with a palette column). Replace it with an enumeration. The class remarks now hold one table of the shalls the clauses put on ihdr, pclr, cmap, cdef, opct and creg, each row citing its clause; code and tests carry the row names, and a box is untrusted exactly when one of its rows fails. A channel is colour when any description of it has type 0. A description naming no channel is ignored. A layer built from one codestream is read like any other, with or without a codestream header or a registration box, and the header of that codestream overrides the jp2h boxes box by box. The range half of test 5 now covers the components as well as the numbered channels, so a palette's index component of 40 bits is a finding again. A chroma key without its values, and an Opacity box of type 0 on one channel, are decided by their rows instead of by a guess.
…#792) The rule's catch-all turns any exception into "no finding", so a row test that expects an empty result cannot tell an untrusted box from a thrown index. Files that must report only a second, unrelated finding (a METH 4 colour box) now carry it, so a box left unread no longer hides a throw. Also drop the creg length check "shorter than 4 bytes": the modulo check that follows already refuses every such length.
…#792) A palette with no columns and a mapping that uses none is refused only by the NPC row; the earlier file also failed the mapping's column row, so removing the NPC check went unnoticed.
…thing at it (#792) The class remarks hold the table of shalls; the CHANGELOG entry, divergence row D7 and the test comments now say a box is read unless a row fails, in place of the earlier "lists every channel exactly once" and "channels from several codestreams" sentences, which described a different gate. Add the row tests that mutation testing showed to be too weak: a signed palette column, a 39-bit column, NPC 0 with a direct-only mapping, N 0 with no channels, a chroma key of 10-bit channels and of the wrong NCH, and an opacity channel described twice for one colour.
R1 and R2 are the labels of an unrelated rule list; the registration box rows take G1 and G2 so a reader does not look them up in the wrong table.
#792) The JPEG 2000 rule's table of shalls now lists each sentence that ISO/IEC 15444-1 I.5.3.1 to I.5.3.6 and 15444-2 M.11.5.1 to M.11.7.7 put on ihdr, bpcc, pclr, cmap, cdef, opct and creg, with the box it applies to (jp2h, jpch, jplh) and what failing it does. A row either leaves its box unread or is listed with the reason it changes nothing. Rows that changed the reading: - The "at most one" rows P1, C1 and D1 count the boxes of a jp2h only. 15444-2 gives a jpch and a jplh the structure of these boxes and no count, so a second box there is no longer a reason to distrust the first, which is read. - D3 to D6 are not asked of a JPX file whose File Type box does not list "jp2 ": M.11.7.5 lets any channel have any colour or type there. - D5 refuses one channel described as both opacity and premultiplied opacity for one colour, which is the notes' "not both". - A bpcc box goes with the ihdr it explains, so a jpch ihdr of BPC 255 does not borrow the jp2h bpcc (M.11.5.1). - G2 asks for at least one registration entry. New rows with no effect, each with its reason: I4 and P6 (a depth outside 1 to 38 is what test 5 reports), I6 to I8, D8 to D10. Tests: every row has one; a METH 4 colr box in every row-test file shows that a row which throws instead of refusing would end the scan before test 3.
…eader reads (#792) Each of the three rows now carries its own condition on the File Type box, so a test or a mutation can show that each one is skipped there, not just the group.
…ing row stops (#792) The class remarks, the CHANGELOG entry and divergence D7 said the table had a row for each shall the clauses put on the boxes. It lists each requirement, the boxes it applies to and its effect, and says so, with the scope of the jpch, jplh and JPX-only cases. The defensive-operation paragraph no longer says a failing row silences the scan, and the probe sentences about the image loader and the variant counts follow the 293-variant run. The D7 test now has an undescribed channel whose reading would report something.
…d colr rows (#792) The File Type condition that skipped rows D3 to D6 is removed. It was unbriefed, covered half of M.11.7.5 (a JPX file no JP2 reader reads, not a codestream such a reader will not read) and reached past what the clause says for D3: M.11.7.5 adds values of the association field and gives no new type. D3 to D6 are asked of every file again, and the rule does not read the File Type box. The table now lists what the clauses put on the boxes it names: - F1 to F3 for the File Type box (I.5.2, M.6.1.3, M.8), effect none. - I9 for HEIGHT and WIDTH, effect none; I6 and I7 gain the JPX sentence of M.11.5.1 and the contradiction between Tables M.19 and M.21. - B1 to B7 for bpcc (I.5.3.2, M.11.5.2). Two bpcc boxes in a jp2h and a box whose length is not NC bytes now leave the depths unknown; a longer box used to be read from its first NC bytes. - K1 to K5 for colr (I.5.3.3, M.11.7.2): layout, METH, APPROX, the enumerated colour space and Table I.10. - D6 asks premultiplied opacity (type 2) for an unsigned component too, since type 2 is defined as type 1 with the opacity multiplied in. Every new row has a test; the tests that pinned the relaxation are replaced by one that asks D3 to D6 under eight File Type shapes.
…1.7.5 leaves out (#792) The class remarks, the CHANGELOG entry and divergence D7 now name the boxes the table covers (File Type, ihdr, bpcc, colr, pclr, cmap, cdef, opct, creg), what it leaves out (the superboxes themselves, a colr box's precedence and profile), and that D3 to D6 are asked of every file. M.11.7.5 is named as a limit: the rule does not read the File Type box and does not decide which codestream a JP2 reader reads. The probe counts are re-measured over 359 variants against current main: 172 differ, 126 lose a finding, 42 gain one.
…r with METHDAT (#792) The class remarks claimed to list every requirement the cited clauses put on the File Type box and colr, and each round that widened the table found more boxes the clauses touch. The table now covers the seven boxes whose contents decide which channels the rule counts and how deep they are: ihdr, bpcc, pclr, cmap, cdef, opct and creg. The File Type rows and the colr rows are gone. A paragraph after the table says which colr boxes tests 2 to 4 read. 15444-2 M.11.7.2 says the length of METHDAT may not be 0, so a colr box of 3 bytes or fewer is no longer counted; the test builders write one METHDAT byte. Rows B2 and B4 now say their effect holds when BPC is 255. Both halves of M.11.7.5 are stated where the rule names the limit. Two bpcc tests cover a jpch box of the wrong length and a box one byte short for three components, which a reader that repeated the last entry would read differently. Comments and test lines wrap to 100 columns.
…792) The CHANGELOG entry and divergence D7 said the table lists every requirement the clauses put on the File Type box and colr, and gave a blanket account of what an untrusted row leaves running. Both now name the seven boxes the table covers and send the reader to its effect column. One sentence says which colr boxes tests 2 to 4 read, citing 15444-2 M.11.7.2, and the entry records that a colr box of 3 bytes or fewer is no longer counted. D7 states both halves of M.11.7.5.
Row I5 says a bpcc goes with the ihdr in its own header box (15444-2 M.11.5.1), but the code combined a jpch bpcc with the jp2h ihdr when the jpch had no ihdr of its own. The rule now takes the bpcc from the header of the ihdr it reads, so a jpch bpcc beside no jpch ihdr is not read. That can only remove a finding. Three tests pin both directions of the choice. The class remarks now give the table one introducing sentence and put what failing a row does in that row's effect cell. The paragraphs that summed up effects across rows are gone, as are the "range is checked on every component and channel" sentences, which were false when the component depths are unknown beside a direct channel. The colour specification paragraph counts METHDAT bytes of the contents and cites M.11.7.3.1 for EnumCS. The scope notes are a list of one-sentence items. Tests: B2 and B4 now pin that another BPC leaves the depths the BPC field's, using a 39-bit BPC so test 5 tells the two readings apart. One word comment lines are rejoined and comment lines over 100 columns wrapped.
…792) The CHANGELOG entry and divergence D7 said what failing a row does across boxes ("every file with a box that fails an untrusted row loses one", "a box is read unless a row ... fails for it"). Both were false at their boundary, so they now say what the rule checks, point to the table in the class remarks for the per-row requirements and effects, and give the measured counts with their population: 359 generated variants, 171 differ from main, 125 lose a finding, 42 gain one, one changes, three differ in the loader run only. The 3-byte colr sentence counts contents, not the box with its header.
Rows B2, G1 and G2, the Scope list and three code comments said a jpch holding two bpcc is read from its first, that D3 to D6 are asked of every file, and that a failing creg only leaves the channels unnumbered. None holds: a jpch bpcc with no jpch ihdr is not read (I5), D3 to D6 are asked only when the channels are numbered and not of a jp2h cdef a layer Opacity box replaces, and a failing creg or several codestreams also stop the jpch being read. Three tests pin each reading.
…792) The intro sentence of the class remarks, the CHANGELOG entry and divergence D7 said each row gives one requirement; D2, P3, P4 and others give two, and C5, C6 and D7 are not shalls.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #792
What changed
Jpeg2000Rule(ISO 19005-2 6.2.8.3) now counts colour channels instead of every component.pclr) and a component mapping (cmap) box, by the mapping box's entries, a palette channel having its column's depth.cdef) box has type 0 (ISO/IEC 15444-1 I.5.3.6, read on NEN Connect, paraphrased), and every channel is one when the file has no such box. A channel may carry several descriptions; one with a type 0 description and an opacity description counts once, as colour. A description whose channel index names no channel describes nothing and is ignored. A JPX file's first compositing layer header (jplh) replaces thecdefwith its owncdefor an Opacity (opct) box (15444-2 M.11.7, M.11.7.6, M.9.2.2, held and checked withclause_check.py), and the codestream header (jpch) of the layer's codestream overridesihdr,pclrandcmapbox by box (M.11.6, M.5.2.1), abpccgoing with itsihdr(M.11.5.1).Jpeg2000Rule, covers seven boxes: the ones whose contents decide which channels the rule counts and how deep they are,ihdr(rows I1 to I9),bpcc(B1 to B7),pclr(P1 to P6),cmap(C1 to C6),cdef(D1 to D10),opct(O1 to O6) andcreg(G1, G2). Each row gives a requirement of the clause it cites, or says it is a definition or a reading, where it applies, and what failing it does, and has a test inPdfPreflightTests.Jpeg2000Rows.cs. What failing a row does is in that row's effect cell and is not restated here. Tests 2 to 4 read thecolrboxes of thejp2hwhose contents hold METH, PREC, APPROX and at least one byte of METHDAT (15444-2 M.11.7.2: its length may not be 0); a box whose contents are 3 bytes or fewer is no longer counted. C5 and C6 are field definitions, not shalls, and say so.jp2honly: 15444-2 M.11.5.2, M.11.6, M.11.7 and M.11.7.5 give ajpchand ajplhthese boxes' structure and no count, so the first of two there is read, except that ajpchbpccbeside nojpchihdris not read at all. D3 to D6 are asked whatever the File Type box lists, and only when the channels are numbered, as D1 (see "Not done" for M.11.7.5). B4 refuses abpccbox of other than NC bytes when BPC is 255: main read the first NC bytes of a longer one, sor3y-bpcc-longloses its finding 5. Abpccbox goes with theihdrit explains (M.11.5.1): ajpchbpccbeside nojpchihdris not read with thejp2hihdr. P2 is asked of the pair of boxes the rule reads, which is a reading of M.5.2.1. D5 treats one channel described as both opacity and premultiplied opacity for one colour as both ("not both"). D6 asks the palette column's sign for a palette channel, a reading of Table I.16, and asks premultiplied opacity (type 2) for an unsigned component as well, a reading too (type 2 is defined as type 1 with the opacity multiplied in).cdefthat describes one channel twice and any file with ajpchorcregbox, which the clauses allow, and it trusted a palette without values, a reserved channel type, a repeated type and association pair and a mapping of type 0 with a palette column, which they forbid./ColorSpaceonmain; they are pinned by tests against veraPDF, which skips them when/ColorSpaceis present.ConformanceCatalognotes for 6.2.8.3-1 to -5, row D7 indocs/conformance-divergences.mdand the 6.2.8.3 row ofdocs/conformance-v2.4.mdsay where veraPDF differs.No output bytes change: the rule's findings are a report and no save is refused or altered.
Findings that appear and disappear
Preflight (PDF/A-2b) over 359 generated variants (the 293 of the earlier rounds and 66 added in review), each three ways (with
/ColorSpace, without, and through the image loader into a Layout document), onmain(2d587c2, built from agit archiveof that commit) and on this branch (464a08b): 1,077 runs, 465 differ, in 171 variants. In the direct runs 125 variants lose a finding, 42 gain one and one goes from 1 to 5; three differ in the loader run only (r2-opct-with-palette-2cols,r3x-opct-ck-palette16-1byte,r3x-jp2h-cdef-first-jpch-ihdr). Each assembly was built from its own tree and the probe printed the path of the DLL it loaded (the head's informational version is2.3.3+d5d1e46...; the commit after it changes documents only). Classification: the variants of the earlier rounds that still differ from main keep the reading of the table built in round 3 from a build that logged the failing row, and a script checked that each table cell still covers the measuredcsandnocsvalues; a build of the head with a log line at every row's failure point (findings equal to the plain head on all 1,299 runs) logged the failing rows: 169 of the 171 cells match their logged row or are "text" with none logged, and the two "scope" cells logged the several-codestreams branch. The image loader (JpxImageLoader) re-emits the signature, File Type,jp2hand first codestream box and drops the other top-level boxes, so a compositing layer header and a codestream header are not in the file it writes and the loader run reads thejp2halone. The reviewer's 39 further variants (r5-*) run the same way: 13 differ from main (3 gain a finding, 10 lose one; logged rows B2, B4, D4 and D6; none for the three variants with acolrbox whose contents are 3 bytes and the three whosejpchbrings its ownihdr). The 35r6-*variants of the last review: 7 differ (1 gains, 6 lose; logged rows B2 and B4, and none for the threecolrvariants). Against the previous head (fe0f870) 7 variants moved, in theircsandnocsruns only, all with ajpchbpccbeside nojpchihdr(r3x-jpch-bpcc-only-uniform-jp2h-8-16,r5-b2-jpch-bpcc-only-two,r5-b2-jp2h-two-jpch-bpcc-only,r6-i5-jp2h255-nobpcc-jpch-bpcc-8-8-16,r6-i5-jp2h255-nobpcc-nc2-jpch-bpcc-8-16,r6-i5-jp2h255-nobpcc-jpch-label-bpcc,r6-i5-jp2h255-bpcc-jpch-bpcc-uniform); each of the seven now equalsmain. The other 1,285 runs are unchanged."Text" means the file is as the clauses allow and the finding changes because the rule now counts colour channels or numbers the channels; a row name means the box fails that row.
Findings that appear (direct runs):
f2-pclr-npc255,pclr-1c-five-cols,pclr-1c-rgb-cols-16-16-8,pclr-1c-two-cols,r2-pclr-16bit-2byte-values-2cols,r3x-big-pclr-1024x255x38,r3x-pclr-ne1-2cols,r3x-pclr-ne1024-2cols,r3x-pclr-npc255-ne2-exactr2-pclr-col-depth39,r3x-pclr-9-1-16-exact,r3x-pclr-col128-exact,r3x-pclr-col39-exact,r4-p6-col26,r4-p6-col7F,r4-p6-colA6r3x-jpch-cmap-only-jp2h-pclr-cmap,r3x-jpch-ihdr-nc5-jp2h-nc3,r3x-jpch-label-then-ihdr-nc2,r3x-jpch-two-pclr,r3y-jpch-two-identical-cmap-rgb-16-16-8f2-creg-cdn1-jpch1-palette,f2-creg-one-cs-jpch-palette,f2-jpch-palette-no-creg,r3x-creg-cdn0-two-jpchcdef-two-colour-one-alpha,r3y-cdef-srgb-only-R-G-described-plus-A,r4-d8-srgb-rg-unspecr3x-cdef-typ2-ok-third,r3x-cdef-typ65535-asoc1-asoc2,r3x-cdef-typ65535-unspec-thirdr3x-big-cmap65535-cdef65535r2-opct-otyp0-nc1r3x-jpch-pclr-only-jp2h-cmap-onlyr3x-opct-ck-palette16-exactr3x-cmap-zero-entries-cdefr2-cmap-mtyp0-pcol0cdef-single-opacityf2-jpch-ihdr-bpccr3x-jp2h-two-pclr-jpch-one-pclrf2-cdef-opacity-for-two-colours-two-channelsr2-md-two-colour-a-twiceFindings that disappear (direct runs):
big-cdef-nc16384-colour,cdef-all-opacity,r2-dp-grey-five-Y,r2-dp-grey-twice,r4-d4-jp2,r4-d4-jp2br-jpxcl,r4-d4-jpxempty,r4-d4-jpxjp2,r4-d4-jpxonly,r4-d4-noftyp,r4-d4-short,r4-d4-two-ftyp,r4-jplh-d4-jpxjp2,r4-jplh-d4-jpxjp2-creg-cdn0,r4-jplh-d4-jpxjp2-creg-cdn1,r4-jplh-d4-jpxonlycdef-g-reserved3,r4-d3-jp2,r4-d3-jp2br-jpxcl,r4-d3-jpxempty,r4-d3-jpxjp2,r4-d3-jpxonly,r4-d3-noftyp,r4-d3-short,r4-d3-two-ftyp,r4-d3only-grey-jpxonly,r4-jplh-d3-jpxjp2-creg-cdn1,r4-jplh-d3-jpxonlyr4-d5-jp2,r4-d5-jp2br-jpxcl,r4-d5-jpxempty,r4-d5-jpxjp2,r4-d5-jpxonly,r4-d5-noftyp,r4-d5-short,r4-d5-two-ftypr4-d6-jp2,r4-d6-jp2br-jpxcl,r4-d6-jpxempty,r4-d6-jpxjp2,r4-d6-jpxonly,r4-d6-noftyp,r4-d6-short,r4-d6-two-ftypcdef-channel-outside,cdef-dup-colour,cdef-dup-conflict,cdef-dup-conflict-rev,r3x-d7-rgb-fourth-undescribed-16,r3x-d7-two-colour-third-undescribed-16,r3y-d7-rgb-desc-8-8-16-fourth-undescribed,r4-d7-jpxonlycdef-declared-0-trailing,cdef-declared-65535-short,cdef-declared-fewer,cdef-declared-more,r3x-cdef-gg-minus1,r3x-cdef-gg-plus1,r4-d2-jpxonlyjpx-jplh-cdef-ga,jpx-jplh-opct-ga,jpx-jplh-opct-rgba-a16,r2-jplh-cdef-and-jp2h-cdef,r2-opct-jp2-brand-only,r2-opct-otyp1-gapclr-2c-alpha-index-grey-cdef,pclr-2c-index-alpha-grey-cdef,pclr-2c-index-alpha-rgb-cdef,pclr-3c-cmap-reorders,pclr-3c-mapped-depthscdef-g-premult,cdef-g-premult-8-16,cdef-g-unspec,cdef-ga,cdef-ga-8-4cdef-two-boxes-first-ga,cdef-two-boxes-first-gg,r4-d1-jpxonlyf2-creg-bad-length,r3x-creg-n0,r3x-creg-n1-plus1big-cdef-nc65535-colour,big-cdef-nc65535-opacity,f2-ihdr-nc16385r2-md-ga-twice,r2-md-ga-twice-4,r2-md-rgba-a-twice-a16cdef-argb-a16,cdef-rgba-a16,cdef-rgba-reversed-entriesr2-cmap-mtyp2,r2-cmap-mtyp255r2-cmap-comp-beyond-nc,r3x-cmap-cmp-eq-nc-8-16cdef-payload-1byte,cdef-payload-emptycdef-before-ihdr,f2-ihdr-secondf2-ihdr-15-bytes,r3x-jpch-ihdr-15-bytes-jp2h-nc2r2-opct-empty-ga,r2-opct-otyp3-gar2-opct-otyp0-trailing-ga,r3x-opct-otyp1-trailingr2-opct-otyp2-nch-mismatch-ga,r3x-opct-ck-nch-plus1f2-opct-ck-16bit-short,r3x-opct-ck-cv-longf2-creg-two-codestreams,r3x-creg-n2-same-cscdef-ga-bpc-out-of-range-alpha,cdef-ga-bpc-out-of-range-colourr3y-bpcc-longr2-cmap-len5r2-cmap-pcol-beyond-colsf2-creg-two-boxescdef-ga-bpcc-missingr2-opct-two-in-jplh-gar2-pclr-header-onlyr2-md-cmyk-a-twice-k16r2-pclr-cmap-depths-16-8-cdef-gar3x-opct-otyp1-ok-rgb-a16r3y-d5-opacity0-premult0-two-channelscdef-rgb-a-ar2-dp-unspec-pair-allowed-16Other:
r3x-opct-ck-palette16-1byter2-pclr-cmap-rgb-a-cdef-b16r3x-jp2h-cdef-first-jpch-ihdrr2-opct-with-palette-2colsHow this rule and the loader report (#787) agree
Read from the source of
fix/image-audit-gapsat9583ec6(not measured): its loader also counts the type-0 entries of the firstcdefbox, compares depths over the colour channels only, and ignores acdefshorter than its count. So for a plain grey + opacity or RGB + opacity file, the 501 report and this rule agree that there is nothing to report. They differ where this rule reads more: acdefthat fails a row (the loader counts its type-0 entries, this rule does not read it), a palette file (the loader keeps the name and does not read the box; this rule numbers the channels throughcmap), and a compositing layer header (the loader drops it). The 6.2.8.3 row indocs/conformance-v2.4.mdis edited here, and #787 edits the same row: if #787 merges first, take its row, which already says colour channels.veraPDF parity
Jpeg2000VeraPdfParityTestsruns 16 cases through both validators and pins the 6.2.8.3 test numbers each reports. All 16 give the same verdicts on veraPDF 1.30.2 and on 1.30.4, each run here against its own install.cdefcdefcdefcdefcdefcmapandcdefcdefcdefcdef/ColorSpace/ColorSpaceMutations
Run in a detached worktree at the head, each restored afterwards; each build's DLL timestamp was printed to confirm the mutation was in the run. Tests run: the 145
Jpeg2000_*cases ofVellumPdf.Conformance.Tests, net10.0.RowI1_IhdrMustBeTheFirstBoxOfJp2hRowI2_IhdrContentsAreFourteenBytesRowI3_NcIsOneTo16384(nc: 16385, read: False)ASecondPaletteOrMappingBox_IsNotTrustedand othersASecondPaletteOrMappingBox_IsNotTrustedand othersPaletteWithoutItsMappingBoxOrTheOtherWayRound_IsNotTrustedand othersRowP3_PclrTooShortForNeAndNpcIsNotReadRowP3_NeIsOneTo1024(entries: 0, read: False)RowP3_NeIsOneTo1024(entries: 1025, read: False)RowP4_NpcIsOneTo255AndEveryColumnHasItsByteRowP4_NpcIsOneTo255AndEveryColumnHasItsByteRowP5_PclrContentsHoldNpcTimesNeValuesOfTheirColumnWidthand othersRowP5_PclrContentsHoldNpcTimesNeValuesOfTheirColumnWidthand othersPaletteColumnsOfDifferentDepths_AreColourChannelsOfDifferentDepths_Finding5and othersAPaletteColumnsSignBitIsNotPartOfItsDepthOrItsWidthRowC2_CmapContentsAreWholeFourByteEntriesRowC3_ReservedMappingTypesAreNotRead(type: 3)and othersRowC4_PcolIsZeroWhenMtypIsZeroRowC5_CmpNamesAComponentOfTheCodestreamRowC5_CmpNamesAComponentOfTheCodestreamRowC6_PcolNamesAPaletteColumnWhenMtypIsOneTwoCdefBoxes_AreNotTrusted_WhicheverComesFirstand othersRowD1_AtMostOneCdefInALayerHeaderRowD2_CdefHasAtLeastOneEntryAndExactlyTheBytesItsCountGivesCdefWithBytesAfterItsLastEntry_IsNotTrustedRowD2_CdefHasAtLeastOneEntryAndExactlyTheBytesItsCountGivesRowD3_ATypeInTheReservedRangeIsNotRead(type: 65534, read: False)and othersRowD4_NoTwoChannelsShareATypeAndAssociationRowD4_TheUnspecifiedPairMayRepeat_AndOneChannelMayRepeatAPairRowD4_TheUnspecifiedPairMayRepeat_AndOneChannelMayRepeatAPairRowD5_AColourHasAtMostOneOpacityChannelRowD5_OneOpacityChannelMayBeDescribedForSeveralColoursRowD6_OpacityComesFromAnUnsignedComponentADescriptionOfAChannelThatDoesNotExist_DescribesNothingAChannelWithSeveralDescriptions_IsColourWhenAnyIsType0and othersRowO1_AtMostOneOpacityBoxInALayerHeaderLayerWithBothAnOpacityBoxAndACdef_IsNotTrustedand othersLayerOpacityBoxOfAReservedType_IsNotTrusted(type: 3)and othersRowO3_OtypIsZeroOneOrTwoRowO4_OtypZeroAndOneCarryNoOtherFieldand othersRowO5_ChromaKeyNchIsTheNumberOfChannelsRowO5_ChromaKeyNchIsTheNumberOfChannelsRowO6_ChromaKeyValuesTakeTheirChannelsDepthRoundedUpToBytesRowO6_ChromaKeyValuesTakeTheirChannelsDepthRoundedUpToBytesAnOpacityBoxOfOtyp0OnOneChannel_LeavesNoColourChannelALayerOfSeveralCodestreams_IsNotNumberedand othersACregNamingCodestream1_ReadsTheSecondCodestreamHeaderTheCodestreamHeadersIhdrAndBpccOverrideTheJp2hDefaultsTheCodestreamHeadersIhdrAndBpccOverrideTheJp2hDefaultsACregNamingCodestream1_ReadsTheSecondCodestreamHeaderand othersACregNamingCodestream1_ReadsTheSecondCodestreamHeaderand othersACregNamingCodestream1_ReadsTheSecondCodestreamHeaderand othersRowD2_CdefHasAtLeastOneEntryAndExactlyTheBytesItsCountGivesand othersRgbPlusOpacityOf16Bits_WithRgbAt8_NoFindingand othersRowO4_OtypZeroAndOneCarryNoOtherFieldand othersRowD1_AtMostOneCdefInALayerHeaderand othersLayerCdef_IsReadAsM117SaysAReaderDoes_ThoughABaselineFileHasNonePaletteColumnsOfDifferentDepths_AreColourChannelsOfDifferentDepths_Finding5and othersPaletteColumnsOfDifferentDepths_AreColourChannelsOfDifferentDepths_Finding5APaletteColumnsSignBitIsNotPartOfItsDepthACregNamingCodestream1_ReadsTheSecondCodestreamHeaderand othersThePaletteIndexComponentOutsideTheDepthRange_IsStillFinding5and othersAPaletteColumnOutsideTheDepthRange_IsFinding5RowD6_OpacityComesFromAnUnsignedComponentand othersCdefCountBelowTheChannelCount_IsNotTrustedand othersRowG1_AtMostOneCregInALayerHeaderRowG2_CregContentsAreFourBytesAndWholeSixByteEntriesThe 69 rows above ran in three passes; the first was at the commit before the last tests were added, and the rows whose tests changed afterwards (D2, D5, O3, O5, O6, P4, P5, palette sign, range, G1, G2, D7) were run again at the head. The lane's mutant that gates APPROX on /ColorSpace was not run again: no line it touches changed. Row I3's lower bound is an equivalent mutant, because NC 0 leaves nothing to check whether the row refuses it or not.
Mutations for the table rows added later
Run in a detached worktree at the head, each restored afterwards, DLL timestamp printed;
Jpeg2000*cases ofVellumPdf.Conformance.Tests, net10.0 (189, 16 parity cases skipped without the oracles). Rows: P1, C1, D1, P2, I4, I5, I7, I8, P6, D5, D6, D8 to D10, G2 and six mutants (S1 to S6) that a weaker test set had let survive plus a throw in five more rows. Mutants of code that no longer exists (the File Type condition and two lines of the I5 check) are not listed; the next section has the mutants of the rows that replaced them.RowP1_AJpchHoldingTwoPclrBoxes_ReadsTheFirstRowC1_AJpchHoldingTwoCmapBoxes_ReadsTheFirstRowD1_ALayerHeaderHoldingTwoCdefBoxes_ReadsTheFirstRowD1_AtMostOneCdefInAHeaderACodestreamHeadersCmapReplacesTheJp2hOneWithoutAJpchPaletteRowI4_ABpcOutsideTableI6_IsReadAndReportedByTest5(bpc: 127, outsideRange: True)RowI5_AJpchIhdrWithBpc255TakesItsBpccFromTheJpchNotFromTheJp2hRowI7_TheCompressionTypeDoesNotChangeWhatIsRead(c: 0)RowI8_UnkCAndIprDoNotChangeWhatIsRead(unkC: 2, ipr: 2)RowI8_UnkCAndIprDoNotChangeWhatIsRead(unkC: 2, ipr: 2)RowD5_ANonColourAssociationIsNotColourOne_AndOneChannelWithBothTypesIsBothRowD5_ANonColourAssociationIsNotColourOne_AndOneChannelWithBothTypesIsBothRowD5_ANonColourAssociationIsNotColourOne_AndOneChannelWithBothTypesIsBothRowD6_ForAPaletteChannelTheSignOfTheColumnDecides_NotThatOfTheIndexComponentRowD3_ATypeInTheReservedRangeIsNotRead(type: 2, read: True)AChannelWithSeveralDescriptions_IsColourWhenAnyIsType0RowD10_AMultipleComponentTransformIsNotLookedFor_TheBoxIsReadAsWrittenRowP1_AJpchHoldingTwoPclrBoxes_ReadsTheFirstRowD1_ALayerHeaderHoldingTwoCdefBoxes_ReadsTheFirstRowD5_ANonColourAssociationIsNotColourOne_AndOneChannelWithBothTypesIsBothACodestreamHeadersIhdrNeedNotBeItsFirstBoxACodestreamHeadersCmapReplacesTheJp2hOneWithoutAJpchPaletteRowD6_ForAPaletteChannelTheSignOfTheColumnDecides_NotThatOfTheIndexComponentRowP3_PclrTooShortForNeAndNpcIsNotReadRowC3_ReservedMappingTypesAreNotRead(type: 2)RowD2_CdefHasAtLeastOneEntryAndExactlyTheBytesItsCountGivesRowD7_EveryChannelHasADescriptionRowO6_ChromaKeyValuesTakeTheirChannelsDepthRoundedUpToBytesRowP6_APaletteColumnOutsideTheDepthRange_IsReadAndReportedByTest5G2-n-at-least-1 survives and is equivalent: an n of 0 also fails the next test (exactly one codestream), so the row changes the text and not the result. The D8 to D10, I6 and I7 mutants make a no-effect row refuse its box, which shows the test pins the reading.
Mutations for the
bpccandcolrrows of the previous roundRun in a detached worktree at
0c17e76, each restored afterwards (git statusclean at the end); the script printed the DLL timestamp and checked the mutated text was in the source. Thecolrtests were namedRowK1_...toRowK5_...then and areColr_*now, and the test names in this table are the current ones; K1-count-short-colr (acolrof 1 or 2 bytes counted) no longer applies, because the rule's threshold is now 4 bytes and the mutant's text is gone. Tests: theJpeg2000*cases ofVellumPdf.Conformance.Tests, net10.0 (209, 16 parity cases skipped without the oracles). A row with effect "none" and no code has a mutant that makes the rule refuse where the row says it reads, which shows its test pins the reading. The code that read the File Type box is gone, so it has no mutants of its own.RowB2_AJpchHoldingTwoBpccBoxes_ReadsTheFirstRowB2_AtMostOneBpccInAJp2hRowB4_BpccHoldsOneByteForEachComponentRowB4_BpccHoldsOneByteForEachComponentandRowI5_Bpc255NeedsABpccBoxWithADepthForEveryComponentRowB3_ABpccNextToABpcOtherThan255_IsNotReadRowB1_ABpccBeforeTheIhdrOfAJpch_IsStillReadRowB5_ABpccThatContradictsTheCodestream_IsReadAsWrittenRowB7_ABpccEntryOutsideTableI8_IsReadAndReportedByTest5RowI9_HeightAndWidthAreNotRead(height: 0, width: 0)RowI9_HeightAndWidthAreNotRead(height: 4294967295, width: 4294967295)Colr_AColrWithNoMethdat_IsNotCountedColr_AMethOutsideTableM22_IsCountedAndJudgedByTest3Colr_AnApproxOtherThanOne_IsNotCountedAsOneand two moreColr_TheEnumeratedColourSpaceIsTheFourBytesAfterApproxOfAMeth1BoxColr_AnEnumeratedColourSpaceOtherThan161718_IsReadAndOnly19IsReportedRowD6_APremultipliedOpacityChannelComesFromAnUnsignedComponentTooRowD6_OpacityComesFromAnUnsignedComponentand two morejp2)RowsD3ToD6_AreAskedWhateverTheFileTypeBoxListsMutations for the narrowed table, the
colrlength and thebpcclength casesRun in a detached worktree at
4652ca7, restored afterwards (git statusclean); the script checked the mutated text was in the source. Tests: theJpeg2000*cases ofVellumPdf.Conformance.Tests, net10.0 (207, 16 parity cases skipped without the oracles). The table's rows for the File Type box andcolrno longer exist, so their mutants are gone with them.colrof 3 bytes counted, as before)Colr_AColrWithNoMethdat_IsNotCountedbpcclonger than NC read from its first NC bytes)RowB4_AJpchBpccOfAnotherLength_IsRefusedToo(survived the previous round)bpccof NC-1 bytes read, its last entry repeated)RowB4_BpccHoldsOneByteForEachComponent, its NC 3 case of 8 and 16 bits (survived the previous round)RowB2_AJpchHoldingTwoBpccBoxes_ReadsTheFirstColr_TheEnumeratedColourSpaceIsTheFourBytesAfterApproxOfAMeth1BoxMutations for the
bpccpairing and the other-BPC casesRun in the head's worktree at
d5d1e46, restored afterwards (git statusshowed only the documents changed after it); the script printed each DLL's timestamp and checked the mutated text was in the source. Tests: theJpeg2000*cases ofVellumPdf.Conformance.Tests, net10.0 (210, 16 parity cases skipped without the oracles).bpccwith no jpchihdrread with the jp2hihdr)RowI5_AJpchBpccWithNoJpchIhdr_IsNotReadWithTheJp2hIhdrbpccbeside BPC 0x26 makes the depths unknown)RowB2_WithABpcOtherThan255TwoBpccBoxesChangeNothingandRowB4_WithABpcOtherThan255ABpccOfAnotherLengthChangesNothingbpccbeside BPC 0x26)RowB2_WithABpcOtherThan255TwoBpccBoxesChangeNothingThe two B mutants survived the previous round because both read BPC 7, where unknown and known depths give no finding; the new tests use BPC 0x26 (39 bits), where test 5 reports only when the depths are known.
Cost
ReadCdefColourChannelskeeps two dictionaries, one for the (type, association) pairs and one for opacity, andResolveChannelsreads eachcmapentry once, so both are linear in the entry count. Channels are not bounded by NC (the mapping box makes one channel per 4 bytes), so the largest case is not the NC row's: acmapof 65,535 entries with acdefof 65,535 entries, trusted, in a 656,177-byte file (r3x-big-cmap65535-cdef65535). Release, net10.0, 5Validatecalls averaged, two runs: 5.5 and 4.7 ms here, 1.2 and 1.1 ms onmain. A palette of 1024 entries of 255 columns of 38 bits (1,307,692 bytes): 3.2 and 1.7 ms here, 1.9 and 1.5 ms onmain. Other processes ran on the machine during these runs (one test host was counted at the start, CPU load 59%), so the figures are loose; the shape, a few milliseconds for the largest file the table accepts, is what they support.Not done
cref) in a layer header is not followed (15444-2 M.5.2.2, M.11.7 last paragraph, M.9.2.6):cref-opct-gaandcref-cdef-gakeep main's finding 1 where the text finds none. Following it needs the fragment-list box and the file offsets it names; filed for Tracking: defects found while doing the v2.4 work (not yet fixed) #613.cgrp) in a layer header replaces thejp2hcolour specifications for that layer (M.11.7); tests 2 to 4 still read thejp2hones. Which set 6.2.8.3 counts then is a NEN question, so it is not guessed; filed for Tracking: defects found while doing the v2.4 work (not yet fixed) #613.cdefor an Opacity box in a layer header makes the file a non-baseline JPX (M.9.2.7); the rule reads it as M.11.7 says a reader does, and the class remarks and the test name say so.pclr,cmapandcdeflayouts and the channel type values come from ISO/IEC 15444-1, which is not held; the rows rest on the notes of the NEN reading (evidence rows e13 to e19, e45 to e49, e52, e58 to e60). A wrong reading can leave a file unread, and can also make the rule report: types 65535 and 2 counted as colour would remove findings, and acdefthat describes a channel twice or names channels past the last would change them.jpchfor a codestream the rule does not number.cregbox in every layer header once one has it (M.11.7.7).Needs a NEN reading
cmapwith no entries is allowed. The rule reads it as a layer of no channels, which has no colour channel.colrbox require beyond the layout and fields tests 2 to 4 read (a JP2 file's APPROX and PREC "shall be set to zero" in the notes, against 6.2.8.3's APPROX of 1). The table does not cover either box, so no sentence of the change rests on them.