Repository navigation
Description
Summary
The pipeline-filter fast-path arms in
src/executor/command_substitution_values.rs (command_substitution_pipeline_filter,
line 5: sort, sed, tr, head, grep, wc, tail, uniq) are
unreachable for ordinary $( … | … ) substitutions on origin/master (and
were already unreachable at the installed e785c3c8). They are either dead code
to delete or a latent bug cache to wire up deliberately — and, if revived, they
carry the same carrier-decoding defects as the live pipeline arms.
Classification: inventory / dead code (with a latent payload-decoding
defect class).
Reachability proof
command_substitution_pipeline_filterhas exactly one caller,
command_substitution_pipeline_output
(command_substitution_pipelines.rs:494).- That function requires a
|(line 468) and is called only from
timed_command_substitution_inner(line 585), reached only through
timed_command_substitution_output(command_substitution.rs:802). - Line 802 executes only when
command_substitution_body_is_trivialis true
(line 792). That predicate (command_substitution.rs:2217) admits only
[A-Za-z0-9 _-+=.,/:@%^]— it rejects|. So no body that can reach the
filter can contain a pipeline stage. git grepfinds no other caller and no test exercising the arms.
Black-box confirmation — the arms' wc default is -l (one column), but the
live behaviour is the three-column default the real executor's pipeline arm
produces:
$ niu -c "x=\$(printf 'hello\n' | wc); printf '%s\n' \"\$x\""
1 1 6
If the dormant arm ran it would print 1. Likewise $( … | sort/tail/uniq)
runs the external WinuxCmd binary (there is no pipeline arm for those), and
$( … | head/wc/grep/sed/tr) runs the live pipeline_exec.rs arm — which is
where all observable $() fast-path divergence actually lives.
Latent defects if revived
The dormant wc -c arm (command_substitution_values.rs:119) and tr arm
(line 45) have the same transport-carrier bugs as the live arms. The open
niubash#383 / rubash#695 already patches the wc -c arm even though it is
unreachable.
Ask
Decide per arm: delete it (the real executor already covers these pipelines), or
wire it back behind the triviality gate with a decode-at-entry fix. Either way,
add a reachability test so a future | shape regressing to "silently ignored
pipeline" (cf. #70/#76) is caught.
Found by the fast-path differential audit (#706).
Activity
docs(audit): link filed issues from the fast-path catalogue and harness
docs(audit): fast-path differential catalogue and harness (niubash#383)
docs(audit): fast-path differential catalogue and harness (niubash#38…
caomengxuan666 commentedon Oct 18, 2026
Per-arm decision (PR #818)
Decision: delete — no arm was revived; all eight were confirmed unreachable and removed.
sortsedtrheadgrepwc(incl. dormantwc -ccarrier defect)tailuniqVerification summary:
|(rejected bycommand_substitution_body_is_trivial's byte whitelist) — it also lives inside thetime-prefix shortcut, so even a gate admitting|would only consider$(time … | …)bodies.|, heredoc shapes) on an unmodified build; a positive control admitting|in the gate fired all probes and reproduced the dormant one-columnwcdefault. Control edits reverted.tests/issue710_comsub_pipeline_reachability.rs): pins the real-executor routing (wcdefault three-column,echo-led pipeline not swallowed, all 8 filters,time-prefixed pipeline, last-stage status), expectations byte-identical to WSL GNU Bash 5.3.0.Note: the dormant
wc -carm referenced as patched by open niubash#383 / rubash PR #695 is gone with the arm — #695's remaining scope is the livepipeline_exec.rsarms only.Merge pull request #818 from unixwin/fix/710
Merge pull request #2199 from unixwin/ledger/inputrc-backfill