Repository navigation
Closed
Labels
P2-medium中:次要缺陷或边缘路径,排期修复bugSomething isn't workingplatform:linuxDivergence specific to the Linux build
Description
Result summary
First-ever cargo test --workspace --locked on Android/Termux aarch64 (bionic, 6-core): 573 passed / 5 failed / 0 ignored (2.03 s). All five failures are environment leakage into test expectations, not behavior divergence — after isolating the environment, this run shows zero product failures on the platform. (The subsystems the current perf work touches — arithmetic, parameter expansion, assignment — are green on-device: cargo test --lib arithmetic parameter → 51/51.)
Failures 1-4: the bind_builtins quartet — the host inputrc leaks in
Evidence:
- They fail deterministically in a fresh single-test process (
--test-threads=1 --exact <name>, one process per test), with the same numbers as the parallel run — so this is not test pollution:generation_changes_on_mutation_only— afterbind -p >/dev/null(a pure listing) the registry generation is 6 wherebeforewas 0 (bind_builtins.rs:914);bind_x_listing_and_removal_round_trip—bind -m emacs-standard -x ...recordskeymap == None, expectedSome("emacs-standard")(:878);bind_x_registration_is_visible_and_process_global_across_clones— onebind -xyields snapshot len 3, expected 1 (:854);macro_and_function_bindings_register_and_unbind_by_function— twobindcommands yield len 4, expected 2 (:893).
- Root cause verified by isolation:
INPUTRC=/dev/null cargo test ...→ 4/4 pass. This host has a Termux system inputrc ($PREFIX/etc/inputrc, standard GNU emacs-mode escape bindings) and a user~/.inputrc. The bind engine's first-use inputrc load injects the host's bindings and mutates the generation — which is correct GNU behavior: on the same device,bash -c 'bind -p'lists 399 bindings including inputrc-defined ones ("\C-q": quoted-insert). GNU'sbind -p/bind -xalso run against the loaded inputrc; rubash matches it. - Why it was never seen: the dev loop runs on Windows, where no inputrc exists and the bare-environment assumption holds. The subsystem landed 2026-10-05 (b1a88dc, "feat(bind): real bind builtin") and was never executed on a Unix host until now — despite Android binaries shipping.
- Fix (test-side): pin the environment in these tests — set
INPUTRCto a controlled empty file (and/or isolate HOME) beforeExecutor::new()so the registry starts from a known state on every host. Tests that intend to exercise inputrc loading should get an explicit fixture inputrc instead of inheriting the host's. Per AGENTS.md's "fix the wrong invariant" rule: the invariant "the bind registry starts empty" is only true on bare hosts; make it true by construction.
Failure 5: compspec_file_action_lists_root assumes a listable /
- The test runs the file action on
"z /"and asserts non-empty directory candidates. On this device (locked-down Android policy),opendir("/")is denied:ls /→Permission denied,os.listdir('/')→EACCES. An empty candidate list is the correct answer here. - Fix (test-side): seed the file action against a directory the test controls (temp-dir fixture) instead of
/, or skip when/is unreadable.
Impact
- Not a product bug — the engine is behaviorally green on Android once the two environment leaks are pinned (expected baseline after fixes: 578/578).
- Real cost anyway: any human or agent running the sanctioned fast loop (
cargo test --workspace --locked) on a Unix host sees 5 reds that read exactly like platform divergence — a standing invitation to "fix" behavior that is GNU-correct (the AGENTS.md failure mode this repo already bans elsewhere). Now that Android binaries ship, the suite needs a Unix-clean baseline.
Repro
cargo test --workspace --locked # 573/578 — the 5 failures above
INPUTRC=/dev/null cargo test --lib --locked -- \
--test-threads=1 executor::bind_builtins # 4/4 green
ls / # Permission denied (this device class)
bash -c 'bind -p' | grep quoted-insert # GNU does the same inputrc surfacingRelated
- Found while producing the Android benchmark series ([perf][P2] Android aarch64 v1.4.0 vs GNU bash 5.3 benchmark matrix: interpreter-bound 2.3-7.3x slower, fork-bound 1.8-5.2x faster, startup +14ms (wrapper #351), RSS 2.2x — root causes filed as rubash#607-609 niubash#352) and validating an on-device baseline for the perf fixes tracked in [perf][P1] Arithmetic-for / loop execution 2.37x slower than GNU bash: per-eval state ticket, lvalue+read+write allocations, CommandNode rebuild, per-command probes #607, [perf][P1] Parameter expansion 2.6-7.3x slower than GNU: ${x^^} heap-allocates and glob-matches every character (GNU transforms directly when pat==NULL), plus per-call pattern re-derivation in // and #/% #608, [perf][P1] Scalar assignment path 2.72x slower: unconditional xtrace-only memo insert, dual BTreeMap+HashMap stores with replay log, nameref pre-allocation #609 — those three subsystems are green on-device (51/51).
Metadata
Metadata
Assignees
Labels
P2-medium中:次要缺陷或边缘路径,排期修复bugSomething isn't workingplatform:linuxDivergence specific to the Linux build
Activity
caomengxuan666 commentedon Oct 15, 2026
已认领并确认:5 个失败中 bind quartet 是宿主 INPUTRC 环境泄漏(
INPUTRC=/dev/null后 4/4 通过),根目录 listing 用例是假设平台根目录可列出。将分别修测试隔离/平台前置条件,不改 shell 语义。caomengxuan666 commentedon Oct 15, 2026
Verified: #613's isolation holds on-device — a full
cargo test --workspace --lockedwith the host inputrc present now passes the entire--libtarget (578/578, 1.83 s; fail-fast only reaching--test cli_testsproves lib was green without any INPUTRC override), and the bind quartet + compspec no longer fail in any environment. The reported 5 failures are fixed. Follow-up: reaching cli_tests unmasked 24 pre-existing Android-red tests (strict subset of the 33 at e785; this batch fixed 9, regressed 0) — triaged by root cause and filed as #615 so this issue's scope stays closed.