Skip to content

fix: support ICU regexp constructs - #28862

Merged
XuPeng-SH merged 10 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-28305-icu-regexp
Sep 15, 2026
Merged

XuPeng-SH merged 10 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-28305-icu-regexp

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #28305.

This PR adds ICU-compatible regexp2 support for constructs outside Go RE2, with bounded evaluation, admission/resource limits, cleanup, and SQL/BVT coverage.

Validation at current head c177b2be5dc123a42129ca66d1a1e0a9cb0a7f47 (rebased on f9a4444774):

  • CGO_CFLAGS="-I$PWD/cgo -I$PWD/thirdparties/install/include" go test -mod=readonly ./pkg/sql/plan/function -count=1 — PASS (12.765s).
  • Same package go vet — PASS.
  • package-scoped golangci-lint run --concurrency 1 -c .golangci.yml ./pkg/sql/plan/function — PASS (0 issues).
  • make err-check, license header check, and git diff --check — PASS.
  • independent JDBC BVT cases/func_regular_icu.test — 14/14, 100%.
  • GPT-6 medium final review — PASS, no P0/P1/P2.

The latest SCA failure was resolved semantically: an equivalent append form replaces the staticcheck loop, and three unused non-deadline wrappers were removed; the deadline-based call paths remain unchanged.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added the size/XXL Denotes a PR that changes 2000+ lines label Sep 14, 2026
@XuPeng-SH
XuPeng-SH force-pushed the codex/issue-28305-icu-regexp branch from 8952562 to 3b9d46a Compare September 14, 2026 10:38
@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

Design-first review — #28305 / #28862

  • Trigger: this change adds a large production ICU-compatibility layer, a backtracking hot path, a compiled-pattern cache, and explicit resource admission.
  • Design artifact: REGEXP ICU-compatibility execution path
  • Reviewed revision: a8dad0e544f495a4b38a402f110c5264ea95a6ff
  • Design reviewer: GPT-6 Astra, medium reasoning
  • Decision: PASS; no P0/P1/P2 blocker.
  • Implementation alignment: the document records the syntax-routing matrix, local-vs-unaccounted resource boundaries, regexp2 fastclock ownership, phase-level timeout semantics, mixed-version rollout/rollback, failure cleanup, and executable lifecycle/performance oracles.

Validation on the final implementation head:

  • full native CGo-linked go test -mod=readonly -count=1 ./pkg/sql/plan/function: PASS (12.678s)
  • focused lifecycle/routing tests and targeted -race: PASS
  • five-run BenchmarkRegexp2CompatibilityPaths -benchmem: PASS; RE2, regexp2, \\X, and two-pass replacement samples satisfy the documented stability rules
  • go vet -mod=readonly ./pkg/sql/plan/function: PASS
  • git diff --check: PASS

Remote CI/BVT is running on this exact head; no result is claimed until the checks complete.

@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

CI triage for current head a8dad0e544f495a4b38a402f110c5264ea95a6ff:

  • Coverage job 104033548686 did not process source coverage. matrixorigin/CI/actions/setup-cmake@main retried the Ninja download and received HTTP 504 twice, then failed with install-cmake failed.
  • The PR's UT Coverage producer 104016099787 completed successfully, so this is not a changed-line coverage or source-test failure.
  • Current main is c61ed374a8a6daebc4e753a928cb63c584addb4c; the current feature head already contains it (rebase is a no-op). No code change or new base-product issue is justified; CI was not awaited.

@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

New CI status clarification for head a8dad0e544f495a4b38a402f110c5264ea95a6ff:

  • Ubuntu UT 104016057375 was terminated by the configured global UT HARD TIMEOUT: 70m (make: ... Error 124, wall 71m58s). The final diagnostics show only cancellation victims still running: pkg/sql/plan.TestShuffleRange and pkg/vm/engine/tae/db/test.TestSnapshotGC; there is no terminal assertion, panic, race report, or ICU/function test failure.
  • This is the repeated unsharded race-UT deadline/cancellation signature tracked by existing open #28538, not a regression from the ICU regexp changes. CI Required 104044445559 only propagates matrixone-ci: failure and the prior infrastructure Coverage merge failure.
  • The current feature head already contains main c61ed374a8; rebase remains a no-op. No duplicate issue or code change is warranted.

@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

Follow-up base fix is queued in PR #28880: #28880 (related to existing #28538). This PR's ICU changes are not being modified; its UT timeout was the shared unsharded CI deadline.

@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

Rebase verification: the current head a8dad0e544f495a4b38a402f110c5264ea95a6ff on codex/issue-28305-icu-regexp is already based on current main c61ed374a8 (behind=0, ahead=9); a rebase would be a no-op, so no rewrite/push was made. The failed Coverage/Ninja 504 and Ubuntu race-UT hard timeout are CI/base issues, not ICU-regexp code failures; the shared hard-timeout fix is queued in #28880.

@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

Post-rebase status: the PR branch is now at 78cb542efde9ceabceee4968aba548148d2256bf, rebased onto main afbb411d5d and pushed to the existing XuPeng-SH feature ref. The Ubuntu hard timeout remains the existing #28538 unsharded race-UT base issue; no ICU-regexp code change is required. CI is intentionally not awaited.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

GPT-6 medium deep review at 78cb542efde9ceabceee4968aba548148d2256bf — design gate PASS; implementation PASS with no P0/P1/P2 blockers.

The change map covers syntax routing, translation and capture numbering, RE2/ICU separation, text/binary offsets, replacement, cache admission, per-evaluation memory bounds, timeout behavior, and cleanup of runner/input state. I found no concrete path that bypasses the compatibility-path size/admission checks or retains a SQL subject in the shared matcher cache. The latest revision makes the benchmark acceptance reproducible and explicitly distinguishes the cooperative iteration deadline from regexp2’s per-match timeout. Current-head CI is green; the PR records focused package, race, five-run benchmark, and JDBC BVT evidence for the implementation.

This comment records the design decision required by docs/design/regexp-icu-compatibility.md: exact reviewed commit 78cb542efde9ceabceee4968aba548148d2256bf, reviewer/model GPT-6 medium, decision PASS. No blocking findings.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Compatibility]: REGEXP lacks MySQL ICU constructs and capture-group replacement

2 participants