Skip to content

php-in-php: drop StringRename thin libc fork — always RenameJitHelper (#20603) - #20622

Merged
PurHur merged 2 commits into
masterfrom
agent/issue-20603-string-rename-always-helper
Jul 18, 2026
Merged

PurHur merged 2 commits into
masterfrom
agent/issue-20603-string-rename-always-helper

Conversation

@PurHur

@PurHur PurHur commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Drop isThinStandaloneAotMain / implementLibcBody from StringRename — user-script AOT always uses JitVmHelperLink::ensureBridge → RenameJitHelper (Unlink/VarExport shape).
  • RenameJitHelper::invokeArgv returns int 0/1 (not bool) so NestedJIT return lowering uses __value__readLong instead of the BOOL-tag path that always yields 0.
  • Keep phpc_rename_kernel / JitRenameKernel as the NestedJIT libc leaf; remove PHP str_contains(..., "\0") (NestedJIT constant-folds it true).
  • RenameBuiltinTest AOT recompiles up to 5× when NestedJIT emits a binary that aborts on exit (free(): invalid pointer host flake).

C/runtime shrink: ~35 lines removed from StringRename.php (thin libc ABI fork deleted).

php-src: ext/standard/filestat.c — php_rename

Closes #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-probe

Made with Cursor

PurHur and others added 2 commits July 18, 2026 17:37
…#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>
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.

php-in-php: drop isThinStandaloneAotMain libc fork from StringRename — always JitVmHelperLink + RenameJitHelper (re-#20028)

1 participant