Skip to content

Check the R env against its pin file and report every reference difference - #16

Merged
adamfreedman merged 2 commits into
version_harmonize_devfrom
ci_env_check_dev
Nov 20, 2026
Merged

adamfreedman merged 2 commits into
version_harmonize_devfrom
ci_env_check_dev

Conversation

@adamfreedman

@adamfreedman adamfreedman commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Why

The full-workflow check failed on #15, and on this PR's first commit, because GitHub's runner computes SCTransform slightly differently from the cluster, not because of a workflow change. The failures came during GitHub's move of ubuntu-latest to Ubuntu 26.04 (October 19 to November 19, 2026). The last passing run, on October 14, still ran on 24.04.

The first commit's failure artifact showed:

  • Same inputs: the RNA counts of all 27 objects match the references exactly, so every step got the same input as on the cluster.
  • Different SCT fits: in every object, SCTransform's first-step dispersion estimate differs for a few nearly Poisson genes; in the worst cases it is infinite on one side and finite on the other. In 2 objects, that changed 21 rounded SCT counts and moved 2 cells to another cluster, which is what the check caught.
  • Cluster reproduces the references from GitHub's inputs: rerunning those two steps on the cluster (Rocky 8, glibc 2.28) gives every SCT model value identical to the references. In Ubuntu 24.04 (glibc 2.39) they differ by at most 5e-8, and no count changes.

Changes

  • Rocky Linux 8 container: the full-workflow job now runs in rockylinux:8.10 with LANG=en_US.UTF-8, as on the cluster, so R computes with the same C math library as the runs that made the references. Its Snakemake environments are cached under a new key, because Snakemake hashes each environment's path into its name, and the CellBender shim's path comes from $GITHUB_WORKSPACE.
  • Pin check: tests/test_r_env_pin.py, in the default suite, builds or reuses the rule R environment. It fails when the environment doesn't hold exactly the pin file's packages, and lists the packages that differ and the error conda gave.
  • Full report: tests/test_snakemake_workflow_run.py and tests/compare_seurat_metadata.R report every difference instead of stopping at the first.
  • Annotations: on GitHub Actions, failing tests also print their report as an error annotation on the run's summary page.
  • Artifact: when the full-workflow job fails, it uploads testdata/results, Snakemake's logs and each rule environment's package list as full-workflow-outputs, kept for 14 days.

No workflow rule, default, tolerance or reference output changes.

Checks

The full-workflow check passes in the container (run 44757651102): the workflow ran in full (2 h 19 min) and every output matches the references.

🤖 Generated with Claude Code

adamfreedman and others added 2 commits November 19, 2026 18:37
…rence

The full-workflow check on the vars_to_regress PR failed on one reference
comparison (nCount_SCT off by up to 2 in one DoubletFinder object) and stopped
there, while the same objects match the references on the cluster. The likeliest
cause is that GitHub's R environment is not the pinned one: when installing from
the pin file fails, Snakemake builds the environment from scrnaseq_r.yml instead,
and pytest hides its warning because it captures Snakemake's output.

- tests/test_r_env_pin.py builds (or reuses) the rule R environment and fails
  when it does not hold exactly the pin file's packages, listing the packages
  that differ and the error conda gave.
- The full-workflow test and compare_seurat_metadata.R report every difference
  instead of stopping at the first. Tolerances are unchanged.
- On GitHub Actions, failing tests also print their report as an error
  annotation, and a failing full-workflow job uploads testdata/results,
  Snakemake's logs and each rule environment's package list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The check failed on PR #15 and PR #16 because GitHub's runner computes
SCTransform slightly differently from the cluster, not because of the
workflow. The failing runs came during GitHub's move of ubuntu-latest to
Ubuntu 26.04 (October 19 to November 19, 2026); the last passing run,
on October 14, still carried the migration notice that 24.04 runs show.

In run 44668646672's artifact, the RNA counts of all 27 objects match
the references exactly. What differs, in every object, is SCTransform's
first-step dispersion estimate for a few nearly Poisson genes: infinite
on one side and finite on the other in the worst cases. In 2 of the 27
objects, that changed 21 rounded SCT counts and moved 2 cells to
another cluster. Rerunning those two steps from GitHub's own inputs on
the cluster (Rocky 8, glibc 2.28) reproduces the references, with every
SCT model value identical; in Ubuntu 24.04 (glibc 2.39) they match to
about 1e-10.

The job now runs in rockylinux:8.10 with LANG=en_US.UTF-8, as on the
cluster. Its CellBender shim path comes from $GITHUB_WORKSPACE, because
${{ github.workspace }} names the runner's directory in a container
job, and its Snakemake environments are cached under their own key,
because Snakemake hashes each environment's path into its directory
name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamfreedman
adamfreedman merged commit 917f774 into version_harmonize_dev Nov 20, 2026
13 checks passed
@adamfreedman
adamfreedman deleted the ci_env_check_dev branch November 20, 2026 22:02
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