Repository navigation
perf(executor): globally sort bare-** globstar results (#664) - #674
Merged
Merged
Conversation
Bare ** printed depth-first while GNU sorts the full list (pathexp.c:442 shell_glob_filename + sh_sortglob qsort at :881). globstar_expand now re-sorts globally via globsort_matches (byte order under C/POSIX, live collation otherwise; NOSORT still skips). Per-directory walk untouched. Closes the glob-12 ordering divergence. Repro byte-identical to GNU; glob battery 34/34 (was 33/34).
This was referenced Oct 16, 2026
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.
perf(executor): globally sort bare-
**globstar results (#664)What
With
globstaron, bare**overb/ b-a b/a builtins/ builtins.o builtins/xprinted depth-first (b b/a b-a builtins builtins/x builtins.o) while GNU prints globally sorted (b b-a b/a builtins builtins.o builtins/x). GNU sorts the FULL result list(
pathexp.c:442 shell_glob_filename+sh_sortglobqsort at:881;lib/glob/glob.conly enumerates). The old comment claimingdepth-first was GNU's emission order was wrong.
Fix
globstar_expandre-sorts the walked list globally via the existingglobsort_matches(byte order under C/POSIX throughstrcoll_posixcmp, live collation otherwise;SORT_NOSORTstillskips). Per-directory walk order untouched. This also closes the
previously noted glob-12 bare-
**ordering divergence.Measured
Correctness slice (no perf claim): match/sort/store split bench for
the 4.1x per-file residual is a separate follow-up.
Verification
glob_diff.sh34/34 vs GNU (was 33/34 with glob-12 divergent).cargo test --lib585/585.cli_tests465/0 on bothlegs (the tool's
cli_testsNEW-target row is a parse artifact).Test-level 1 NEW / 2 DISAPPEARED, all three in the
known-nondeterministic
part_080coproc family (all pass inisolation on branch). No regression.
6295367, only rubash[patch]switched): failure sets byte-identical (49=49).