Repository navigation
docs(builtins): document the pipeline-stage and $(…) substitution fast-path arms, guarded - #722
Merged
Merged
Conversation
caomengxuan666
force-pushed
the
docs/706-fastpath-arms
branch
from
October 17, 2026 02:58
c161c76 to
9969c45
Compare
…ith doc-sync guards PR #706's differential audit (docs/audit/fast-path-differential.md, included here so the links resolve) inventoried three layers of in-process fast paths, but docs/builtins.md recorded only the hidden-builtin one (sleep/dirname/ basename + uname/arch). The other two were invisible to the doc-sync test: - 12 pipeline-stage arms (execute_pipeline_stage_inner, pipeline_exec.rs `match name`): true, :, false, echo, printf, trap, head, cat, sed, grep, wc, tr — the stage runs in-process on the pipe until the arm declines a shape (head -c, regex metacharacters in grep, '-'-words in tr, ...), then falls back to the external winuxcmd binary. - 8 command-substitution filter arms (command_substitution_pipeline_filter, command_substitution_values.rs): sort, sed, tr, head, grep, wc, tail, uniq (+ generic-external fallback). Audit §2.5 additionally shows these are unreachable for ordinary $( … | … ) bodies after rubash#117's triviality gate, so the table describes code shape, not observable behaviour. docs/builtins.md gains §3.1 with both lists inside two new machine blocks (pipeline-fastpath-list, substitution-fastpath-list) in the same fenced grammar the doc-sync test parses, plus one honest sentence per group and a link to the audit's divergence catalogue (§3) and tracking table (§8). The doc-sync test in builtin_names.rs gets two new cases pinning each list against a frozen expected set (the arms are inline match branches, so the expected set cannot be derived from a table); adding, removing or renaming an arm without updating the doc now fails `cargo test --lib builtin_names`. cargo test --lib builtin_names: 8 passed, 0 failed.
…f dangling TASK-BOARD path (#716)
caomengxuan666
force-pushed
the
docs/706-fastpath-arms
branch
from
October 17, 2026 05:18
9969c45 to
6d9efac
Compare
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.
Follow-up to the fast-path differential audit in #706.
What
docs/builtins.mdrecorded only the hidden fast-path builtins(
sleep/dirname/basename, plusuname/arch). The audit's inventoryadds two more layers of in-process fast path that the never documented — and
the doc-sync test could not see them because it parses only the
builtins-list/fastpath-listmachine blocks:execute_pipeline_stage_inner,pipeline_exec.rsmatch nametrue:falseechoprintftrapheadcatsedgrepwctr— 12command_substitution_pipeline_filter,command_substitution_values.rssortsedtrheadgrepwctailuniq(+ generic-external_fallback) — 8Doc section (§3.1)
Both lists are inside two new machine blocks in the same fenced grammar
the doc-sync test already parses (
<!-- pipeline-fastpath-list … -->,<!-- substitution-fastpath-list … -->), so they are now guarded rather thanprose. One honest sentence per group: the pipeline arms run in-process on
pipes until they hit a shape the arm declines, then fall back to the external
winuxcmd binary; the substitution arms produce the
$()value in-process andotherwise hand off to the generic-external branch. The section links to
docs/audit/fast-path-differential.md(added here so the link resolves before #706 merges) for the per-arm accept
shapes, decline conditions and the confirmed divergence catalogue (§3:
wc/trcarrier-byte counting,head's silently-defaulted flags,dirname/basenameedge cases) and the tracking table (§8: #707–#710,WinuxCmd#1196, already-tracked niubash#383 / #695).
The substitution paragraph also records audit §2.5's reachability finding:
after
rubash#117's triviality gate these 8 arms are unreachable forordinary
$( … | … )bodies — the table describes code shape, notobservable behaviour, which is exactly the kind of claim that must not read
as an active-behaviour promise.
Doc-sync guard
The test fixture in
src/executor/builtin_names.rsgains two cases in theexisting style (frozen expected sets — the arms are inline match branches,
so there is no table to derive the lists from):
doc_pipeline_fastpath_list_matches_pipeline_armsdoc_substitution_fastpath_list_matches_substitution_filter_armsAdding, removing or renaming an arm without updating the doc now fails
cargo test --lib builtin_names. Verified both directions: all 8 tests passon this branch, and deleting one line from a machine block fails the
matching case (
docs/builtins.md substitution-fastpath-list is out of sync with the filter arms …).Scope
Doc-only. Code touched: the one doc-sync test fixture (frozen expected sets
and doc comments) — no runtime behaviour. The main worktree's staged
deletions and niubash's PR branch are untouched.