Skip to content

fix(xslt): skip unused function registry setup - #288

Merged
polaz merged 1 commit into
mainfrom
fix/xslt-replay-timeout
Oct 23, 2026
Merged

polaz merged 1 commit into
mainfrom
fix/xslt-replay-timeout

Conversation

@polaz

@polaz polaz commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Function-free XPath expressions rebuilt the XSLT and EXSLT function registry on every evaluation. Branching templates repeatedly paid that allocation and registration cost, causing retained XSLT fuzz inputs to time out under AddressSanitizer.

Skip extension-function registration when the expression cannot contain a function call, and use the same condition for workspace accounting. Keep existing execution limits and failure behavior. Retain the timeout input in the regular fuzz corpus and cover bounded execution behavior with regression tests.

Validation: native macOS workspace tests with all features and the maintained PKCS#11 fixture, workspace Clippy, formatting, documentation tests, alloc-only checks, and AddressSanitizer replay and fuzz checks.

Summary by CodeRabbit

  • Bug Fixes
    • XPath arithmetic and comparison expressions that do not call functions can now run with a smaller workspace budget. Expressions that use functions continue to receive the workspace needed for function bindings.
    • When an XPath evaluation exceeds its configured limit, repeated runs consistently report the budget error at the limit boundary. This makes resource-limit behavior more predictable.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-23T18:57:30.448396Z 305427a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 053533b and 305427a.

⛔ Files ignored due to path filters: 1
  • fuzz/seeds.tsv is excluded by !**/*.tsv
📒 Files selected for processing: 4
  • crates/xml-sec-xslt/tests/engine.rs
  • fuzz/seeds/xslt-branching-comparison.xsl
  • src/xslt/xpath.rs
  • src/xslt/xpath/tests.rs

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

XPath evaluation now skips function registration and related workspace allowances when an expression contains no (. Tests cover function-free expressions under a small workspace budget and repeatable XPath evaluation budget errors for a branching XSLT seed.

Changes: XPath Function Binding

Layer / File(s) Summary
Conditional function binding and expression tests
src/xslt/xpath.rs, src/xslt/xpath/tests.rs
Function registration and workspace estimates depend on whether the expression contains (. Tests check arithmetic and comparison evaluation with an 8 KiB owned-byte budget.
Branching stylesheet budget test
fuzz/seeds/xslt-branching-comparison.xsl, crates/xml-sec-xslt/tests/engine.rs
A branching stylesheet seed is run twice under the same XPath evaluation budget. The test checks for the same budget error and bounded reported counters.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 30542

No concrete issue requiring a fix before merge was identified; proceed with normal validation.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (2 skipped: 1… 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 change: avoiding unnecessary XSLT function registry setup for expressions without function calls.
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 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (2 skipped: 1 unsupported, 1 too large.)

Resolution

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

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 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.

@polaz
polaz merged commit e30264f into main Oct 23, 2026
73 checks passed
@polaz
polaz deleted the fix/xslt-replay-timeout branch October 23, 2026 19:46
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