Compatibility overview: what 83/83 means

"Bash compatible" is a sentence anyone can say. niubash's version is measured, not claimed: take GNU Bash's own 83 upstream test corpora, run a true-baseline bidirectional differential on real Windows hardware, and the result is 83/83 passing with 82 suites byte-identical in output — the single residual proven byte-for-byte to be a race inside GNU Bash itself. This page explains exactly what those numbers mean and how they were measured.

What a true-baseline differential is

The easiest place to water down a compatibility measurement is the baseline. Run upstream tests without pinning the environment, or let script stubs stand in for real tools, and the pass rate means nothing. rubash's ledger (full rerun 2026-10-12 on master 764b9dde) records the baseline discipline: no upstream test stubs, real /bin/sh mounted by niu, a per-suite TMPDIR, foreground timeout control; a pure-baseline failure set is run first on the same machine and environment, and the bidirectional comm must be empty before anything counts — directional differences in either direction (GNU fails / engine passes, or engine fails / GNU passes) must be driven to zero. Environment-bound differences (NTFS attribute bits, locale, host tool output, /dev/tty…) are audited item by item before counting as zero.

中文原文 · Chinese original

兼容性测量最容易掺水的环节是「基线」。跑上游测试却不固定环境、或让脚本桩替代 真实工具,测出的通过率毫无意义。rubash 的台账(2026-10-12 在 master 764b9dde 全量复跑)记录了基线纪律:不使用上游脚本桩、由 niu 挂载真实的 /bin/sh、每套件独立 TMPDIR、前台超时控制; 同机同环境先跑纯基线失败集,双向 comm 为空才放行——即 GNU 失败而引擎通过、或引擎失败而 GNU 通过的方向性差异都要归零。环境绑定差异 (NTFS 属性位、locale、宿主工具输出、/dev/tty 等)逐项审计后才计为零。

语义判定的一手依据是仓内 vendored 的 GNU bash-5.3 源码:每个行为主张给出 file:line 坐标;WSL 里的 GNU 5.3.0 只做行为验证。GPL 代码零拷贝, 判定纪律成文于 PROVENANCE 文档。

What 83/83 and 82 byte-identical suites mean

MetricValueMeaning
PASS 83/83 (100%) All 83 suites of GNU Bash 5.3's upstream test corpora pass, nameref included.
Byte-identical 82 suites (0 diff) Output byte-for-byte identical to GNU — not "semantically equivalent": an empty byte-level diff.
nameref residual 1 line A visibility difference for declare -r RO_PID after coproc, proven to be GNU 5.3.0's own coproc reaping race (below).
Environmental deltas 9 suites zeroed Difference items in the glob/extglob/read/coproc suites are all environment-bound (NTFS, locale, signal tables…); audited to zero after A/B double-commit agreement per suite.
中文原文 · Chinese original

那一行 nameref 残差值得单独讲:在同一套 harness 文件系统上,GNU Bash 对自己就能在 59/60 与 1/60 之间翻转这一行的输出;而在 ext4 上 GNU 60/60 稳定,其输出与 rubash 逐字节一致(stdout 与 stderr 皆是)。结论: 残差属于 GNU 自身的 reap 时序竞态,不是引擎缺陷——归因论证以逐字节证据成文。 作为参照,2026-09-09 原始差分尚有 3427 处,此后削减 99% 以上:83/83 是长跑的终点,不是起点的宣言。

Corpora beyond the GNU suites

The same true-baseline method (script files, byte-level diff against GNU 5.3.0) is also applied to evaluation corpora outside the GNU suites and to real-world ecosystem assets; every judgment and count is archived in rubash issue #477:

CorpusResult
modernish capability suite (cross-shell quirk probes)166/166 identical rc vectors
mvdan/sh parser corpus559 snippets; parse acceptance and exit codes aligned
bash-completion matrix452/452; bash -n canary byte-identical
git-completion140/140
oh-my-bash22 library loads, 252/252 function environments identical, 5 theme PS1s byte-identical
ble.sh (29,601-line line-editing framework)bash -n rc=0 aligned; source mode terminates cleanly
nvm.sh v0.40.x loaderLoads byte-clean (including empty NVM_DIR auto-use on native Windows)
FFmpeg / OpenSSH / PHP / ltmain / cmake configure--help and error-path output byte-identical
git's own test framework t/test-lib.shRuns end-to-end under the engine
中文原文 · Chinese original

上述资产全部钉为回归夹具在 CI 每次推送时运行;真实生态收割语料(数千仓、近万 资产,夜间巡检)持续把发现的真实缺陷回流为修复。

Compatible ≠ same implementation

These numbers prove consistency of the script-observable surface: exit codes, stdout/stderr bytes, fd behavior, signal disposition. They do not say the internals match bash — quite the opposite: subshells and command substitution create zero processes (see the execution model), path translation is table-driven with no MSYS layer (see paths & MSYS). Differences are framed by contract documents and the ledger is public (environment-zeroed items are named per suite) — the other half of "compatibility is measured": prove where things agree, and write down where they do not.

FAQ

What does "83/83 GNU suites" mean?

All 83 upstream GNU Bash test suites pass on real hardware Windows, with 82 suites byte-identical to GNU Bash 5.3 output; the single residual line (nameref) is proven byte-by-byte to be GNU's own coproc reap race. Compatibility is measured, not claimed: a nightly patrol additionally sweeps 2,686 real-world ecosystem repos / 9,701 assets.

How is niubash different from Git Bash / WSL?

niubash is a native Windows program written in Rust: no bundled MSYS emulation layer, no WSL VM. Git Bash heuristically rewrites path-looking arguments before spawn (the reason the MSYS_NO_PATHCONV incantation exists); niu passes argv through byte-for-byte. The installed family is ≈16 MB versus Git Bash's ~440 MB.

How is the performance?

One-shot execution (niu -c true) is 19.8 ms after dedicated optimization; niu-git starts in ~14 ms (Git Bash: 45–103 ms); command-substitution and subshell workloads run 13–62x faster than GNU bash. Every number ships with its measurement method and reproducible artifacts — see Benchmarks (/benchmarks/).

Is it free? Which platforms are supported?

Everything is open source and free. niubash ships native Windows x64 / arm64 installers (winget: Unixwin.Niubash); the rubash engine additionally has CI-gated builds for five platforms: Linux (gnu/musl), macOS, Android and OpenHarmony.