Skip to content

php-in-php: drop UserScriptAotDeferNestedJit from JitStatPathKernel — thin libc via isThinStandaloneAotMain (#1492) #20086

Closed

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, follow #20028 rename / #20034 nextafter / #20011 bin2hex)

Problem

ext/standard/JitStatPathKernel.php still gates user-script standalone AOT path predicates (file_exists / is_file / is_dir / …) through UserScriptAotDeferNestedJit::shouldDefer() → inline JitStatKernel libc. #20028 / #20034 proved the same thin path can use Context::isThinStandaloneAotMain() (no defer class) while embed keeps NestedJIT → StatPathJitHelper PHP.

Mode Today Target
Thin standalone AOT UserScriptAotDeferNestedJit → libc isThinStandaloneAotMain() → JitStatKernel libc
Embed / non-thin StatPathJitHelper NestedJIT unchanged

php-src reference

PHP implementation target

  • ext/standard/JitStatPathKernel.php — replace UserScriptAotDeferNestedJit::shouldDefer with $context->isThinStandaloneAotMain(); delete defer import
  • test/unit/StatPathRuntimeShrinkTest.php — assert no UserScriptAotDeferNestedJit; thin gate uses isThinStandaloneAotMain

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/StatPathRuntimeShrinkTest.php
vendor/bin/phpunit test/unit/FilemtimeBuiltinTest.php test/unit/FilesizeBuiltinTest.php test/unit/FiletypeBuiltinTest.php
make bootstrap-selfhost-vm-driver-execute-probe
'

Done when

  • UserScriptAotDeferNestedJit removed from JitStatPathKernel
  • Thin path uses isThinStandaloneAotMain() + JitStatKernel libc
  • Embed path still StatPathJitHelper NestedJIT
  • StatPathRuntimeShrinkTest + related file-stat unit tests green
  • make bootstrap-selfhost-vm-driver-execute-probe green
  • PR body cites lines removed / defer gate deleted

Refs #1492, #19849, #20028, #20034, #9112

Activity

  1. added
    enhancementNew feature or request
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 17, 2026
  2. PurHur commented on Jul 17, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — starting this run.

    Pillar 1 (this host):

    • make bootstrap-selfhost-link → OK /compiler/build/selfhost
    • php script/bootstrap-inventory.php --check → OK 5441/5441
    • make bootstrap-selfhost-helloworld → OK (Hello World, emit_path=native)
    • ./script/release-readiness.sh --json → still running (north-star5-verify --fast in progress); inventory/link/helloworld green

    Plan: replace UserScriptAotDeferNestedJit::shouldDefer in JitStatPathKernel::implementPathBoolBridge with $context->isThinStandaloneAotMain() (#20028 / #20034 shape); update StatPathRuntimeShrinkTest.

  3. PurHur commented on Jul 17, 2026

    @PurHur
    OwnerAuthor

    Merged via #20088

    Verification:

    • StatPathRuntimeShrinkTest OK (no UserScriptAotDeferNestedJit; asserts isThinStandaloneAotMain)
    • AOT user-script smoke: file_exists/is_file/is_dir/is_readable → exists1/file1/dir1/r1
    • bootstrap-selfhost-vm-driver-execute-probe OK

    Shrink: deleted NestedJit defer gate from JitStatPathKernel; thin path uses isThinStandaloneAotMain() + JitStatKernel libc (embed unchanged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions