Skip to content

WIP: #2036 S4 pipeline + comsub registry projection + per-face stand_down sink - #2083

Merged
caomengxuan666 merged 4 commits into
masterfrom
fix/2036-s4-pipeline-comsub
Oct 29, 2026
Merged

caomengxuan666 merged 4 commits into
masterfrom
fix/2036-s4-pipeline-comsub

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Refs #2036 (S4 slice of the registry consolidation line; S1 #2050, S2 #2075, S3 #2080 merged).

Scope — all behavior-preserving, zero stand_down value changes:

  • ① Pipeline projection: the pipeline stage arms (grep/head/tr/wc PipelineOnly arms + cat/sed/tput inline stage arms, including the [仿真层] pipeline 内联 cat/sed 不看宿主开关 external_file_builtins_enabled(dsh 补丁 0003 机制层) #2066 host-flag gates), the stage pre-check, the spawn stand-in set, and the timed producer/consumer/followup models take their claim sets from the registry slot tables (PIPELINE_STAGE / PIPELINE_PRECHECK / PIPELINE_STANDIN / TIMED_PRODUCER / TIMED_CONSUMER / TIMED_FOLLOWUP). Arm bodies move verbatim.
  • ② Comsub projection: the three comsub evaluators' name tables consolidate into registry projections (COMSUB_WORD for the word chain, COMSUB_TIMED / COMSUB_HEREDOC for the pipelines evaluator, COMSUB_FRONT for the values front face, slash forms included as registered entries).
  • ③ Per-face field sink (register/document only): ImplRef gains an optional per-face StandDown; exactly four adjudicated cells carry records stating their measured rules — (a) pipeline cat candidate admission (§3.2-a: the concurrent planner yields to a resolvable candidate of either shape; the arm replaces planner-declined members; four-quadrant probe re-measured on 03ae580), (b) timed-consumer sleep producer-checks/consumer-doesn't model-only divergence (§3.2-c/KD-4, kept), (c) mktemp word arm's actual stand-down rule (Replace/Unchecked; the row-level NA masked it, §3.1/§5.4), (d) tput hash-record Separate route (KD-5) dispositioned: Separate stays, rationale on the variant.

Explicitly out of scope: comsub basename Unchecked→FailClosed (ruled to S5 with #2043/#2046 — registered per-face here only); stty axis (stays Replace, evaluation in S6); #2081/#2082 (separate homes); any other stand_down value change.

Discipline: lookups stay const slices + binary search (S3 shape); no syscalls added on hot paths; no runtime-mutable registry. Consistency pins move to the S3 data shape (table/row equality both directions + lookup agreement + shadow-arm subset scans). S1 battery expectations unchanged.

Local gates (CI-uncovered items, per the CI-first rule): registry lib pins, S1 battery, new S4 equivalence battery — numbers in the cluster REPORT.

…own sink (#2036)

Data and pins only; no consumer reads the new tables yet and no
behavior changes anywhere.

- Typed slot tables in the S3 shape (const slices + binary-search
  lookups): PIPELINE_STAGE / PIPELINE_PRECHECK / PIPELINE_STANDIN /
  TIMED_PRODUCER / TIMED_CONSUMER / TIMED_FOLLOWUP for the pipeline
  faces, COMSUB_WORD / COMSUB_TIMED / COMSUB_HEREDOC / COMSUB_FRONT
  for the three command-substitution evaluators. Listed exceptions
  pinned: the stage table omits the restricted-guard five (., cd,
  command, exec, source); COMSUB_WORD omits cd (its face is the
  cd/pwd source-shape idiom, pinned by an exact literal scan).
- Per-face stand_down sink (S3 REPORT 3.2/5.4): ImplRef gains an
  optional StandDown; exactly four faces carry records stating the
  measured rules - pipeline cat (Yield/FailClosed: the concurrent
  planner yields, the arm replaces planner-declined members;
  four-quadrant probe re-measured on 03ae580), comsub basename
  (Replace/Unchecked, KD-3 registration only - the FailClosed
  change is S5's), timed-consumer sleep (Replace/Unchecked, KD-4
  model-only divergence, kept), mktemp word arm (Replace/Unchecked:
  shape-only admission the row-level NA masked). Row values all
  unchanged; the exact per-face set is pinned.
- KD-5 dispositioned: tput's HashRecord::Separate stays, with the
  rationale on the variant (folding into the layer set would move
  the record from post-admission to pre-admission - a behavior
  change); tput pinned as the unique Separate row with its route's
  definition and both call sites.
- T8-T12 consistency pins move to the S3 data shape (table/row
  equality both directions + lookup agreement + shadow-arm subset
  scans of the consumer files).

Refs #2036
Behavior-preserving: every arm body is verbatim; only the claim
keys move to command_registry lookups.

- execute_pipeline_stage_inner: the stand-down pre-check reads
  PIPELINE_PRECHECK and the stage match matches on
  pipeline_stage_slot (PIPELINE_STAGE). The restricted-guard five
  (., cd, command, exec, source) never reach the match, as before;
  off Windows the Tput slot takes the fallback arm exactly as the
  literal tput head did (its arm stays cfg(windows)).
- The concurrent planner's spawn stand-in reads
  PIPELINE_STANDIN; timed_pipeline_step matches on
  timed_producer_slot; timed_read_consumer_output's body loop
  matches on timed_consumer_slot (guards and the followup
  fall-through unchanged); timed_followup_keeps_stream reads
  TIMED_FOLLOWUP.
- tput_inline_stage reads its form set through COMSUB_FRONT's
  tput entries (the row's registered name family).

Local gates: registry consistency pins 20/20, S1 battery 20/20
unchanged (both CI-uncovered locally-run items).

Refs #2036
Behavior-preserving: every arm body is verbatim; only the claim
keys move to command_registry lookups.

- Word evaluator (command_substitution): the exact-body true/:/false
  shortcuts and the first-word chain (echo/printf/cat/basename/
  umask/ulimit/pwd/type/kill/mktemp) key on comsub_word_slot
  (COMSUB_WORD). Each arm keeps its condition tail and fall-through:
  a declined arm still lands on the shared tail (describe call,
  external face, full execution), never on a sibling arm. cd stays
  the listed exception - its face is the cd/pwd source-shape idiom.
- Pipelines evaluator (command_substitution_pipelines): the timed
  inner match matches on comsub_timed_slot (COMSUB_TIMED, tty slash
  forms included; the bare-form-only stand-down check inside the
  tty arm is untouched), and the heredoc producer/plan cat and
  sort keys read comsub_heredoc_slot (COMSUB_HEREDOC).
  mktemp_command_substitution keeps its own name guard - it is the
  word arm's implementation home, not an evaluator table.
- Front face (command_substitution_values): the tty stdio special
  case and the windows tput whitelist arm read comsub_front_slot
  (COMSUB_FRONT). The mktemp decline markers stay literals (they
  are negative guards, pinned as known non-claims).

Local gates: registry consistency pins 20/20, S1 battery 20/20
unchanged, S3 pins 5/5 (CI-uncovered locally-run items).

Refs #2036
New battery tests/issue2036_s4_projection_regressions.rs pinning
the projected faces' current behavior, measured on the
post-projection tree:

- stage arms (grep/head/wc/tr/sed/trap -p), true/false status,
  the pre-check's 127 decline, the sequential-route cat arm
  replacing while the planner yields (the registered per-face
  rule), the yes stand-in;
- timed models: consumer timeout 142, producer+consumer+followup
  chain, bare-read model engagement;
- comsub word arms (echo/printf/cat + its stand-down
  decline-to-127, basename/umask/pwd/type/kill/ulimit), the
  mktemp arm answering for an unresolvable name (its registered
  per-face rule), the exact-body True/Colon/False slots;
- comsub timed arms (echo/cat/tty + the time report), the front
  face's tty bare and slash forms, heredoc cat and sort -u;
- the #2066 host-flag gates riding the projected slots (Session
  Tier-C seam, #2066 probe technique): cat off -> PATH program,
  on -> in-process; sed off -> PATH program, on -> still the PATH
  program via the arm's InvertedSed recheck.

Two adjudications recorded in the battery itself: the sed
flag-on expectation follows the InvertedSed row (it is not a
plain Replace), and a bare trap-table print is deliberately not
pinned (it reflects signal dispositions inherited from the host
process, which this binary's own Session tests mutate - a
pre-existing host-visible side effect, orthogonal to S4).

Local gates: battery 17/17 (twice), lib suite 961/1/3 with the
failure set identical to the master baseline (the +2 passes are
the new registry pins), -D warnings clean on the lib and this
slice's test targets (the one all-targets -D warnings failure is
the pre-existing dead_code in the #2018 test file, owned by
PR #2079).

Refs #2036
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 29, 2026 07:44
@caomengxuan666
caomengxuan666 merged commit 3050ab8 into master Oct 29, 2026
9 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/2036-s4-pipeline-comsub branch October 30, 2026 01:41
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