Repository navigation
Description
docs-audit 归档摘录(2026-10-10)
docs/PERF-BASELINE.md、docs/CORPUS-COVERAGE.md、docs/COMPATIBILITY-STATUS.md、docs/TASK-BOARD.md、docs/TASKBOARD.md、docs/QUEUE-PROMPTS.md、docs/LINUX-RUN-STATUS.md 属于点对点状态快照,其全部历史随 git 保留(删除提交之前的任意提交均可查阅原文)。本 issue 仅摘录仍有效的基准数字/方法结论,供后续性能/语料车道引用;完整原文见 git 历史(如 git show e9858363:docs/PERF-BASELINE.md)。
1. 性能基线(摘自 PERF-BASELINE.md,基线 commit 9bf2df9e,2026-09-27 首轮 24 探针)
环境:rubash debug target/debug/rubash.exe vs WSL GNU Bash 5.3.0(/usr/local/bin/bash,业主编译版);外层 harness scripts/run-perf-suite.sh(wall clock date +%s%N,median,timeout -k 5 包裹;GNU 侧 WSL 内 --inner 重入,PATH 净化 PATH=/usr/local/bin:/usr/bin:/bin;不用 hyperfine)。TSV 落 target/perf-results/。
首轮中位比值(rubash/GNU,>=10x 加粗):
| probe | rubash ms | GNU ms | ratio |
|---|---|---|---|
| 01-startup-empty | 92 | 7 | 13.1x |
| 04-loop-true-x2000 | 1048 | 20 | 52.4x |
| 05-arith-x5000 | 648 | 13 | 49.8x |
| 06-strconcat-x5000 | 1915 | 25 | 76.6x |
| 07-fncall-noop-x5000 | 3480 | 37 | 94.1x |
| 08-cmdsub-true-x1000 | 477 | 382 | 1.2x |
| 09-external-uname-x300 | 316 | 215 | 1.5x |
| 11-pipeline-yes-head | 221 | 8 | 27.6x |
| 12-pipe-echo-read-x2000 | 5873 | 1030 | 5.7x |
| 13-readloop-gen-x2000 | 2549 | 24 | 106.2x |
| 15-expansion-x5000 | 4492 | 59 | 76.1x |
| 16-parse-flat8000 | 2219 | 18 | 123.3x |
| 17-parse-flat8000-n | 510 | 13 | 39.2x |
| 21-configure-head1374-n | 3211 | 9 | 356.8x |
| 23-nvm-parse-n | 18748 | 22 | 852.2x |
| 24-nvm-load | 14402 | 38 | 379.0x |
关键结论(当时有效,后续轮已逐项攻):近平价在子壳/进程创建(08=1.2x、09=1.5x),成本集中在每命令解释器工作;probe 03(-i -c exit)环境绑定退役;probe 25 非挂起(#243 修正)。
后续轮摘录(原文各轮小节):
- perf7/perf10 轮后 nvm
-n315.4 → 230.8 ms(-26.6%)、nvm load 411.8 → 323.0 ms(-21.6%,最终洁-binary 复验 -24.7%,canary 12/12)。 - store 三克隆评估:
store_self= 3.1-3.3 ms / nvm-n(~470 ns/word),上限 ~1.3% 墙钟——该轮 REJECTED(低于诚实门槛),记录归 token 架构大轮。 - body-reparse 缓存:实测函数体/循环体均单次解析,文本键缓存零命中,REJECTED;结构性修法是 parse20 inline-section 扩到 case/for/loop/brace/subshell/function 六处。
2. 语料覆盖(摘自 CORPUS-COVERAGE.md,2026-09-27 建立;防重跑清单)
已覆盖语料(勿重跑;issue/工件详见原文表格):
- GNU 83 套件全量(true-baseline,09-25 口径 82 零差/1 残余;工件
target/issue-suites/results/true-baseline*) - oils spec / mksh check.t / ksh93 / busybox ash([Bug 批量] 命令替换状态污染 / heredoc / case 模式 / 参数替换 / 路径转换 / 重定向 / 调试钩子 - 20+ 个与 GNU Bash 的兼容性差异(含最小复现) #20-[Bug 批量·第五轮] 全量清单聚焦: umask/trap/kill/set/echo/cd 内置族/sh-options/word-split/var-op/nameref/mksh 进制字面量 - oil 684+mksh 436 项 #24, [Compat][BusyBox][ash-misc] Bash-compatible differences #37-[Compat][BusyBox][ash-z_slow] Bash-compatible differences #57)
- linux-smoke(bash_completion:189 quoting chain (escaped-quote runs + $'...' fragments) is a fatal EOF error — blocks the whole bash-completion framework #138-[bug] unix: lexer 行读取的 CRLF 容忍未门控——GNU 在 Linux 把 CR 当字面数据,rubash 静默吞掉(E17 第 4 处,已被 linux smoke 实证) #140)、bash-completion 2.18.0(bash_completion:189 quoting chain (escaped-quote runs + $'...' fragments) is a fatal EOF error — blocks the whole bash-completion framework #138 [bug] P0 引号家族:\' 转义后无法重入单引号态,词内后续反引号被当 comsub(成对误执行/不成对 EOF 死),bash_completion:188 加载即死 #144 [bug] 补全函数调用面:compgen -F 不执行函数;补全函数内 COMP_CWORD 为空(git 补全候选 75 vs 3) #146 [bug] 自引用数组守卫 ${a[@]+"${a[@]}"} 字面泄漏(杀掉 bash-completion 17KB compat 层) #147 [bug] 引号家族词位置残余 5 例(case 模式 / herestring / 管道词 \x17 泄漏)——修复面=WORD_DESC quote-flags 移植;另 tar.bash ERE {n,m}(452 矩阵唯一 FAIL) #153)、git-completion.bash([bug] P0 生态入口锁死:zsh 风格 ${(M)...} 在解析期被拒(EOF 错误吞词),git-completion.bash:403 使官方 git 补全整体无法 source #142)
- oh-my-bash 全仓+主题矩阵([bug] extglob case 模式未按解析时 shopt extglob 门控(
case x in @(a|b))在 -n 下被静默接受,GNU 拒绝) #143 "[bug] oh-my-bash 主题全灭根因:eval arr=(glob) 在 nullglob 下不做路径展开(模式串字面入数组),级联杀死 lib 层,5/5 主题 PS1 为空" #148 "[bug] \u0016-i + stdin 模式下 $- 缺 i/s(GNU=himBHs)——交互插件守卫 [[ $- == *i* ]] 判非,主题/插件冒烟需 GATE-SKIP 才能测" #149 [bug] P0 带引号片段的赋值字不做 pathname expansion(arr=("$T"/lib/*.bash) 字面量)——oh-my-bash 只加载 2/22 lib 的又一根因,#148 同现场变体 #160)、bash-it 全仓([bug] P0 source/exec 重定向到常规文件时函数型 comsub 输出泄漏捕获为空(bash-it 加载破坏);comsub 内 &+wait 不捕获(nvm ls 缺行) #161) - 版本管理器全家:nvm(Quadratic parse of large top-level { ... } groups (nvm.sh -n takes 52s vs instant) #130 [perf] 增量 tokenize 工单:lexer 每行全缓冲重扫确证 O(N²)(#130 热点已定位,nvm.sh 形态 1469×) #155 [bug] nvm 链路 File name too long ×5(根因未定)+ 诊断族四项(compopt 静默 / command-not-found 前缀 / 顶层 line N 丢失 / source 链归属错位) #162 [bug] comsub 内后台任务 &+wait 输出不捕获(后台子进程 stdio 走 Inherit 绕过捕获管道)——nvm ls 默认别名行缺失 #169)、rustup(Pipeline stage-2 native exe gets argv with embedded double quotes stripped when stage-1 is a quoted-variable command with no redirections (function/if context) — rustup-init.sh check_help_for false-warns #205)、rbenv/jenv([bug] P0 脚本内执行脚本: 子脚本 $0 错误(fork 形态继承父 $0 / exec 形态 .\反斜杠路径),${0##*/} 自定位全家崩 #166 [bug] P0 被执行脚本的 $0 = 顶层脚本名(非被调路径)—— dirname "$0" 自定位全灭:rbenv/ruby-build/gvm 安装器族 #171 [bug] rbenv-commands 的 PATH "${PATH%%:*}" 遍历在 D:/ 盘符冒号处断裂(rbenv init stage2 case 模式丢失) #184 command substitution leaks stdout of shebang scripts that exec another program (rbenv init eval broken) #191 [bug] Command substitution captures nothing when the substituted program is the rbenv dispatcher script (output leaks to real stdout): rbenv init eval chain defines no function #193)、ruby-build([bug] P0 被执行脚本的 $0 = 顶层脚本名(非被调路径)—— dirname "$0" 自定位全灭:rbenv/ruby-build/gvm 安装器族 #171 [bug] ruby-build --help 无限挂死(120s 超时;$0 修复后仍挂) #185)、pyenv([enhancement] 身份人设:uname/arch 转内置 + RUBASH_IDENTITY 环境变量切换(默认 MSYS 兼容或原生待拍板)——修生态脚本的非 MSYS 环境退出断裂 #154/[bug] P0 被执行脚本的 $0 = 顶层脚本名(非被调路径)—— dirname "$0" 自定位全灭:rbenv/ruby-build/gvm 安装器族 #171 级联已覆盖)、conda、sdkman、gvm、asdf、volta(ecosys5)
- starship(declare -f re-serializes from AST instead of replaying definition text: leaks source-context redirect into } (rewrites 2> as 2>>), rewrites nested quotes in $() as \", drops -n in compound [[ ]] #202)、fzf(0 diff)、atuin/direnv-stdlib/zoxide(declare -f re-serializes from AST instead of replaying definition text: leaks source-context redirect into } (rewrites 2> as 2>>), rewrites nested quotes in $() as \", drops -n in compound [[ ]] #202/Sourcing a file containing a stray unquoted ) executes it silently with the argument swallowed (GNU: syntax error, source returns 2, caller continues) #203 族)
- 安装器:get-docker/deno/bun/starship install(env-bound,无 rubash 因素)
- configure 巨物:bash53/git/ltmain/cmake/php-8.3([bug] PATH 以 Windows 原生形式(分号+反斜杠)呈现给脚本:POSIX 冒号切分全灭——ltmain.sh 第一步 func_path_progs 找不到 sed 直接 rc=1 #175 [bug] 反引号替换体中单引号内的 ` 被当替换收尾:替换体拆词、凭空执行命令、结果错(cmake bootstrap line 67 实伤) #177 + perf [perf] 增量 tokenize 工单:lexer 每行全缓冲重扫确证 O(N²)(#130 热点已定位,nvm.sh 形态 1469×) #155 Quadratic parse of large top-level { ... } groups (nvm.sh -n takes 52s vs instant) #130 [perf] 嵌套深度维度残余:单遍内逐 { 的 skip_brace 扫到 EOF 在折叠解析递归各层求和(近三次方)——需 skip_brace 可续传重构 #176 [perf] 重复多行单元放大器:as_fn_mkdir_p 41 行单元 ×40 份 = 31.7s vs GNU 9ms——#155 白名单未覆盖的触发形态(前导+普通行组合) #178)
- Homebrew install.sh([bug] P0 脚本内执行脚本: 子脚本 $0 错误(fork 形态继承父 $0 / exec 形态 .\反斜杠路径),${0##*/} 自定位全家崩 #166 族)、MSYS2/GfW profile 链([bug] MSYS2 profile链: source 绝对路径文件时 export LANG=$(fn) 不进子进程 env(unset LANG 前置 + 绝对 D:/ 路径触发;同字节相对路径通过) #163)、WSL profile.d(0 diff)
- makepkg([bug] P0 herestring 任何参数展开为空内容: read x <<< "${v#--}" 全灭(makepkg parseopts 长选项全崩为 option '--' is ambiguous) #165 [bug] P0 脚本内执行脚本: 子脚本 $0 错误(fork 形态继承父 $0 / exec 形态 .\反斜杠路径),${0##*/} 自定位全家崩 #166)、shellspec 自测([bug] bad substitution 诊断绕过 2>/dev/null 重定向直接泄漏到原始 stderr(eval/comsub/子shell 三形态;shellspec 1134 例自测无法启动) #167 [bug] P0 脚本内执行脚本: 子脚本 $0 错误(fork 形态继承父 $0 / exec 形态 .\反斜杠路径),${0##*/} 自定位全家崩 #166)、bats-core 自测([bug] P0 exec env VAR=x <script> 静默不执行(rc=0 无输出)——bats-core 入口最后一行即此形态,自测套件整体无法启动 #172 [bug] P0 脚本内执行脚本: 子脚本 $0 错误(fork 形态继承父 $0 / exec 形态 .\反斜杠路径),${0##*/} 自定位全家崩 #166)、portage ebuild([bug] 跨行 if (( ... || ... )) 报算术语法错误并取错分支(换行折叠为 ; 喂给求值器)——portage ebuild.sh:44 版本门禁即死,EAPI 机制无法进入 #174)、bashdb
- 主题渲染 sweep:load 60/83 PASS(4 FAIL-engine [bug] Single-quoted ${var/pat/repl} inside $() command substitution is expanded (GNU: literal) - OMB iterate theme loses all prompt segments #416 [bug] Single-quoted external arg inside $(): backslash dropped AND ${VAR} brace-stripped before exec - sed gets 'n' for '\n' and '$VAR' for '${VAR}' (hawaii50) #417 [bug] OMB powerbash10k + brainy: right-side prompt segment stored in PS1 as literal " $'...' " plus literal \E escapes (wt52/pb10k render-family, LOAD-time variant) #418,14 FAIL-env,3 VOLATILE);render 18 等价/64 分歧([bug] PROMPT_DIRTRIM ignored in \w prompt expansion (GNU trims to '.../last/N') - every OMB \w theme renders the full path #420 wrap/width 33、[Bug 批量·第三轮] oil spec 大规模差分: alias 展开语义/语法错误接受度/数组赋值族/算术错误码/jobs-dirs 内置 - 219+ 项差异(已跑 1/2 套件) #22 redraw glyph 22 → [bug] Prompt redraw after command output emits \[ \] ignore-markers as printable glyphs (☺←•) with escape text - 22/82 themes show garbage on prompt#3 #422)
工具注意事项(仍有效):pyte 吃 SOH 后文本;pywinpty 需关 echo;WSL bash -i 非 tty 父需 setsid;GNU 侧重跑必须新 HOME(OMB 主题缓存随机态);ConPTY 下 rubash 走占位 REPL,render 探针须管道 stdin。
3. 兼容性台账末次口径(摘自 COMPATIBILITY-STATUS.md,最后核对 2026-10-02,master dc3e799b)
63 零差 / 20 有 DIFF / 285 原始行(83 套件 true-baseline)。此后 #453-#476 等修复已落地,该口径已过时;现状以 issue tracker 与 scripts/true-baseline.sh 实测为准。
4. Linux 原生(摘自 LINUX-RUN-STATUS.md,2026-09-27,lane wt4/linuxrun)
Linux target 真构建真运行:ELF 作为脚本 shell 冒烟矩阵逐字节对齐 GNU;当时剩余 trap/redir 套件级挂起、locale 排序 glob、小诊断形态差(后续提交已部分修复,README 现行口径为准)。
Activity
docs: archive point-in-time snapshot ledgers (archived in issue #477) (…
docs: repoint the eight dangling COMPATIBILITY-STATUS.md references t…
caomengxuan666 commentedon Oct 12, 2026
COMPAT 台账新快照(2026-10-12,master
764b9dde,PR #506):41de8319与764b9dde两个二进制下逐套件一致,非 perf(executor): hot-path residue — test marks gate, word materialization once, assignment scan admission (rubash#242) #501/docs: repoint deleted COMPATIBILITY-STATUS.md references to the current ledger #502 漂移。WINUXSH_ROOT(winuxcmd 产品集成)会经 WSL interop 钉扎 rubash POSIX 根,harness 启动须env -u WINUXSH_ROOT -u RUBASH_ROOT -u __RUBASH_SHELL_ROOT,否则 ~22 套件被路径映射污染(A/B 实证:dstack 50→0 等)。总原始差行 268(其中 nameref 1 为 GNU 竞态、其余皆审计家族),对照 10-02 口径 63 零差/20 DIFF/285 行:家族构成一致、总量收敛。证据文档:docs/nameref-suite-residual-gnu-race-20261012.md。
docs: extract PERF/CORPUS/COMPAT/LINUX baseline numbers from archived…
caomengxuan666 commentedon Oct 13, 2026
done in #581(docs/archived-metrics-snapshot-2026-10-10.md,squash 754ba71,CI 全绿 6 pass / 2 skip)。
全部数字自归档原文抄录(git show 4744083^:docs/.md,PR #478),未编造;文首声明历史快照属性、引用须带截止日期。本文档同时是 docs/bash-compat-issues.md 等三处 "issue #477 snapshot archive" 指针的落点。
docs: #892 address #903 CR - drop COMPATIBILITY-STATUS.md pointer, ad…
docs(readme): date the Linux corpus pass from the archive — 2026-09-2…
docs(readme): overhaul — Performance section with pinned numbers, hon…
docs(readme): captured artifacts for quickstart and identity, restruc…