Skip to content

find, locate: replace onig with fancy-regex - #861

Closed
wtcpython wants to merge 1 commit into
uutils:mainfrom
wtcpython:replace-onig-with-fancy-regex
Closed

wtcpython wants to merge 1 commit into
uutils:mainfrom
wtcpython:replace-onig-with-fancy-regex

Conversation

@wtcpython

Copy link
Copy Markdown
Contributor

Closes #212

Copilot AI lite review requested due to automatic review settings September 10, 2026 12:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.90604% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.16%. Comparing base (a50a8c9) to head (6ad403c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/find/matchers/regex_transpile.rs 87.80% 11 Missing and 4 partials ⚠️
src/find/matchers/regex.rs 33.33% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #861      +/-   ##
==========================================
- Coverage   92.33%   92.16%   -0.18%     
==========================================
  Files          35       36       +1     
  Lines        7490     7607     +117     
  Branches      390      402      +12     
==========================================
+ Hits         6916     7011      +95     
- Misses        433      448      +15     
- Partials      141      148       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown

Commit 4119378 has test result changes:

GNU findutils testsuite:

Test results comparison:
  Current:   TOTAL: 495 / PASSED: 417 / FAILED: 77 / SKIPPED: 1
  Reference: TOTAL: 495 / PASSED: 425 / FAILED: 69 / SKIPPED: 1

Changes from main branch:
  TOTAL: +0
  PASSED: -8
  FAILED: +8

New test failures (8):
  - iregex1.new-O0
  - iregex1.new-O1
  - iregex1.new-O2
  - iregex1.new-O3
  - regex1.new-O0
  - regex1.new-O1
  - regex1.new-O2
  - regex1.new-O3

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 317 / PASSED: 271 / FAILED: 40 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 274 / FAILED: 37 / SKIPPED: 6

Changes from main branch:
  TOTAL: +0
  PASSED: -3
  FAILED: +3

New test failures (3):
  - common/regex_parens
  - gnu/regextype_emacs
  - posix/name_character_class

@codspeed-hq

codspeed-hq Bot commented Sep 10, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 61.06%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 7 improved benchmarks
✅ 13 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
regex_path 51.4 ms 24.6 ms ×2.1
combined_expr 52.7 ms 28.6 ms +84.24%
iname_glob 35.6 ms 22.4 ms +59.13%
prune 13.4 ms 8.5 ms +58.43%
name_glob 35 ms 22.4 ms +56.77%
build_pruned 33.3 ms 24.1 ms +38.02%
regex 30.5 ms 22.8 ms +33.99%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing wtcpython:replace-onig-with-fancy-regex (6ad403c) with main (fda8855)

Open in CodSpeed

@wtcpython
wtcpython force-pushed the replace-onig-with-fancy-regex branch from 4119378 to 1d1cb46 Compare September 10, 2026 12:43
Copilot AI review requested due to automatic review settings September 10, 2026 12:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread src/find/matchers/regex_transpile.rs Outdated
}

match chars.next() {
Some('(') => output.push('('),

This comment was marked as resolved.

Comment thread src/find/matchers/regex_transpile.rs Outdated

while let Some(ch) = chars.next() {
if ch != '\\' {
if matches!(ch, '(' | ')' | '{' | '}') {

This comment was marked as resolved.

@github-actions

Copy link
Copy Markdown

Commit 1d1cb46 has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 317 / PASSED: 272 / FAILED: 39 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 274 / FAILED: 37 / SKIPPED: 6

Changes from main branch:
  TOTAL: +0
  PASSED: -2
  FAILED: +2

New test failures (2):
  - gnu/regextype_emacs
  - posix/name_character_class

@oech3

This comment was marked as resolved.

@wtcpython
wtcpython force-pushed the replace-onig-with-fancy-regex branch from 1d1cb46 to 74366fe Compare September 10, 2026 12:50
Copilot AI review requested due to automatic review settings September 10, 2026 12:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wtcpython
wtcpython force-pushed the replace-onig-with-fancy-regex branch from 74366fe to d606209 Compare September 10, 2026 12:52
Copilot AI review requested due to automatic review settings September 10, 2026 12:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Commit 74366fe has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 316 / PASSED: 271 / FAILED: 39 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 274 / FAILED: 37 / SKIPPED: 6

Changes from main branch:
  TOTAL: -1
  PASSED: -3
  FAILED: +2

New test failures (2):
  - gnu/regextype_emacs
  - posix/name_character_class

No result in this run (1) - hung, crashed, or renamed:
  ? posix/flag_comma (was PASS)

@github-actions

Copy link
Copy Markdown

Commit d606209 has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 317 / PASSED: 272 / FAILED: 39 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 274 / FAILED: 37 / SKIPPED: 6

Changes from main branch:
  TOTAL: +0
  PASSED: -2
  FAILED: +2

New test failures (2):
  - gnu/regextype_emacs
  - posix/name_character_class

Copilot AI review requested due to automatic review settings September 10, 2026 13:07
@wtcpython
wtcpython force-pushed the replace-onig-with-fancy-regex branch from d606209 to 6ad403c Compare September 10, 2026 13:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Commit 6ad403c has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 316 / PASSED: 273 / FAILED: 37 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 274 / FAILED: 37 / SKIPPED: 6

Changes from main branch:
  TOTAL: -1
  PASSED: -1
  FAILED: +0

No result in this run (1) - hung, crashed, or renamed:
  ? gnu/execdir_plus_semicolon (was PASS)

@lhecker

lhecker commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

I've been made aware of the series of changes for uutils to migrate away from onig via uutils/grep#117. I'd like to also mention here, that this PR regresses matches that rely on leftmost longest semantics.

Example:

touch a ab
find a ab -regex 'a\|z'

@wtcpython wtcpython closed this Sep 11, 2026
@wtcpython
wtcpython deleted the replace-onig-with-fancy-regex branch September 11, 2026 12:26
@keith-hall

Copy link
Copy Markdown

note that I have a PR prepared for fancy-regex to enable leftmost longest match mode: fancy-regex/fancy-regex#281

@sylvestre

Copy link
Copy Markdown
Contributor

cool, thanks :)

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.

consider making onig optional

6 participants