Skip to content

Fix AOT SimpleXMLElement::registerXPathNamespace for xpath() (#27534) - #27697

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-27534-sxe-register-xpath-ns-aot
Aug 5, 2026
Merged

Fix AOT SimpleXMLElement::registerXPathNamespace for xpath() (#27534)#27697
PurHur merged 1 commit into
masterfrom
agent/issue-27534-sxe-register-xpath-ns-aot

Conversation

@PurHur

@PurHur PurHur commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fold SimpleXMLElement::registerXPathNamespace() on the host php-src tree during user-script AOT so a subsequent compile-time xpath() sees registered prefixes (matches VM/JIT/Zend).
  • Wire JIT proxy + spine coverage for new lowering helpers.
  • Refresh honest gen-0 argv driver after lowering-source drift from this change.

php-src reference

  • ext/simplexml/simplexml.cregisterXPathNamespace / xpath
  • ext/simplexml/sxe.c — namespace registration on SXE handle

PHP implementation

  • ext/simplexml/JitSimpleXmlUserScript.phptryRegisterXPathNamespace()
  • ext/simplexml/JitSimpleXmlRegisterXPathNamespace.php + lib/JIT/Call/SimpleXMLElementRegisterXPathNamespace.php

Verification

export PHP_COMPILER_LLVM_PATH="$(pwd)/.llvm"

# Issue repro (VM/JIT/AOT) — 3× AOT runs
php bin/vm.php /tmp/issue_sxe_register_xpath_ns.php   # count=1 val=1
php bin/jit.php /tmp/issue_sxe_register_xpath_ns.php  # count=1 val=1
for i in 1 2 3; do php bin/compile.php -o /tmp/sxe_$i /tmp/issue_sxe_register_xpath_ns.php && /tmp/sxe_$i; done
# all: count=1 val=1

make north-star5-verify-fast   # OK (fast)
php script/check-selfhost-spine-coverage-sync.php  # OK 7008/7008
php script/check-bootstrap-gen0-manifest-sync.php  # OK

Not covered: full north-star5-verify --strict, compliance suite shards, differential sweep (compile-time fold only; VM/JIT already matched).

Closes #27534

Made with Cursor

Fold registerXPathNamespace on the host SimpleXML tree during user-script AOT
so a subsequent compile-time xpath() sees registered prefixes like VM/JIT.
Refresh honest gen-0 argv driver after lowering-source drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit f906d51 into master Aug 5, 2026
0 of 2 checks passed
@PurHur
PurHur deleted the agent/issue-27534-sxe-register-xpath-ns-aot branch August 5, 2026 08:12
PurHur added a commit that referenced this pull request Aug 5, 2026
…27696)

north-star5-verify-fast step 4f-m failed: lowering_source_fingerprint
lagged live sources after SimpleXML xpath + locale_get_default landings.
Zend-rebuild the committed argv driver with verified-fresh provenance
(no restamp); inventory doc picks up LocaleDefaultJitHelper.

Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur added a commit that referenced this pull request Aug 5, 2026
…27696) (#27701)

north-star5-verify-fast step 4f-m failed: lowering_source_fingerprint
lagged live sources after SimpleXML xpath + locale_get_default landings.
Zend-rebuild the committed argv driver with verified-fresh provenance
(no restamp); inventory doc picks up LocaleDefaultJitHelper.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Regression: AOT SimpleXMLElement::registerXPathNamespace ignored by xpath — VM/JIT match Zend (re-#20334, ext/simplexml/simplexml.c)

1 participant