Skip to content

engine: mode-scoped traversal defaults (modern parallel+sorted, find unordered) - #144

Merged
helly25 merged 2 commits into
mainfrom
feat/mode-scoped-defaults
Jun 27, 2026
Merged

engine: mode-scoped traversal defaults (modern parallel+sorted, find unordered)#144
helly25 merged 2 commits into
mainfrom
feat/mode-scoped-defaults

Conversation

@helly25

@helly25 helly25 commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Completes the deferred piece of the parallel walk (#43): the mode-scoped auto-defaults, now that the config style (registry::Style, ActiveStyle, argv[0] dispatch) exists.

  • RunFind gains an optional registry::Style. With no --sort/-j, the default is mode-scoped:
    • kXff (modern): --sort=dir (each directory's listing sorted) + a capped parallel walk max(1, min(cores-1, 15)).
    • kFind: unordered (matches find) but saturates cores.
    • std::nullopt: conservative unordered + single-threaded - so the ~32 in-process RunFind callers and the conformance suite are untouched (no signature ripple, no behavior change for tests).
  • The CLI passes the active style (it already computes it for EnforceStyle), so xff <dir> now comes out dir-sorted while xff --config=find <dir> (or invoked as find) stays unordered. Verified end-to-end.

run_test::ModeScopedSortDefault locks it in (kXff deterministic; kFind same set unordered). Green under default and asan+ubsan; tsan unaffected.

…unordered)

Completes the deferred piece of the parallel walk (#43/#54). RunFind gains an
optional registry::Style: when the user gives no --sort / -j, the default is
mode-scoped - kXff (modern) sorts each directory (--sort=dir) and runs a capped
parallel walk (max(1, min(cores-1, 15))); kFind matches find (unordered) but
saturates cores. std::nullopt keeps the conservative unordered + sequential
default, so the ~32 in-process RunFind callers and conformance are untouched;
the CLI passes the active style (config::ActiveStyle / argv[0] dispatch).

run_test::ModeScopedSortDefault locks the behavior (kXff deterministic dir-
sorted; kFind same set, unordered). Full suite green under default and
asan+ubsan; tsan unaffected (test callers stay sequential; walk_test already
covers the parallel path).
@helly25
helly25 enabled auto-merge (squash) June 27, 2026 14:58
@helly25
helly25 disabled auto-merge June 27, 2026 15:01
…efix rule

run_test's ModeScopedSortDefault wrote ::testing::ElementsAre inline even
though the file already has `using ::testing::ElementsAre;` - use the bare
name. STYLE_CPP.md now states the rule explicitly: bring matchers in with a
using and never write the ::testing:: prefix inside an EXPECT_THAT/ASSERT_THAT
expression (fixture utilities like ::testing::Test are exempt). Audited the
suite: this was the only inline-qualified matcher.
@helly25
helly25 enabled auto-merge (squash) June 27, 2026 15:05
@helly25
helly25 merged commit 097f04a into main Jun 27, 2026
8 checks passed
@helly25
helly25 deleted the feat/mode-scoped-defaults branch June 27, 2026 15:08
helly25 added a commit that referenced this pull request Jul 11, 2026
Each --summary[=X] is now its own sink, mirroring --histogram (already a
list): `xff . -type f --summary=ext --summary=type` prints both tables,
in occurrence order, separated by a blank line. --summary=none clears
the list (all off). --top / --summary-precision stay global and apply to
every table.

This delivers the multiple-sinks benefit that was #144's only remaining
driver after #145 gave the positional win, WITHOUT the expression-action
machinery first proposed (no single-dash action, no suppress-default-
print, no expression scoping). ResolveSummary -> ResolveSummaries (a
vector<SummarySpec>); the walk keeps one {group -> {count,size}} map per
sink; a render lambda emits each table. The single-summary output is
unchanged.

Docs: the --summary GlobalFlag summary/details note repeatable; XFF.md
regenerated. Test: multiple_summary_flags_emit_independent_tables.
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