Hash: scaffold standalone AOT __compiler_hash bridges (#3357)#17897
Hash: scaffold standalone AOT __compiler_hash bridges (#3357)#17897PurHur wants to merge 3 commits into
Conversation
Wire StringHashCrypto into user-script minimal standalone init and route PHP_COMPILER_AOT_USER_SCRIPT builds through JitVmHelperLink bridges instead of nested HashCryptoJitHelper JIT during user compile. Remaining: helper bridge returns null digest at AOT execute — hash_raw_output and hash_context_incremental fixtures still empty (VM/JIT green). Co-authored-by: Cursor <cursoragent@cursor.com>
…ers (#3357) Stop using JitVmHelperLink cached-unit bridges for user-script AOT (unit __init__ skipped under #16075). Detect PHP bridge entry blocks by name so stale LLVM bridge stubs are not treated as complete. AOT hash_raw_output still red — __compiler_hash returns null at execute; next step is replacing orphan LLVM entry blocks or a thin libc digest path. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Progress update (2026-07-11):
Still red: ./script/phpunit.sh --filter 'hash_raw_output|hash_context_incremental'
# hash_raw_output: 0/0 (hash returns false)
# hash_context_incremental: empty stdoutLikely next step: when a stale |
Delegate digest helpers to VmHashNative directly (php-src ext/hash parity). Document AOT blocker: nested JIT of HashCryptoJitHelper emits null digest because VmHashNative::hash is not lowered; VmHashNative precompile segfaults LLVM. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Maintainer triage 2026-07-12: not merge-ready — PR body documents AOT digest still empty ( |
|
Maintainer triage 2026-07-13: PR still merge-conflicting and body notes AOT digest still empty — holding merge. Rebase when |
Summary
Scaffolds the missing standalone-AOT path for
hash()/hash_hmac()/ incrementalhash_final()digest emission (#3357).Root cause (diagnosed):
__compiler_hashABI stubs fromlib/JIT/Builtin/Type.phpnever received bodies duringPHP_COMPILER_AOT_USER_SCRIPT=1init becauseStringHashCryptowas absent fromensureMinimalUserStandaloneBodies()and nestedHashCryptoJitHelperJIT is deferred for user-script AOT (#16734).Changes
StringHashCryptoLlvm— thinJitVmHelperLink::ensureBridgewrappers for__compiler_hash*ABIsStringHashCryptoJit—UserScriptAotDeferNestedJitgate → LLVM bridges vs PHP helper pathContext::ensureMinimalUserStandaloneBodies()— link hash crypto during user-script standalone initStringHashCryptoPhp::callHelperBridge—extractStringPtrFromHelperResultfor non-defer buildsphp-src ref:
ext/hash/hash.c,ext/standard/hash.cVerification (2026-07-11)
Next step:
JitVmHelperLinkbridge calls cachedHashCryptoJitHelperunit butcoerceBridgeResult/ helper link returns null__string__*at execute. Bisect helper.olink + bridge return coercion (restored pre-#9164StringHashCryptoNativeJitemits wrong digests and segfaults on hash_context).Partial progress toward #3357 — not merge-ready.
Closes #3357 when
hash_raw_output+hash_context_incrementalAOT fixtures green.Made with Cursor