Bug 702155 - Cluster indeterminism with pdfwrite of gradient
Summary: Cluster indeterminism with pdfwrite of gradient
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: master
Hardware: PC Windows 10
: P4 normal
Assignee: Michael Vrhel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-25 10:11 UTC by Robin Watts
Modified: 2021-09-08 09:08 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Watts 2020-02-25 10:11:12 UTC
Created attachment 18890 [details]
peeved.pdf

The tests_private/ps/ps3cet/12-14A.PS.pdf.pkmraw.300.0..gs_pdf test in the cluster is frequently indeterministic. It's a pdfwrite test, and testing indicates that it's the pdfwrite stage that changes.

bin/gs -sOutputFile=out.pdf -sDEVICE=pdfwrite -r300 -Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -dClusterJob -dJOBSERVER -dCETMODE %rom%Resource/Init/gs_cet.ps - < ./tests_private/ps/ps3cet/12-14A.PS

For a while I think I was finding that binaries with tiny insignificant changes in unrelated bits of code run on the same machine was enough to generate different output files, but that stopped reproducing for me.

I did find that running the binaries built from the same source on 2 different machines (peeves/rods) were enough to generate different outputs.

I attach the outputs generated on these machines.
Comment 2 Robin Watts 2020-02-25 10:16:00 UTC
Note that both these files appear at first glance to be the same when viewed in Acrobat Reader. The difference with gs appears on page 6 in Test 5 when rendered with the following command:

bin/gs -o out.pkm -dMaxBitmap=400000000 -sDEVICE=pkmraw -r300 -Z: -sDEFAULTPAPERSIZE=letter rods.pdf

The files are non-trivially different in terms of the ordering of the output objects, however once I extracted page 6 and cut the file down, the difference in the shading in question is very small.

The colorspace used for the pattern is:

  [ /Separation /Cyan /DeviceCMYK 3 0 R ]

in one (the one that renders correctly) and

  [ /Separation /Gray /DeviceCMYK 3 0 R ]

in the other.
Comment 5 Robin Watts 2020-02-25 10:19:30 UTC
rods9.pdf and peeved9.pdf are the cut down files.

To verify that the difference is indeed just the /Gray vs /Cyan, I edited rods9.pdf to change from one to the other and that does indeed solve the problem.

Valgrind doesn't show any problems with the file either in a release build, or a mementovg one.
Comment 6 Michael Vrhel 2020-02-28 00:15:01 UTC
Just adding this commit that looked into the quantization issue with the output relative to what AR was giving.

http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=fa1bc6dce44b6fc69e9852553aec4b7a419d0d9c

I believe with Ken's commits this bug should be closed now.
Comment 7 Robin Watts 2021-09-08 09:08:01 UTC
Closing thanks to Michael's comments. Will reopen if the problem recurrs.