Skip to content

php-in-php: route session_create_id JIT through VmSession PHP (#9500) - #10861

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-session-create-id
Jun 23, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-session-create-id

Conversation

@PurHur

@PurHur PurHur commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add ext/standard/SessionCreateIdJitHelper.php delegating to VmSession::createId() (php-src ext/session/session.c)
  • Shrink lib/JIT/Builtin/SessionCreateIdRuntime.php from 287 → 235 LOC: delete hex-table / __compiler_random_bytes LLVM entropy loop; keep thin ABI bridges only
  • Add SessionCreateIdRuntimeShrinkTest + spine require_once for self-host

Closes #9500

C runtime shrink

No new runtime/*.c symbols. Removed ~80 lines of hand-maintained LLVM ID generation (hex encode loop, HEX_TABLE global).

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit --filter SessionCreateIdRuntimeShrinkTest
vendor/bin/phpunit --filter session_create_id test/compliance/
php bin/vm.php test/compliance/cases/stdlib/session_create_id_jit.phpt
php bin/jit.php test/compliance/cases/stdlib/session_create_id_jit.phpt
'
make bootstrap-selfhost-vm-driver-execute-probe
php script/check-selfhost-spine-coverage-sync.php

Output:

OK (3 tests, 12 assertions)          # SessionCreateIdRuntimeShrinkTest
OK (4 tests, 4 assertions)          # compliance session_create_id*
idok / prefixed                     # VM + JIT phpt
bootstrap-selfhost-vm-driver-execute-probe: OK
check-selfhost-spine-coverage-sync: OK

Made with Cursor

Replace hex-table/random-bytes LLVM in SessionCreateIdRuntime with
SessionCreateIdJitHelper delegating to VmSession::createId; net −52 LOC LLVM.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit c779c7f into master Jun 23, 2026
@PurHur
PurHur deleted the agent/runtime-php-session-create-id branch June 23, 2026 15:59
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: JIT SessionCreateIdRuntime — route session_create_id() through VmSession PHP not LLVM (#1492)

1 participant