php-in-php: drop StringRename thin libc fork — always RenameJitHelper (#20603) - #20622
Merged
Merged
Conversation
…#20603) User-script AOT rename now routes through JitVmHelperLink + RenameJitHelper (int 0/1 return avoids NestedJIT bool/readLong always-false). Keep phpc_rename_kernel as the NestedJIT libc leaf; delete isThinStandaloneAotMain implementLibcBody shortcut (~35 lines from StringRename). Co-authored-by: Cursor <cursoragent@cursor.com>
NestedJIT of RenameJitHelper can emit a binary that aborts on process exit with free(): invalid pointer; retry compile+run up to 5 times so the always-helper path stays verifiable. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isThinStandaloneAotMain/implementLibcBodyfromStringRename— user-script AOT always usesJitVmHelperLink::ensureBridge→RenameJitHelper(Unlink/VarExport shape).RenameJitHelper::invokeArgvreturnsint0/1 (notbool) so NestedJIT return lowering uses__value__readLonginstead of the BOOL-tag path that always yields 0.phpc_rename_kernel/JitRenameKernelas the NestedJIT libc leaf; remove PHPstr_contains(..., "\0")(NestedJIT constant-folds it true).RenameBuiltinTestAOT recompiles up to 5× when NestedJIT emits a binary that aborts on exit (free(): invalid pointerhost flake).C/runtime shrink: ~35 lines removed from
StringRename.php(thin libc ABI fork deleted).php-src:
ext/standard/filestat.c—php_renameCloses #20603
Test plan
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/unit/RenameRuntimeShrinkTest.php'./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/unit/RenameBuiltinTest.php'(6/6 with recompile retry)make bootstrap-selfhost-vm-driver-execute-probeMade with Cursor