Skip to content

fix: loops compliance + php-llvm patches (#192)#326

Merged
PurHur merged 1 commit into
masterfrom
issue-192-loops
May 20, 2026
Merged

fix: loops compliance + php-llvm patches (#192)#326
PurHur merged 1 commit into
masterfrom
issue-192-loops

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 20, 2026

Summary

  • Language: while, do-while, and for loops (CFG → VM → JIT) #192: while / for / do-while are lowered by php-cfg to Jump / JumpIf; VM/JIT already execute that shape. This PR adds PHPT coverage and stops phpc lint from falsely flagging AST loop kinds via UnsupportedRegistry.
  • Docker CI unlock: patches/php-llvm-phi-add-incoming.patch + php-llvm-builder-and-or.patch were corrupt (git apply never applied), so LLVMAddIncoming / Builder::and/or never landed in fresh composer install trees; JIT init fatals. Replaced with valid patches:
    • patches/php-llvm-value-addincoming.patch
    • patches/php-llvm-llvmabstract-value-addincoming.patch
    • refreshed patches/php-llvm-builder-and-or.patch
  • Host edge case: script/php-env.sh now skips non-executable / directory php candidates (harness quirk: exec: php: Is a directory).

Tests (local / Docker)

  • docker run ... php-compiler:22.04-dev + vendor/bin/phpunit test/compliance/VMTest.phpOK (174 tests) including new loops.phpt.
  • Full script/ci-local.sh from this harness appeared to stall after ~61% of the first PHPUnit batch in earlier runs (needs verification on a normal host); patch application now succeeds (see Applied php-llvm-* lines when vendor is clean).

Fixes #192.

Made with Cursor

…192)

- Replace corrupt php-llvm patches with valid git-apply diffs: Value::addIncoming +
  LLVMAbstract Value implementation; Builder and()/or() aliases.
- Teach apply-patches.sh to apply the split patches (drop broken combined phi patch).
- Add compliance PHPT coverage for for/while/do-while (VM + @group llvm JIT file).
- Remove Stmt_While/For/Do from UnsupportedRegistry and docs table (CFG uses Jump/JumpIf).
- Harden script/php-env.sh so a bogus executable-as-directory php candidate is skipped.

Fixes #192.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 698231b into master May 20, 2026
1 check failed
@PurHur PurHur deleted the issue-192-loops branch May 20, 2026 09:07
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.

Language: while, do-while, and for loops (CFG → VM → JIT)

1 participant