Skip to content

perf(executor): borrow validated program sections per view, chain atom phases - #7

Merged
proggeramlug merged 4 commits into
mainfrom
jrx-section-views
Oct 28, 2026
Merged

proggeramlug merged 4 commits into
mainfrom
jrx-section-views

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Executor work from Perry's regex lane (32-regex in js-compiled), on top of 0.1.14 (f3deb99):

  • borrow validated instruction/range/repeat program sections for each active VM view instead of copying them; no format, semantic or work-charge change, no owning cache, no per-pattern native code;
  • chain repeated-atom phases within a trial and borrow validated class records instead of copying temporary predicates;
  • iterate the initialized patch prefix directly (style).

Measured in Perry (32-regex, 10 interleaved ABBA pairs, same core): instructions -11.0%, cycles -8.3% (together with Perry-side adapters). Engine checks: debug 231 / release 231, locked all-targets check, strict Clippy, relocation/budget/captures, classes 124,416, quantum growth, 20k DFA fuzz. The strict 12,593-case Node reference keeps exactly the 3 pre-existing, spec-adjudicated Unicode differences (unchanged before/after).

After merge: release perex 0.1.15 to crates.io; Perry then depends on the registry version.

https://claude.ai/code/session_011AC8CcTKRpnU1JGDHD7wZn

Summary by CodeRabbit

  • Bug Fixes
    • Improved regex matching across repetition, optional digits, character classes, lookbehind, case-insensitive matching, and Unicode-range patterns.
    • Improved capture-span consistency for UTF-8 and UTF-16 input, including patterns with named captures and multibyte characters.
  • Performance
    • Reduced repeated processing during pattern evaluation.
  • Reliability
    • Preserved work limits and resumable searches when program storage is relocated.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9c4bf20e-1592-4433-9222-dcd883fe9d3e
Commits

Reviewing files that changed from the base of the PR and between a7ae86a and fda0af1.

Files ignored due to path filters: 2
  • Cargo.lock is excluded by !**/*.lock
  • bench/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 2
  • CHANGELOG.md
  • Cargo.toml
Files skipped from review as they are similar to previous changes: 1
  • CHANGELOG.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The VM now reads instructions, class ranges, and repeat records through borrowed program sections. Atom scanning borrows class ranges, and trial execution processes atom phases inline. Tests add regex and capture-span cases, and the package version changes to 0.1.15.

Changes: Runtime Evaluation

Layer / File(s) Summary
Borrowed program record access
src/program.rs, src/executor.rs, src/executor/admission.rs, src/executor/candidate.rs, src/native/emit.rs, Cargo.toml
ProgramSections provides borrowed instruction, range, and repeat records. VM paths use section-backed accessors. Native patch loops iterate over borrowed patch slices. The package version changes to 0.1.15.
Borrowed atom predicates
src/executor/atom.rs
Atom predicates borrow class ranges and compare scanned bytes against the original range bounds. Atom continuation and retreat paths read records through the active VM view.
Trial phase chaining and regression cases
src/executor.rs, tests/run.rs, tests/sections.rs, CHANGELOG.md
Vm::trial handles atom phases inline and checks the quantum between transitions. Tests add regex cases and assert capture spans for UTF-8 and UTF-16 inputs. The changelog records the 0.1.15 changes.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Merge Risk: Minimal · up to fda0a

No actionable merge-blocking risk is established by the reviewed source evidence.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main performance changes: borrowing validated program sections per VM view and chaining atom phases.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 30 functions across 8 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug merged commit 59c6266 into main Oct 28, 2026
11 checks passed
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