Skip to content

test: wave-2 pins P4 (Refs #2683 #2782 #3020 #2765 #2789) - #3163

Merged
caomengxuan666 merged 6 commits into
masterfrom
fix/P4-wave1-pins
Nov 9, 2026
Merged

caomengxuan666 merged 6 commits into
masterfrom
fix/P4-wave1-pins

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Wave-2 pin-first lane P4 (parser interleave / extglob read-time family). Pins only — no product code. Each pin encodes GNU bash 5.3.20 oracle behavior byte-for-byte (script-file probes), runs fail-first on master f17644d7, and is paired with a root-cause + fix design in the lane REPORT (fix lanes dispatch when the gating faces free up).

Refs #2683
Refs #2782
Refs #3020
Refs #2765
Refs #2789

Per issue:

本 PR 删除了什么

无(纯测试新增)。净行数:+约 770 行(5 个新测试文件)。

fail-first(基底 f17644d,队长可复核:~/workspace/fix-P4/verify/ 全量日志)

rubash lane P4 added 5 commits November 8, 2026 23:54
…and-not-found

GNU parse.y:3630-3643: a # introduces a comment only at a word start
in the source text; quoted/expansion-produced # words are command
names (127). rubash drops them post-expansion in
src/executor/command_prepare.rs (starts_with(#) arm).
GNU parse.y:5158-5163 (PST_EXTPAT on ==/!=) + parse.y:5203-5206 +
execute_cmd.c:4108-4111: conditional pattern lexing/matching forces
extended_glob regardless of the shopt option. The option itself is
visible only from the next read unit (builtins/shopt.def:638-640
shopt_set_extglob runs after the current line was lexed). Pins cover
the issue shape (spaced form; the glued form is a GNU syntax error
too), both routes, flip chains, and same-line blindness for case/glob.
GNU parse.y:6772-6808 error_token_from_text: [[ a ==]]2>f names
==]]2 / ==]]2>; a complete conditional names the whole glued item
b]]2>f. rubash cond_follower_text contributes only the redirect
operators first byte. Oracle bytes verified (the issue text naming
]]2>f does not match the 5.3.20 oracle).
GNU parse.y:295/3116/3120-3130: one flat redir_stack per read unit,
bodies drain in push (line) order - no frame tiers. rubash claims
pending bodies frame by frame in src/parser/redirections.rs. Nine
shapes with distinct body markers (if/else/nested/function/pipeline).
GNU parse.y:4451 parse_comsub hands the body to the grammar during
the read of the enclosing unit: skipped bodies still abort the unit
(-c 127 via the #2787 remap, file 2, sourced-from--c 127), nested
bodies included. rubash screens parse-error markers only at
execution. Status/stdout pinned byte-for-byte; wording is #2783s
face and intentionally unpinned.
@caomengxuan666
caomengxuan666 merged commit 0617106 into master Nov 9, 2026
11 checks passed
caomengxuan666 added a commit that referenced this pull request Nov 10, 2026
executor: stop swallowing expanded '#' command words as comments

`execute_assignment_or_comment_command` in `src/executor/command_prepare.rs` carried an arm that discarded any simple command whose first expanded word starts with `#`, reporting exit code 0. GNU bash treats comments as purely lexical (parse.y:3630-3643): the reader discards a `#` only when it begins a word in the source text where a word can start. Quoted, expansion-produced, command-substitution-produced and variable-carried `#...` words are command names and report command-not-found (127). Source-text comments never reach the executor as words because the scanner consumes them, so the arm had no legitimate input and is removed (4 lines).

Captain verification (Simular box, per-stem result lines):

- Pin stem issue3020_hash_command_word: base e1afd25 3 passed / 6 failed (exactly the six quoted/expansion/comsub/variable cells) -> head 9 passed / 0 failed.
- Pin stem issue2683_same_line_shopt_extglob: 10 passed / 0 failed on head and on base (see the attribution note below).
- Neighbour stems all green: issue3205 11/11, issue1114 13/13, issue1573 9/9, issue120 4/4, audit_b4 1/1.
- Lib: head 1207 passed / 0 failed / 4 ignored; base identical; failure name sets empty on both sides.
- `RUSTFLAGS="-D warnings"` check at lib+bins scope: rc=0. The all-targets scope is red on base and head alike from pre-existing warnings in unrelated test files (untouched by this change); left for their owners.
- `cargo fmt --check` rc=0; marker-literal lint OK. CI on the head: 10 pass + 1 skipping, zero red.

## Note on the second issue

The same-line shopt/extglob pins were re-measured: all 10 pass on the current base. Captain attribution check: the pin stem scores 8 passed / 2 failed at f7aee5c (the two failed cells are exactly the banked ones) and 10 passed / 0 failed at f7fed21, the merge commit of PR #3223, whose deferred extglob parking, grouped-feeder entry snapshot and parse-loop marker arming cover the same mechanism. This PR therefore carries no product change for that side; its closure is the captain's manual call on this evidence.

## 本 PR 删除了什么

Removed the 4-line executor arm described above (one `if` block in `src/executor/command_prepare.rs`). Nothing else is deleted; no test files change (the pins are already on master via PR #3163).

Fixes #3020

Refs #2683
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant