Skip to content

AOT-safe UndefinedVariableJitHelper guards (#10524) - #10543

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-10524-undefined-var-jit-helper
Jun 22, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-10524-undefined-var-jit-helper

Conversation

@PurHur

@PurHur PurHur commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • AOT-safe UndefinedVariableJitHelper guards without broken LLVM bridge (#10360) #10524: Rebased onto current master — incremental AOT-safe guards for undefined-variable warnings.
  • Skip duplicate StringTriggerErrorJit::implement when __compiler_trigger_error is already linked in standalone modules (avoids corrupt LLVM module / verify failures on 000-HelloWorld).
  • Skip scope-var JIT guards during NestedJitCompileScope (PHP_COMPILER_SELFHOST_AOT=0) so nested ObGzhandler bootstrap does not fatal.
  • Document in Context that UndefinedVariableRuntime::ensureStandaloneBodies is intentionally omitted (StringTriggerError already linked).
  • Guards route through UndefinedVariableRuntime::emitWarningForName()UndefinedVariableJitHelper::warningMessage() SSOT + __compiler_trigger_error (no compiled helper bridge ABI mismatch).

php-src reference

  • Zend/zend_execute.cZEND_CHECK_UNDEFINED_VAR
  • PHP: lib/VM/UndefinedVariableJitHelper.php, lib/JIT/Builtin/UndefinedVariableRuntime.php

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/UndefinedVariableRuntimeShrinkTest.php test/unit/JIT/ScalarDimFetchRuntimeStandaloneTest.php
./script/examples-aot-smoke.sh
'

Results (2026-06-22):

  • UndefinedVariableRuntimeShrinkTestOK (4 tests)
  • ScalarDimFetchRuntimeStandaloneTestOK (1 test)
  • examples-aot-smokeok (000–006, 008–009 default slice)

Closes #10524

@PurHur

PurHur commented Jun 22, 2026

Copy link
Copy Markdown
Owner Author

Merge blocked: origin/master (aa4bfa6) still fails examples-aot-smoke at 000-HelloWorld independently of this patch. This branch (#10498 base + #10524) is green. Recommend landing #10498/#10541 stack first, then rebase this PR.

@PurHur

PurHur commented Jun 22, 2026

Copy link
Copy Markdown
Owner Author

Maintainer triage (2026-06-22):

  • Merge blocked: GitHub reports `mergeable: CONFLICTING` vs current `master`. Rebase/merge master and re-run `./script/examples-aot-smoke.sh` before merge.
  • Bootstrap gates on master (host): `bootstrap-selfhost-link` ✅ · `bootstrap-selfhost-helloworld` ✅ · `bootstrap-inventory.php --check` ❌ (stale `docs/bootstrap-inventory.md`, see Release v1.1.0: regenerate stale docs/bootstrap-inventory.md #10368).
  • Local verification plan looks right; please confirm smoke green on rebased branch.

@PurHur

PurHur commented Jun 22, 2026

Copy link
Copy Markdown
Owner Author

Maintainer verify 2026-06-22 (branch tip 5d0901b46, pre-rebase):

  • ./script/examples-aot-smoke.shok (000-HelloWorld through 009-FastCGIWeb)
  • UndefinedVariableRuntimeShrinkTest — 3/3
  • ScalarDimFetchRuntimeStandaloneTest — 1/1
  • make bootstrap-selfhost-link — ok

Not merged: git merge origin/master hits conflicts; post-merge resolution re-runs smoke red on 000-HelloWorld (LLVM verify: ret i64/i32 and ret %__string__* … i1). Needs rebase onto current master + fix standalone bridge regressions from #10498 follow-ups before merge.

Closes #10524 when green on master.

…ted-compile guards (#10524).

Avoid re-implementing StringTriggerError when __compiler_trigger_error is already
linked in standalone modules. Skip scope-var JIT guards when nested php-in-PHP
helper compiles set PHP_COMPILER_SELFHOST_AOT=0 so ObGzhandler bootstrap does not
fatal. Context documents omitting ensureStandaloneBodies for this runtime.

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.

AOT-safe UndefinedVariableJitHelper guards without broken LLVM bridge (#10360)

1 participant