Skip to content

fix(tier3): report regex compiler limits during preflight - #905

Open
Afloat16 wants to merge 9 commits into
NVIDIA:mainfrom
Afloat16:fix/declarative-preflight-regex-limits-20261126
Open

Afloat16 wants to merge 9 commits into
NVIDIA:mainfrom
Afloat16:fix/declarative-preflight-regex-limits-20261126

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Current integration update — 2026-12-01

Source: 31cc57e8c4eb5c865f249b9eea18c1357c5955da; integrated main: 108fab86c5c0a8e1548289c036f0977a8c934bf3 (1.3.1 release preparation).

Resolved the CHANGELOG conflict by preserving the complete published 1.3.1 history and keeping this PR's entry under Unreleased. All PR-specific source and regression-test blobs are identical to previous head 142b2ff42ccf6d6b54cd3265105e947af192f5ea. The merge preserves both parents and carries the required DCO sign-off.

Validation for this merge: whitespace checks, released-history preservation, and exact source/test blob comparisons passed. GitHub now reports the PR as conflict-free. Current-source integration checks await maintainer workflow approval; the earlier test results below retain their original revision scope.

Previous integration update (main ad4a12f)

Source: 142b2ff42ccf6d6b54cd3265105e947af192f5ea; integrated main: ad4a12f0e17fe42e8f6839e41b6799ab8990bcf3. Resolved the CHANGELOG conflicts after the 1.3.0 release and stable-CI update. The released history and new upstream entry are preserved, with this PR’s change under Unreleased. The PR-specific source and regression-test files are unchanged from the previous head.

Focused validation: 79 passed, on tree a709979d7e2560693faf52024cb88e81a3d28f22 before the final CI-only main update. That final update changes only CI files and CHANGELOG; the tested runtime and regression files are unchanged. The updated CI modules passed 240 tests on the final #905 integration tree, and those CI blobs are identical in all 11 refreshed branches. Repository Ruff and whitespace checks passed.

Current-head upstream workflows require maintainer approval. Earlier results below apply to their recorded revisions.

Original contribution and validation before this integration update

Current main synchronization (2026-11-30)

Current source: 63b1bee, including main d218ef8. The only merge conflict was in CHANGELOG.md; both entries are retained. The PR implementation and regression-test blobs remain unchanged from the previous head.

Current-source verification: 79 passed across declarative preflight, runtime and dataset coverage; make lint and whitespace checks passed. The new upstream CI run and companion workflows are awaiting approval. Earlier verification below applies to its named source.


Current source and main refresh — 2026-11-30

Current source: 490bbbdf27cb920f483781269e0cde5d7df65070, including main 8b057485209ae956f4d520b8132bbe5c004f5988 in a signed-off merge. Both sides’ changelog entries are retained, and the original contribution implementation and regression files are unchanged.

Validation of this source completed with 79 passed, 0 failed, plus whole-repository lint, the OSS-boundary scan, wheel/sdist builds and final source/tree/lockfile checks on Ubuntu 24.04 / Python 3.12 with the locked full extras.

These are focused checks on the current main merge. Earlier results below retain their stated source revisions. Upstream workflow approval and final maintainer review remain pending.


Earlier main refresh and validation — 2026-11-29

Current source: 6becf155c53a8e64065c6356f69d680579729487. The signed-off merge includes main da729c85676fc965ff81e710af89953126b44041. The only manual conflict resolution was in CHANGELOG.md: the regex compiler-limit entry remains a separate bullet under Unreleased → Fixed, and all main entries are preserved. The original contribution changes and regression coverage remain intact.

At this exact source, focused contribution and integration validation completed with 79 passed, 0 failed. Whole-repository make lint, OSS-boundary checks, make build (wheel and sdist), and final source/tree/lockfile checks also passed on Ubuntu 24.04 with Python 3.12 and the locked full extras.

These are focused checks on the new main merge. The earlier complete-suite results below retain their stated source revisions.


Summary

Dataset preflight catches re.error, but Python's regex compiler can also raise RecursionError, OverflowError, or ValueError for patterns outside its nesting, repetition, or decimal-conversion limits. These exceptions currently escape the checks validator, aborting dataset validation and the coverage summary before later cases can be reported.

Return the existing invalid-pattern diagnostic for these compiler failures. Other checks and dataset entries continue to be validated, and coverage excludes the unusable check instead of failing the whole report. Valid patterns retain Python's regular-expression semantics.

This addresses preflight compilation, which was explicitly outside the scope of #750's runtime matching limits.

Verification

  • All 9 new regressions fail against unchanged upstream with the real compiler exceptions.

  • Declarative preflight, runtime checks, and dataset-coverage modules: 79 passed.

  • Full repository Ruff, changed-file formatting, and diff checks: passed.

  • Isolated wheel and source distribution builds: passed.

  • All three required gates passed for exact contribution c792cd6ec9f9113edf110b53d08670d47a7c995c on a fresh Ubuntu 24.04 runner with Python 3.12.16 and locked all-extra dependencies: validation job. make test reported 45,548 passed, 338 skipped, 19 deselected under the project's existing defaults; no new skips or test exclusions were added.

  • I am familiar with the Contributing Guidelines.

  • Added or updated focused tests.

  • Updated documentation for user-visible changes in the Unreleased changelog.

  • Ran make lint.

  • Ran make test.

  • Ran make build.

  • Did not add credentials, private datasets, or proprietary benchmark content.

Release Impact

  • No user-visible release note needed.
  • Updated CHANGELOG.md.

Signed-off-by: Afloat <ShuffleMonkey@163.com>

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I reproduced all three escapes on main: 2,000-deep nesting raises RecursionError, a{4294967296} raises OverflowError and a repeat count past the int-to-str digit limit raises ValueError, and each one aborts validate_declarative_checks and with it dataset validation and the coverage summary. At head each becomes the normal invalid-pattern diagnostic and the later checks and entries keep being reported. re.compile raises the same types on 3.12, 3.13 and 3.14, so the tuple is right for every supported interpreter.

I ran every output_matches pattern I could find in the repository through the new validator; the only rejections are the two deliberately broken patterns in the existing tests. Compile time stays proportional to pattern length (a 1 MB pattern took about 0.7 s, 100k nested groups fail in a millisecond), so preflight is no less bounded than before. The nine new tests fail on main with the real compiler exceptions and pass at head, and the surrounding declarative-check, coverage, plugin dataset and grader suites show no new failures.

Not blocking, and outside this diff: the runtime worker in _PATTERN_WORKER catches re.error, RecursionError and OverflowError but not ValueError, so the digit-limit pattern comes back as 'the regular expression worker failed' instead of the invalid-pattern reason. With this PR those patterns are rejected before a run, so it only matters for datasets run without preflight, but it would be a one-word follow-up for consistency. DCO signed, lint clean, changelog under Unreleased; the changelog line sits at the same spot as PRs 904, 906 and 907, so the second one to merge needs a trivial rebase.

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @Afloat16 for this contribution.

[SkillEvaluator Review]

Value and readiness

Tier 3 preflight now reports compiler limit errors through the normal invalid-regex diagnostic and continues validating later checks and cases.

Ready for final review by the maintainers and PIC.

Material findings

No new findings.

PIC tradeoffs

None identified.

Verification

79 focused preflight, runtime and coverage tests passed. Traced the compiler exceptions and checked valid regular-expression semantics, the unreleased changelog and current-head CI.

Reviewed head c792cd6ec9f9113edf110b53d08670d47a7c995c.

@rng1995
rng1995 enabled auto-merge (squash) November 29, 2026 12:07
@rng1995

rng1995 commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks @Afloat16 for this contribution. I prepared and verified a signed-off merge against main at 86f1f141. The only conflict is in CHANGELOG.md.

Please enable Allow edits from maintainers in the PR sidebar so I can push the prepared merge. You can also merge main into this branch and keep the regex compiler-limit entry as a separate bullet under ## Unreleased → ### Fixed, preserving the entries from main.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
auto-merge was automatically disabled November 29, 2026 12:33

Head branch was pushed to by a user without write access

@Afloat16

Copy link
Copy Markdown
Contributor Author

Merged current main in signed-off commit 6becf155. The regex compiler-limit entry is kept separately under Unreleased → Fixed, with all main entries preserved. Only the changelog conflict needed manual resolution; the original contribution patch and regression coverage are retained.

Validation of this exact merged source passed 79 passed, 0 failed, whole-repository lint, OSS-boundary checks, wheel/sdist builds and final clean-source checks. The description now distinguishes these new focused results from the earlier complete-suite results. Fresh upstream workflows still await maintainer approval.

The requested main sync is ready for your final review.

Keep both sides of the changelog conflict and retain the contribution's implementation and regression coverage.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Resolve the CHANGELOG conflict by retaining both entries. Keep the
contribution's production and test blobs unchanged.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Retain the pull request contribution and current upstream changes.
Resolve the CHANGELOG conflict by preserving both sets of entries.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Preserve the published 1.3.0 history and the new stable-CI release note,
and place this pull request's change under Unreleased. Keep the reviewed
source and test changes.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Keep the published 1.3.1 release history and this pull request's change
under Unreleased. The reviewed source and test changes are unchanged.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Integrate main 9747bc1 while retaining the original contribution and its regression coverage. Keep the release note as a separate Unreleased Fixed bullet and preserve all main entries.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
@rng1995

rng1995 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

@Afloat16 Please resolve merge conflicts and provide permission for me to merge your PR.

Keep the contribution under Unreleased and retain the complete published release history.

Signed-off-by: Afloat <ShuffleMonkey@163.com>

This branch has not been deployed

No deployments
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.

3 participants