Skip to content

ci(miri): disable Miri isolation so the raw-bam proptest can run - #701

Merged
nh13 merged 1 commit into
mainfrom
nh/fix-miri-getcwd-isolation
Aug 2, 2026
Merged

nh13 merged 1 commit into
mainfrom
nh/fix-miri-getcwd-isolation

Conversation

@nh13

@nh13 nh13 commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

Summary

The Miri workflow has never passed. Every one of its 13 runs since it was added on 2026-07-21 has failed, always in the same place:

error: unsupported operation: `getcwd` not available when isolation is enabled
   = note: this is on thread `sort::tests::te`
  13: sort::tests::test_natural_compare_agrees_with_nul

It fails on a daily cron, so the red has gone unnoticed.

Cause

test_natural_compare_agrees_with_nul is a proptest. Before running a single case, proptest resolves the path to its .proptest-regressions file through std::env::current_dir() — and getcwd is unsupported under Miri's default isolation. The failure is in proptest's setup, not in the code under test or in the property itself.

The other 23 tests in the step pass. This one aborts the step, so the workflow has never reported a real result on the unsafe it exists to check.

Why disable isolation rather than skip the test

That test is the one most worth keeping: it is the agreement check between natural_compare and natural_compare_nul, the raw-pointer comparator this whole step exists to interpret under Miri. Skipping it, or filtering it out of the step, would leave the gate looking green while no longer covering the *const u8 walk.

Disabling isolation for this step is safe. These tests are pure comparator calls over in-memory byte buffers — they open no files, read no clock, and reach for no host state of their own. The only isolated operation in play is the cwd lookup proptest performs on their behalf. Stacked Borrows and the rest of Miri's UB checking are unaffected; -Zmiri-disable-isolation relaxes only host-interaction shims.

Second effect, also fixed

Miri's isolation blocks environment access too: an isolated env::vars_os() returns none of the host variables. So the workflow-level PROPTEST_CASES: "32" — added to keep this very test tractable under the interpreter — has been silently ignored on every run, and the test has been running proptest's default case count whenever it got that far. Disabling isolation makes that cap effective for the first time. The comment above it now records the dependency so it does not get "cleaned up" later.

This is also why the narrower fix does not work: PROPTEST_DISABLE_FAILURE_PERSISTENCE=1 would avoid the getcwd call, but proptest never sees the variable under isolation. I tried it first and it changed nothing.

Verification

Run locally on this branch, with the exact command and environment the workflow uses:

$ MIRIFLAGS=-Zmiri-disable-isolation PROPTEST_CASES=32 \
    cargo +nightly miri test -p fgumi-raw-bam sort
test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 694 filtered out; finished in 15.62s
exit 0

Before the change, the same command without MIRIFLAGS exits 1 on the proptest. Both directions were confirmed, as was the environment behaviour: a probe variable produces proptest's "Ignoring unknown env-var" warning with isolation off and no warning with it on.

Note for #697

main-runall adds a second Miri step for fgumi-pipeline-core. Because both steps share one job under bash -e, this failure aborts the job before that step runs — so the new step has never executed in CI either. It is verified locally only. Once this lands and main-runall picks it up, that step will run for real.

Summary by CodeRabbit

  • Chores
    • Updated continuous integration testing configuration to support expanded property-based test coverage.
    • Improved raw-pointer comparator checks in the Miri test environment while preserving in-memory test behavior.

@nh13
nh13 temporarily deployed to github-actions August 1, 2026 22:10 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Miri isolation prevents proptest environment-variable and regression-file lookup. The workflow documents the case limit and disables isolation for raw-pointer comparator tests.

Changes

Miri workflow updates

Layer / File(s) Summary
Configure proptest execution
.github/workflows/miri.yml
The workflow documents the PROPTEST_CASES limitation and sets MIRIFLAGS: -Zmiri-disable-isolation for comparator tests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the Miri workflow change and the reason for disabling isolation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nh/fix-miri-getcwd-isolation

Comment @coderabbitai help to get the list of available commands.

@nh13

nh13 commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai pause

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/miri.yml:
- Around line 73-75: Update the explanatory comment near the comparator tests to
document both host accesses: proptest invokes std::env::current_dir() for
failure-persistence lookup and reads PROPTEST_* environment variables, including
PROPTEST_CASES.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c9f172e5-be32-43ff-96a1-b672a34bd912

📥 Commits

Reviewing files that changed from the base of the PR and between cba0173 and 7765daf.

📒 Files selected for processing (1)
  • .github/workflows/miri.yml

Comment thread .github/workflows/miri.yml Outdated
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews paused.

@codecov

codecov Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.95%. Comparing base (cba0173) to head (2ebd016).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #701      +/-   ##
==========================================
+ Coverage   93.92%   93.95%   +0.03%     
==========================================
  Files         178      178              
  Lines      108062   108080      +18     
==========================================
+ Hits       101494   101544      +50     
+ Misses       6568     6536      -32     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The Miri workflow has failed on every run since it was added: all 13
scheduled runs aborted on `test_natural_compare_agrees_with_nul` with
`getcwd not available when isolation is enabled`.

The test itself is fine. Before running any case, proptest resolves the
path to its `.proptest-regressions` file through `std::env::current_dir()`,
and `getcwd` is unsupported under Miri's default isolation. The other 23
tests in the step pass; this one aborts the step, so the workflow has
never reported a real result.

That test is the one worth keeping: it is the agreement check between
`natural_compare` and `natural_compare_nul`, the raw-pointer comparator
this step exists to interpret. Skipping it would hollow out the gate, so
disable isolation instead. These tests are pure comparator calls over
in-memory byte buffers and reach for no host state of their own.

Isolation also blocked the environment: an isolated `env::vars_os()`
returns none of the host variables, so the `PROPTEST_CASES: "32"` cap has
been silently ignored as well. It takes effect now.

Verified locally: 30 passed, 0 failed, exit 0, ~16s.
@nh13
nh13 force-pushed the nh/fix-miri-getcwd-isolation branch from 7765daf to 2ebd016 Compare August 2, 2026 00:05
@nh13
nh13 temporarily deployed to github-actions August 2, 2026 00:05 — with GitHub Actions Inactive
@nh13
nh13 merged commit e302b03 into main Aug 2, 2026
12 checks passed
@nh13
nh13 deleted the nh/fix-miri-getcwd-isolation branch August 2, 2026 00:09
@nh13 nh13 mentioned this pull request Aug 2, 2026
@nh13 nh13 mentioned this pull request Aug 15, 2026

This branch was previously deployed

1 inactive deployment
github-actions — 2ebd016e Deployed Aug 2, 2026 by nh13 via coverage #3218
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