Skip to content

stet 0.7.0 — PDF-only builds drop the PostScript VM

Choose a tag to compare

@AndyCappDev AndyCappDev released this 30 Aug 06:08
· 31 commits to main since this release

A dependency-hygiene release. A PDF-only consumer no longer compiles the
PostScript interpreter, a mesh-shading memory fault that scaled with core
count is fixed, and --device null works for the scripting use it is
documented for.

Breaking

One change, affecting only consumers who already opt out of stet-render's
default features. This is why the bump is minor rather than patch.

  • stet-render with default-features = false no longer provides
    SkiaDevice or its OutputDevice implementation.
    They now sit behind the
    new default-on ps-device feature. At 0.6.0, opting out of defaults dropped
    only parallel; it now drops the device as well, so a consumer who declared
    stet-render = { version = "0.6", default-features = false } to get a
    single-threaded build will fail to compile against 0.7. Add the features you
    want by name:

    stet-render = { version = "0.7", default-features = false, features = ["ps-device"] }

    Nothing changes for consumers on default features, which is the overwhelming
    majority: default = ["parallel", "ps-device"].

Changed

  • stet-pdf-reader no longer links the PostScript interpreter. Its
    default features pulled stet-render, which depended unconditionally on
    stet-core for a single trait, so a PDF-only consumer compiled the whole
    PostScript VM — contradicting the README's "PDF-only users don't pay for the
    VM". stet-render now gates SkiaDevice and its OutputDevice
    implementation behind a new default-on ps-device feature, and the reader
    takes the crate without it. stet-pdf-reader's dependency closure is now
    stet-fonts, stet-graphics, stet-render and the two tiny-skia forks,
    with PDF → RGBA rendering and parallelism unchanged.

    Consumers on default features are unaffected; see Breaking above for the
    one case that is not.

Fixed

  • --device null aborted PostScript programs that query the page device.
    The flag is documented for "test / scripting use", but it installed the PLRM
    nulldevice operator rather than a page device. That resets the CTM to
    identity and leaves no page-device parameters, so currentpagedevice /OutputDevice get raised undefined and initmatrix had no device matrix
    to restore — stet's own PostScript test suite aborted partway through under
    the flag meant for running it. --device null now installs a real page
    device (a new OutputDevice/null.ps resource) that reports itself as
    /null, carries a page size and resolution like any other device, and still
    produces no output: nothing is rasterized and /EndPage never transmits a
    page. The suite now passes identically on png, pdf and null, and CI
    runs it on null as well so this cannot regress unnoticed.

  • Mesh-shaded PDFs could exhaust memory and fail to render, worse the more
    cores the machine had.
    render_patch_shading triangulated every patch of
    a shading regardless of which band was being drawn, and bands render
    concurrently — one per thread — so the same triangle list was built once per
    core. Cost scaled with core count rather than with the file. A prepress PDF
    with a page-spanning Coons mesh at 300 dpi peaked at 2.1 GB on one thread and
    31.4 GB on sixteen, and on a 24-core machine with less than ~50 GB of RAM it
    did not render at all. Patches and triangles that cannot reach the band being
    drawn are now skipped before they are built. The same file now renders in
    0.94 s at 2.2 GB on 24 threads, and CPU time at 16 threads fell from 99.1 s
    to 5.8 s — the surplus was duplicated work, so throughput improves alongside
    memory. Rendered output is byte-identical.