Repository navigation
fix(executor): #799 command-name case contract (stem byte-exact) + #800 SLOW-face quantification - #805
Merged
Conversation
) A lowercase gitconfig alias line (`r = reflog …`) sourced from a dotfile resolved to GNU R's on-disk `R.exe` on Windows: the merged listing scan (rubash#159) stored lowercased names and probed with a lowercased key, so the command stem folded case exactly like the NTFS stat layer underneath. In the harvest session that launched R's interactive interpreter, which ate the harness's next probe line and hung the verdict (#799). Contract (oracle-probed 2026-10-13): - Semantic gold, WSL GNU bash 5.3.0: the findcmd.c walk is a literal join+stat — `command -v r` finds only the literally-spelled `r`; with ONLY `R.exe` on PATH both `r` and `R` are rc 127 (Linux has no extension candidates at all). - Form oracle, msys bash (Git for Windows 5.2.37 and 5.3.0): a bare name resolves extension candidates (R -> R.exe/R.bat; extensionless file verbatim), but the name match itself case-folds through the Windows stat (`command -v r` reports on-disk `R.exe` as `r.exe`). That fold is an NTFS artifact, not GNU semantics, and is exactly the bug class #799 bans. Rubash therefore keeps: (1) the command STEM byte-exact — `r` never lifts `R.exe` (rc 127), matching the WSL gold standard; (2) one Windows-native deviation with no GNU analogue — the appended PATHEXT-style EXTENSION compares ASCII-case-insensitively (`R` still runs an on-disk `R.EXE`), with the resolved spelling always the on-disk one (`command -v` reports `TOOLB.exe`, not the query case). The per-directory listing now carries an exact-case set plus an ASCII-lowercase fold map; the fold arm re-checks the stem byte-exactly before it matches, and extensionless candidates never enter it. Differential: pin f3f2047 resolves `command -v r` to `r.exe`; this patch returns 127 and the sourced gitconfig sprays `command not found` and returns, with the trailing probe reaching the shell. New integration suite tests/issue799_command_name_case_regressions.rs pins the asset shape end-to-end; the #159 unit test asserting case-insensitive listing membership is updated to the new contract.
Two quantified probes for the #800 SLOW triage checklist, in the same PERF-metadata shape the run-perf-suite harness consumes: - 28-read-eof-x200.sh: 200 reads on an exhausted stdin. The CI verdict (addition.sh, ~4.8s per read at EOF) does not reproduce on any pipe, file, or /dev/null path — the probe turns any per-read stall into seconds so a regression re-lands in the suite numbers. - 29-spawn-external-x32.sh: 32 external spawns, the kiddae hermine .bashrc `$(tput …)` multiplier, on the OS-neutral `uname -s` child of probe 09. Measured medians on the dev host (release engines, same host, 5-7 runs): read-on-EOF 0.35 ms/read on both pin f3f2047 and this tree (GNU/WSL 5.3: 0.07 ms); external spawn 1.2 ms/spawn on both engines (msys bash 5.3 form oracle: 3.6 ms; Git for Windows 5.2.37: 39 ms; detached+piped CI shape: rubash 20 ms total for x32 vs 5031 ms for msys bash). The ~300 ms/spawn and ~4.8 s/read CI numbers are harness/runner-bound, not engine-bound: rubash is already at or below every oracle it is measured against, and no-default-wait holds (`sleep 2 | read a` returns in ~2.1 s, equal to Git Bash).
3 tasks
caomengxuan666
commented
Oct 18, 2026
caomengxuan666
left a comment
Member
Author
There was a problem hiding this comment.
独立代码评审(#805):APPROVE-WITH-NITS
评审基线:merge-base 9055c96,PR head a74b14a(3 commits,逐 commit 审计)。验证在独立 worktree 完成,已全部还原;未合并。
对 #799 契约的独立结论:赞同
「词干字节精确 + 追加扩展 ASCII 大小写不敏感 + 回报磁盘真实拼写 + 无扩展名候选不进 fold 分支」是正确综合:(a) 名字匹配采纳 GNU 语义金(case 敏感),(b) 保留 Windows 原生、GNU 无对应物的 PATHEXT 扩展候选形态,(c) 故障面从静默错(r 静默拉起 GNU R REPL)变为响亮失败(127)。本机复跑双向 oracle 均成立:
- WSL GNU bash 5.3.0:仅 R.exe 在 PATH 时
command -v r/command -v R均不命中、exec → command not found;command -v R.exe命中(字面 join+stat)。 - msys bash 5.3.0(Git for Windows):
command -v r把磁盘 R.exe 报成r.exe;无扩展名 r 被R查询整名折叠命中——确认折叠来自 stat 层而非 findcmd 语义(vendored bash 子模块 pin b4608166 = 5.3-16:findcmd.c:553 sh_makepath 字面 join + :555 file_status stat,:580-586 首个可执行即返,全程无大小写/扩展逻辑;唯一 FNM_CASEFOLD 在 :103 的 execignore,与解析无关)。5.2.37 一腿未独立复跑(本机未装),机制属运行时层,可接受。
实现核验(全部通过)
src/executor/path.rs:535-556:exact 集用候选原拼写应答 →r永不命中R.exe;fold 分支由candidate.file.extension().is_some()门控(path.rs:546)→ 无扩展名候选不折叠;listing_stem_exact_extension_ci(path.rs:578-594)先字节精确验词干再 ASCII-ci 验扩展,解析拼写取磁盘值。- PATHEXT 语义保留:候选枚举未动(#159 顺序),
R→ R.exe/R.bat 按扩展序可命中。E2E 对 R.exe / R.EXE / r.exe 三种磁盘拼写实测通过:command -v r空 rc1、command -v R报磁盘拼写、R.EXE 经 fold 命中。 - 其余查找面无漏网:结果缓存按原始查询名键控(path.rs:151);unix 臂未动(join+is_file+file_to_lose_on,对应 findcmd.c:592/695);DirListing 仅 path.rs 内部使用。
tests/issue799_command_name_case_regressions.rs5 用例质量高:词干拒绝 / EXE 折叠命中(fold 臂唯一肯定性覆盖)/ 无扩展名拒绝 / 镜像方向 / 真实 PE 的 gitconfig 资产 E2E(source 返回、下一条探针可达、stderr 喷 command not found)。
Findings(均不阻塞)
- [nit][anchor] benchmarks/28-read-eof-x200.sh:5 引 "read.def:762-768" 作 "EOF 立即返回 rc=1" 的锚点——该范围是 read 错误/信号路径(:768
eof = 1; errno = x; break);干净 EOF→rc1 的权威锚点是 read.def:949(retval = eof ? EXECUTION_FAILURE : ...)。语义对,file:line 错。 - [nit][comment] src/executor/path.rs:5378-5381 注释称
TOOLB命中"通过追加扩展的 ASCII 折叠",实际磁盘 TOOLB.exe 与候选拼写逐字节相等,走的是 exact 集;fold 臂的肯定性覆盖其实在 issue799 测试 2(R3.EXE←R3)。注释误导机制归属。 - [nit][归因措辞] a74b14a 提交信息与 benchmarks/29:4-5 把 "~300ms/spawn 与 ~4.8s/read 是 harness/runner-bound, not engine-bound" 写成定论。本地反证充分(本机 dev 构建 689ms/200read、45ms/32spawn;msys 0.6-3.6ms/spawn;pipe/file/devnull 无一复现 CI 值;
sleep 2 | read a≈ 2.1s 排除默认等待),但无 runner 上的对照实验,且 #800 自提的 console 读路径假设未被探针 28 覆盖(仅 pipe/file/devnull)。作为"钉面"探针 PR 可接受,措辞应为强假设;#800 保持 open 正确。 - [info][CI] "GNU regression goldens and canaries" FAILURE 为继承红:merge-base(master push 39123676479)同样红在
upstream_suite_slice_snapshots(nquote golden),已有 P1 票在账(red since 98794cb or earlier);本地两树同败。 - [info][回归纪律]
cargo test --lib690×5 全绿(本评审抽跑);全量--test-threads=1 --no-fail-fast失败集:PR 树 12 个失败 binary ⊆ merge-base 15 个,逐 binary 计数一致(arrdefault 1、cli_tests 23、issue280 1、issue379 1、issue526 2、issue647 1、issue680 1、issue705 1、marker_leak_golden 1、parameter_transform 1、path_contract_boundary_verbatim 1、regression 1),base 另多 3 个抖动类失败(executor_tests×9、issue144、issue440)。零 PR 引入失败。 - [info][fmt] e8c53ec 干净:rustfmt 1.10.0 对 merge-base
--check的漂移集 = {mapfile.rs:36, part_041.rs:89, regression.rs ×11} 恰为该 commit 的重排集;PR 树 fmt-clean。diff 无夹带:fix commit 仅 path.rs + 新测试文件,bench commit 仅两探针。 - [info][行为取舍备案] 契约下大写查询不再命中全小写磁盘工具(
GIT↛git.exe),与 cmd/PowerShell/msys 的 stat 折叠相悖。响亮 127 优于 #799 的静默错误,且已由lowercase_exe_resists_uppercase_query钉住——建议作为已意识的产品决策记录在案(msys 用户迁移时可能遇到)。
GPL 红线:通过
third_party 零改动;findcmd.c / read.def 均为「语义契约 + file:line」锚定,新增代码无 C 构造镜像(对 diff 新增行做了构造扫描)。仅 finding 1 的锚点行号不精确。
不合并。
This was referenced Oct 18, 2026
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #799. Quantifies and closes the two product faces of #800.
#799 — command-name resolution is case-sensitive (stem byte-exact)
The #799 asset (kutsan/dotfiles aliases.gitconfig, line
r = reflog …) sourced in a harvest session resolved lowercaserto GNU R's on-diskR.exe; R's REPL then ate the harness's next probe and hung the verdict. Root cause: the #159 merged listing scan stored lowercased directory names and probed with a lowercased key, so the command stem folded case like the NTFS stat layer beneath it.Contract (oracle-probed 2026-10-13):
findcmd.cis a literal join+stat walk. Dir withR.exe/R/r/r.sh/R.cmd:command -v r→ only the literalr; dir with ONLYR.exe:randRboth rc 127 (Linux has no extension candidates).R→R.exe/R.bat, extensionless verbatim) but the name itself case-folds through the Windows stat (command -v rreports on-diskR.exeasr.exe). That fold is the NTFS artifact [P2][harvest] 命令名解析大小写不敏感:source 纯 gitconfig alias 文件时小写 r 启动了 R.exe,REPL 被 R 吞掉 (asset: kutsan/dotfiles#aliases.gitconfig) #799 bans, not GNU semantics.So the landed contract is: stem byte-exact (
rnever liftsR.exe, rc 127 — matches the WSL gold), appended extension ASCII-case-insensitive (Rstill runs on-diskR.EXE— the one Windows-native deviation, which has no GNU analogue at all), resolved spelling always the on-disk one.Differential (release engines, fixture with only
R.exeon PATH):f3f20475c8command -v r/…/r.exe(folded, the bug)rcommand not found, rc 127command -v RR.exeR.exe(unchanged)command not found, returns, probe runsTests: new
tests/issue799_command_name_case_regressions.rs(5 end-to-end cases incl. the exact asset shape); the #159 unit test that asserted case-insensitive listing membership is updated to the new contract.#800 — the two quantifiable faces
New suite probes
benchmarks/28-read-eof-x200.shandbenchmarks/29-spawn-external-x32.shpin both faces in the perf harness. Measured on the dev host (release engines, median of 5-7):A. external spawn (
benchmarks/29, x32uname -s):f3f20475c8The CI's ~300 ms/spawn is runner-bound (GitHub windows runner CreateProcess + image scan), not engine-bound: rubash is already the cheapest shell per spawn of everything measured here, in both shapes, and pin == this PR on every spawn face (e2288d5/#751 touched only the shim hop, which does not appear in per-asset source_wall).
B. read-on-EOF (
benchmarks/28, x200 reads on exhausted stdin):f3f20475c8No 4.8 s stall exists on any pipe/file//dev/null path;
readinvents no default wait without-t(sleep 2 | read areturns in 2.09 s vs Git Bash 2.08 s). The CI's ~4.8 s/read matches the interactive harness's probe-feed cadence — a blocked console read until the next harness write — which the run's missing GNU oracle leg would have classified as harness-bound. Two residual interactive-console defects found during triage are follow-up material (not touched here):read -n1on a live console never completes, and a plain console read needs one extra Enter to see already-queued input.Verification
cargo test --lib -- --test-threads=1: 690 passed x5 consecutive runs.cargo test --no-fail-fast -- --test-threads=1: no new failures: the failing-name set is byte-identical to the merge base (41 environment failures at 98794cb, same 41 on this branch, name-level set diff empty).cargo fmtclean on touched files.