Skip to content

Tools: reverse-dependency vignette sweep (dev/revdep) - #131

Merged
seandavi merged 7 commits into
develfrom
tools/revdep-sweep
Nov 17, 2026
Merged

seandavi merged 7 commits into
develfrom
tools/revdep-sweep

Conversation

@seandavi

Copy link
Copy Markdown
Contributor

Summary

Adds dev/revdep/, a Docker-based tool that renders the vignettes of Bioconductor packages that use BiocStyle twice: once with a baseline BiocStyle (a git ref, origin/devel by default) and once with a candidate (a ref or a local path, the working tree by default). It writes dev/revdep/results/<timestamp>/report.md. The report lists NEW FAILURES (ok → error) and FIXED (error → ok) at the top, then changed outputs, then a per-vignette table.

just revdep-sweep baseline=origin/devel candidate=. n=60
just revdep-sweep pkgs=Glimma,DESeq2        # subset
just revdep-sweep resume=<timestamp>        # resume
  • Image: bioconductor/bioconductor_docker:devel (native arm64 on Apple Silicon) plus poppler plus TinyTeX. The LaTeX packages are installed by the existing .github/scripts/install-tex.R. R libraries are cached in the named volume biocstyle-revdep-cache-<arch>.
  • Package selection: reverse dependencies of BiocStyle in Bioc devel (Depends/Imports/Suggests), top-n by bioc_pkg_scores.tab, plus dev/revdep/forced.txt (Glimma, a DT widget vignette, BiocStyle::pdf_document, Rnw + BiocStyle::latex(), kableExtra).
  • Rendering uses tools::buildVignette() (the function R CMD build uses). Each vignette renders in a fresh process with a per-vignette timeout and a seeded RNG. Each BiocStyle variant is installed in its own library.
  • Comparison: HTML is normalized and then diffed. The normalization strips dates and times, ids, addresses, paths and Hub cache messages; base64 payloads are decoded (text) or hashed (binary). PDF comparison uses page count plus normalized pdftotext text.
  • dev/ and justfile are added to .Rbuildignore, and dev/revdep/results/ to .gitignore. I checked that R CMD build leaves them out.

Verification (local, Apple Silicon, Docker 29)

  • Zero-diff run: baseline = candidate = origin/devel, with n=3 plus Glimma, GeneOverlap (Rnw/PDF) and DirichletMultinomial (DT widget). All 12 vignettes rendered in both variants, with 0 changed, 0 new failures. Total time was 7m31s with a warm cache. Getting to zero took several normalization fixes, each driven by noise seen in earlier runs: bytecode addresses, Hub download vs cache messages, system.time() numbers, and unseeded lattice jitter in a PNG.
  • Injected change: the candidate was a temp copy with h1.title color changed in bioconductor.css, plus BiocBlue changed in Bioconductor.sty. The run flagged every BiocStyle HTML vignette with exactly that 2-line CSS diff, and showed no change for the non-BiocStyle vignette. The PDF color change was not detected because the text and page count stay the same (see caveats).
  • In an earlier injected run, origin/devel had moved to include Omit affiliation marks for a single shared affiliation; always show affiliations in PDF #126. The tool also caught that PR's author/affiliation markup change in DirichletMultinomial.

Caveats / gaps

  • A PDF comparison based on text and page count misses purely visual PDF changes. A follow-up could hash pages rendered with pdftoppm.
  • jobs=2 (concurrent baseline/candidate) is opt-in only: the two renders collided on BiocParallel's seeded port.
  • n=60 has not been timed. The README gives an extrapolated estimate.

🤖 Generated with Claude Code

seandavi and others added 7 commits November 17, 2026 09:22
Docker image, host driver, in-container sweep, per-vignette renderer,
dependency installer, and HTML/PDF comparison + report. Not yet verified
end to end.

Co-Authored-By: Claude <noreply@anthropic.com>
- Render in a per-variant copy on the container filesystem; the macOS bind
  mount broke HDF5 file locking and chmod (SparseArray, BiocParallel).
- Default to rendering the two variants sequentially (jobs=1): concurrent
  renders collided on BiocParallel's seeded socket port.
- Load VignetteBuilder namespaces instead of passing buildPkg=, which hid
  utils::Sweave for packages with VignetteBuilder: knitr.
- Normalize memory addresses, pandoc code-line anchors, system.time()
  numbers and Hub cache download/load messages.

Co-Authored-By: Claude <noreply@anthropic.com>
DirichletMultinomial's densityplot jitters points without a seed, so the
embedded PNG differed between two renders of identical sources.

Co-Authored-By: Claude <noreply@anthropic.com>
install-tex.R now reads inst/resources/tex/required-packages.txt from the
working directory; pass that directory as a second build context.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@seandavi
seandavi merged commit 5fd68a9 into devel Nov 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant