Skip to content

parity_suite.sh: run on macOS, and flag runs that read no reads - #369

Open
BenjaminDEMAILLE wants to merge 1 commit into
mainfrom
fix/parity-suite-macos
Open

BenjaminDEMAILLE wants to merge 1 commit into
mainfrom
fix/parity-suite-macos

Conversation

@BenjaminDEMAILLE

@BenjaminDEMAILLE BenjaminDEMAILLE commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Part of #354 (test/parity_suite.sh on macOS).

Problem

On macOS, test/parity_suite.sh cannot produce one real comparison, and it does not say so.

  • timed calls /usr/bin/time -f "%e %M". macOS's time has no -f, so every index build and alignment is reported as failed.
  • The chr21 download checks "$(gunzip -c … | wc -l)" = 8000000. macOS's wc pads the count with spaces, so a complete 8,000,000-line file is reported as download incomplete and fetch stops.
  • Every alignment passes --readFilesCommand zcat. On macOS, zcat is the compress one: it only reads .Z files. STAR and rustar-aligner both read 0 reads, exit 0, and parity_compare.py prints records 0/0, identical 0 … Log.final.out: identical for all 21 configurations.

The last one is the dangerous part. I ran the suite on macOS this way first: every configuration "matched".

Change

  • timed runs the command through a few lines of Python (resource.getrusage(RUSAGE_CHILDREN)), and writes the same seconds KB file that parity_compare.py reads. ru_maxrss is in bytes on macOS and KB on Linux; the script converts.
  • The wc -l count goes through tr -d " ".
  • ZCAT=$(command -v gzcat || echo zcat): gzcat on macOS, zcat on Linux. It stays one word, because main still takes one word for --readFilesCommand (--readFilesCommand takes what STAR takes #353 changes that).
  • parity_compare.py prints a WARNING when either tool's Log.final.out reports 0 input reads.
  • The header says that Homebrew's STAR stops on geneInfo.tab with --quantMode or --soloType. From STAR's source, that comes from the build, not from the options: Transcriptome.cpp:13 reads trInfoDir from sjdbInsert.outDir, which is empty, while Genome_genomeLoad.cpp loads the index parameters into a separate P1. A Linux build of the same 2.7.11b source runs them. I did not dig further into the Homebrew build.

Measured

macOS (Apple silicon), Homebrew STAR 2.7.11b for alignment and a Linux (Docker, arm64) build of the 2.7.11b source for the quant and solo configurations, main at 32fbbc1:

Before After
fetch stops at ERR188021_1: download incomplete completes
y10k_se 0 / 0 records, "identical" 9,724 / 9,724 identical, 0 reads differ
peak RSS column n/a STAR 940 MB, rustar-aligner 168 MB
a run that read 0 reads silent WARNING: rustar-aligner read 0 reads; check --readFilesCommand (y10k_se)

With these changes the whole suite reproduced the README's comparison on macOS: yeast 0 differing reads in every configuration (1 in y100k_pe_attr), chr21 PE 3, fusion 24, solo default 36/36 files identical. The only new observation is in Log.final.out on yeast PE: 15,208 "too short" and 26 "other" for STAR against 15,209 and 25, which the README does not mention.

Tests

None added: this is test tooling. The timing helper was checked on a 50 MB allocation (61,792 KB reported) and on a failing command (exit code passed through), and bash -n passes.

Not checked

  • Linux: the changes keep GNU time's output format and fall back to zcat, but I did not rerun the suite on Linux.
  • Only the steps listed above were changed; macOS's bash 3.2 runs the script.

🤖 Generated with Claude Code

On macOS the suite could not produce a single real comparison:
/usr/bin/time has no -f, `wc -l` pads its count so the chr21 download check
always failed, and `--readFilesCommand zcat` reads only .Z files there, so
STAR and rustar-aligner both read 0 reads, exited 0, and compared as
identical. Timing now goes through Python's resource module (same
"seconds KB" file), the count is trimmed, and gzcat is used where it
exists. parity_compare.py warns when a tool read 0 reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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