Category
regression · AOT build-breaking (all scripts)
Problem
Since d17f1732d (#15866, 2026-07-04 06:57) every phpc build — including examples/000-HelloWorld and an empty script — dies with Module verification failed in compileCommon. The fast gate cannot see it (no LLVM build step), so it survived several hours and ~40 merges.
Two distinct layers:
1. Four miscasts in the new GC bridges (diagnosed via PHP_COMPILER_DUMP_IR=1):
| Site |
Bug |
Fix |
llvmRegistryDestructInvoked |
trunc i1→i8 (invalid: DestTy too big) |
zext |
llvmRegistryObjectPtr |
pointerCast on i64 → addrspacecast i64→i8* |
intToPtr |
implementGcRegisterPhpBridge |
pointerCast(ptr→i64) |
ptrToInt |
implementGcRegisterPhpBridge |
raw i32 propCount into appendObject(i64,i64) |
sext |
2. Deeper: the helper PHP bodies land on every build path. With the four casts fixed, verification still fails inside the nested lowering of GcCollectCyclesRegistryJitHelper.php itself: phi i64/i32 clash in incdec_null_coerce, __value__writeHashtable(%__value__*, %__value__*) vs %__hashtable__* param, ret i64 vs declared i32. These are pre-existing #15642-class lowering bugs in ++/array-write shapes — #15866 put a helper exercising them into every module.
Action taken
d17f1732d reverted in the #15619 green-master sync PR (with spine/inventory resync for the deleted GcDestructAllowDelrefJitHelper.php). Re-land #15866 only when: the four casts above are applied AND the registry helper PHP avoids (or #15642 fixes) the incdec/array-write lowerings — and add an AOT hello-world build to the fast gate so build-breaking commits cannot survive again (single phpc build ≈ 3 s in Docker).
Repro (at d17f173..head before revert)
./script/docker-exec.sh -- bash -lc "./phpc build -o /tmp/h examples/000-HelloWorld/example.php"
Done when
Category
regression· AOT build-breaking (all scripts)Problem
Since
d17f1732d(#15866, 2026-07-04 06:57) everyphpc build— includingexamples/000-HelloWorldand an empty script — dies withModule verification failedincompileCommon. The fast gate cannot see it (no LLVM build step), so it survived several hours and ~40 merges.Two distinct layers:
1. Four miscasts in the new GC bridges (diagnosed via
PHP_COMPILER_DUMP_IR=1):llvmRegistryDestructInvokedtrunc i1→i8(invalid: DestTy too big)zextllvmRegistryObjectPtrpointerCaston i64 →addrspacecast i64→i8*intToPtrimplementGcRegisterPhpBridgepointerCast(ptr→i64)ptrToIntimplementGcRegisterPhpBridgeappendObject(i64,i64)sext2. Deeper: the helper PHP bodies land on every build path. With the four casts fixed, verification still fails inside the nested lowering of
GcCollectCyclesRegistryJitHelper.phpitself:phi i64/i32clash inincdec_null_coerce,__value__writeHashtable(%__value__*, %__value__*)vs%__hashtable__*param,ret i64vs declaredi32. These are pre-existing #15642-class lowering bugs in++/array-write shapes — #15866 put a helper exercising them into every module.Action taken
d17f1732dreverted in the #15619 green-master sync PR (with spine/inventory resync for the deletedGcDestructAllowDelrefJitHelper.php). Re-land #15866 only when: the four casts above are applied AND the registry helper PHP avoids (or #15642 fixes) the incdec/array-write lowerings — and add an AOT hello-world build to the fast gate so build-breaking commits cannot survive again (singlephpc build≈ 3 s in Docker).Repro (at d17f173..head before revert)
./script/docker-exec.sh -- bash -lc "./phpc build -o /tmp/h examples/000-HelloWorld/example.php"Done when
phpc buildgreen for hello + gc scripts, VM parity