Skip to content

docs: document all environment variables read by the crate - #62

Merged
nh13 merged 1 commit into
mainfrom
docs/environment-variables
Jun 30, 2026
Merged

docs: document all environment variables read by the crate#62
nh13 merged 1 commit into
mainfrom
docs/environment-variables

Conversation

@nh13

@nh13 nh13 commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Adds docs/environment-variables.md — an exhaustive, audited list of every environment variable the crate reads, grouped by who reads it, with accepted values, defaults, and effects. Links it from the README.

The audit (every env::var/env::var_os/option_env!/env! site across the crate, sub-crates, examples, benches, and tests) found:

  • One runtime knob in the production library: PRMI_ISA. Presence-only; enables the byte-identity-safe ISA reseed fast-path in the fused SMEM collector (collect_smems) when a .isa sidecar is present. Read once per process via OnceLock, so it is not on any per-read hot path. Cuts per-reseed SA probes from ~10–20 (cold model launch) to ~1–2 (confirm-only warm start).
  • Everything else is dev-only. All other PRMI_*/FIX_* variables are read solely by the benchmark, example, and fixture-generator binaries under examples/, benches/, and prmi-sys/examples/ — they have no effect on a linked consumer.
  • CARGO_MANIFEST_DIR, OUT_DIR, CARGO_PKG_VERSION are standard Cargo build-script variables, listed for completeness.

The doc also calls out a naming collision that has caused confusion: the bwa-mem3 consumer's PRMI_ZIGZAG_ISA is a separate, consumer-only variable affecting the consumer's non-fused 'zigzag' finder; to enable this library's ISA reseed on the consumer's default fused path you set PRMI_ISA in the process environment.

Notes

  • Docs-only; no library or FFI behavior changes.
  • The PRMI_ISA read site in collect.rs was already documented in code; this PR centralizes the full list.

Summary by CodeRabbit

  • Documentation
    • Added a new environment variables reference page covering all supported runtime, build, benchmark, example, and test settings.
    • Clarified the production-facing PRMI_ISA variable, including its behavior and default handling.
    • Updated the README to point to the full environment variable list and note which settings affect linked consumers versus local tooling.

Add docs/environment-variables.md: an exhaustive, audited list of every
environment variable the crate reads, grouped by who reads it.

The only runtime knob that affects the production library is PRMI_ISA
(presence-only; enables the byte-identity-safe ISA reseed fast-path in the
fused SMEM collector when a .isa sidecar is present, read once per process
via OnceLock). Every other PRMI_*/FIX_* variable is read solely by the
benchmark, example, and fixture-generator binaries under examples/, benches/,
and prmi-sys/examples/, and has no effect on a linked consumer. CARGO_* and
OUT_DIR are standard Cargo build-script variables.

Also note the consumer-side name collision: bwa-mem3's PRMI_ZIGZAG_ISA is a
separate consumer-only variable; PRMI_ISA is what toggles this library's ISA
reseed on the consumer's default fused path.

Link the new page from the README.
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fbf68251-4189-4213-9b3f-eee27eaa518d

📥 Commits

Reviewing files that changed from the base of the PR and between 3b9e2c6 and 2dcbb46.

📒 Files selected for processing (2)
  • README.md
  • docs/environment-variables.md

Walkthrough

Adds docs/environment-variables.md (113 lines) documenting PRMI_ISA (production), Cargo build-script variables, and all dev/bench/test harness knobs. README.md gains a 9-line "Environment variables" section summarising PRMI_ISA and linking to the new doc.

Environment Variable Documentation

Layer / File(s) Summary
PRMI_ISA runtime semantics + README pointer
README.md, docs/environment-variables.md
README adds a summary section; doc page details PRMI_ISA presence-only semantics, .isa sidecar fast-path, caching location, and Cargo build-script compile-time variables.
Dev/bench/test harness variables
docs/environment-variables.md
Tables covering corpus/input selection, seeding parameters, timing/batching/strategy knobs, criterion/benchmark corpus variables, and make_fixture synthetic generator defaults.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 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 accurately summarizes the main change: auditing and documenting all environment variables read by the crate.
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 docs/environment-variables

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@nh13

nh13 commented Jun 29, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nh13

nh13 commented Jun 29, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nh13
nh13 merged commit 332711c into main Jun 30, 2026
4 checks passed
@nh13
nh13 deleted the docs/environment-variables branch June 30, 2026 00:27
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