Skip to content

fix(executor): sync the typed cell on unset a[@] flush (#651) - #659

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/issue651-unset-flush
Oct 16, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/issue651-unset-flush

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

fix(executor): sync the typed cell on unset "a[@]" flush (#651)

What

declare -a a=(p q); unset "a[@]"; echo "${#a[@]}" printed 2 while
declare -p showed a=(). The flush arm rewrote the mirror but left
the structured cell, so the ${#a[@]} fast path shadowed the removal —
the #638 dual-store class on the unset path
(arrayfunc.c:1180-1200 flushes every element).

Fix

One line: sync the cell empty in the flush arm, exactly like the
element-unset path below it already does. No other reader changes (all
fold through the cell or the mirror consistently once they agree).

Verification

  • New 22-case GNU differential battery: 12/22 on master → 22/22
    (counts AND renders AND keys AND re-append landing).
  • New tests/issue651_unset_flush.rs (5 tests, incl. the assoc no-op
    guard pinned byte-exact as both shells agree).
  • Focused suites green (parity, 638, 637); full serial failure-set
    gate vs master: target sets identical (NEW=0/DISAPPEARED=0); test-level
    3 NEW / 1 DISAPPEARED all in the known-nondeterministic part_080
    coproc family (all four pass in isolation on branch).
  • niubash product A/B (niubash pinned 6295367, only rubash [patch]
    switched): failure sets identical apart from the known load-flaky 50x
    timing-ratio test (fails then passes back-to-back on the branch tree).

GNU owner: arrayfunc.c:1180-1200 unbind_array_element.

declare -a a=(p q); unset "a[@]"; echo "${#a[@]}" printed 2 while
declare -p showed a=(). The flush arm rewrote the mirror but left the
structured cell, so the ${#a[@]} fast path shadowed the removal — the
#638 dual-store class on the unset path (arrayfunc.c:1180-1200 flushes
every element). One line: sync the cell empty, like the element-unset
path already does.

Verification: new 22-case GNU differential 12/22 -> 22/22 (counts AND
renders AND keys AND re-append landing); new
tests/issue651_unset_flush.rs (5 tests, incl. the assoc no-op guard);
focused suites green; full serial failure-set gate vs d4c11fc identical
targets (NEW=0/DISAPPEARED=0; 3/1 part_080 coproc flake passing in
isolation); niubash A/B identical apart from the known load-flaky
timing test (fail-then-pass back-to-back on one tree).
@caomengxuan666
caomengxuan666 force-pushed the fix/issue651-unset-flush branch from c08f928 to 83e0bd1 Compare October 16, 2026 10:11
@caomengxuan666
caomengxuan666 merged commit 23badf8 into master Oct 16, 2026
6 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/issue651-unset-flush branch October 16, 2026 10:14
caomengxuan666 added a commit that referenced this pull request Oct 28, 2026
…calize's verbatim form (niubash#659)

act1_host_drives_session_through_state_views_only compared
views.cwd() against a raw std::fs::canonicalize result — on
Windows that is the extended-length \\?\ form, i.e. the pin
encoded the #659 regression's shape as the contract. GNU's cwd
is a getcwd string and never carries the prefix, and the field
now stores that form; compare against
executor::path::strip_verbatim_prefix of the canonical path
instead. The raw canonical value stays as the
filesystem-identity yardstick for the printed-pwd comparison.
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