Category
php-in-php · runtime-shrink · Pillar Trust (#32122 .1 mint class)
Problem
Context::ensureFullStandaloneBodies still eagerly calls StringRandomBytes::implement($this), NestedJIT-linking __compiler_random_bytes on every full standalone init.
Call sites already ensure before lookup:
Leftover Context NestedJIT vs Runtime ABI drift mints random_bytes.1 (#31894 / #32122). Peer ensureMinimal drop already removed RandomBytes from ensureMinimalUserStandaloneBodies (#34578).
php-src reference
PHP implementation target
lib/JIT/Context.php — remove StringRandomBytes::implement($this) from ensureFullStandaloneBodies; document lazy call sites
- Keep
StringRandomBytes::ensureLinked / implement callable from JitRandomBytes / ArrayRand / SessionCreateId
- No new
lib/AOT/runtime/*.c
Repro
./script/aot-smoke.sh
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/rb.bin -r "echo bin2hex(random_bytes(4));" && /tmp/rb.bin'
./script/phpunit.sh --filter ContextFullStandaloneLazyRandomBytesShrinkTest
Done when
Parent
Category
php-in-php· runtime-shrink · Pillar Trust (#32122.1mint class)Problem
Context::ensureFullStandaloneBodiesstill eagerly callsStringRandomBytes::implement($this), NestedJIT-linking__compiler_random_byteson every full standalone init.Call sites already ensure before lookup:
ext/standard/JitRandomBytes.php—StringRandomBytes::ensureLinked(php-in-php: drop Type::initialize always-on openssl/hash/json/libcrypt/password/random_bytes ensureLinked — lazy Jit* ABI (peer #34327) #34332)lib/JIT/ArrayRandLlvm.php—StringRandomBytes::ensureLinkedlib/JIT/Builtin/SessionCreateIdRuntime.php—StringRandomBytes::ensureLinkedLeftover Context NestedJIT vs Runtime ABI drift mints
random_bytes.1(#31894 / #32122). Peer ensureMinimal drop already removed RandomBytes fromensureMinimalUserStandaloneBodies(#34578).php-src reference
ext/standard/random.c—php_random_bytes()/PHP_FUNCTION(random_bytes)PHP implementation target
lib/JIT/Context.php— removeStringRandomBytes::implement($this)fromensureFullStandaloneBodies; document lazy call sitesStringRandomBytes::ensureLinked/implementcallable from JitRandomBytes / ArrayRand / SessionCreateIdlib/AOT/runtime/*.cRepro
./script/aot-smoke.sh ./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/rb.bin -r "echo bin2hex(random_bytes(4));" && /tmp/rb.bin' ./script/phpunit.sh --filter ContextFullStandaloneLazyRandomBytesShrinkTestDone when
ensureFullStandaloneBodiesdoes not callStringRandomBytes::implement/ensureStandaloneBodiesrandom_bytes(4)still produces 8 hex chars (call-site ensureLinked)./script/aot-smoke.shstays 8/8lib/AOT/runtime/*.cParent
.1mint · peer php-in-php: drop Context ensureMinimalUserStandaloneBodies always-on stdlib NestedJIT batch — lazy Jit* ABI (peer #34566) #34578 / php-in-php: lazy StringJsonEncode/Decode + ScalarDim/StringOffset from ensureFullStandaloneBodies (Context.php) #35065 / php-in-php: lazy Utf8Latin1/RewriteVars/Define/Strspn/FileGetContents/Readfile from ensureFullStandaloneBodies (Context.php) #35089