Summary
m04_enum_match_this and k06_enum_backed_match compile successfully in some runs and fail LLVM
module verification in others — on the same commit, same image, same source:
PHP Fatal error: Uncaught RuntimeException: Module verification failed due to
PHI node entries do not match predecessors!
The determining factor appears to be the helper-runtime cache state, not the code.
Evidence
Two full differential sweeps, both cold-started, both on master around a279902fc:
sweep A: ok m04_enum_match_this.php (3/3 runs) ok k06_... (3/3 runs)
sweep B: COMPILE m04_enum_match_this.php COMPILE k06_...
Single-shot compiles of m04 right now return the PHI error at every commit I tested:
a279902fc phi_error=1 dac8065a0 phi_error=1
64d006e75 phi_error=1 c5b12a6b4 phi_error=1
33b43eea8 phi_error=1 e051bd155 phi_error=1
84565e364 phi_error=1 master phi_error=1
Including a279902fc — the commit where sweep A reported ok 3/3. So this is not commit-linked,
and bisecting it is a dead end.
What differs between the runs
Sweep A ran script/aot-smoke.sh first, which warms build/helper-runtime-cache with units emitted
during that run. Sweep B (and my single-shot checks) ran against a cache in a different state.
I tried to pin it to committed-prelinked-vs-freshly-emitted units and that hypothesis was
refuted — with PHP_COMPILER_HELPER_RUNTIME_CACHE_DIR pointed at a fresh temp dir, both paths
fail:
A: committed prelinked units phi_errors=1, no binary
B: after emit-helper-runtime-object.php phi_errors=1, no binary
So the cache state matters, but "which tier of units" is not the whole story, and I would rather say
that than guess further.
Why this is worth its own issue
- A compile outcome that depends on cache state is a correctness problem, independent of the
enum bug underneath it. The same source must compile the same way.
- It makes the sweep an unreliable gate for these cases — they can land in the failing set or
not depending on cache history, which is exactly the class of noise that produces phantom
regressions. I hit this: two of my baselines disagreed on these two cases and I initially read it
as a same-day regression.
#24163 is closed with these cases red. They currently fail on master.
Suggested next step
Dump the IR for the failing function under both cache states and diff it — the PHI node with
mismatched predecessors should be identifiable, and whether its predecessor set differs by cache
tier would say whether this is a lowering bug exposed by unit selection or a unit-linking bug.
Environment: php-compiler:22.04-dev, PHP 8.2.32, LLVM 9, master 235e9d7f2. Cases:
test/differential/cases/m04_enum_match_this.php, k06_enum_backed_match.php.
Summary
m04_enum_match_thisandk06_enum_backed_matchcompile successfully in some runs and fail LLVMmodule verification in others — on the same commit, same image, same source:
The determining factor appears to be the helper-runtime cache state, not the code.
Evidence
Two full differential sweeps, both cold-started, both on master around
a279902fc:Single-shot compiles of
m04right now return the PHI error at every commit I tested:Including
a279902fc— the commit where sweep A reportedok 3/3. So this is not commit-linked,and bisecting it is a dead end.
What differs between the runs
Sweep A ran
script/aot-smoke.shfirst, which warmsbuild/helper-runtime-cachewith units emittedduring that run. Sweep B (and my single-shot checks) ran against a cache in a different state.
I tried to pin it to committed-prelinked-vs-freshly-emitted units and that hypothesis was
refuted — with
PHP_COMPILER_HELPER_RUNTIME_CACHE_DIRpointed at a fresh temp dir, both pathsfail:
So the cache state matters, but "which tier of units" is not the whole story, and I would rather say
that than guess further.
Why this is worth its own issue
enum bug underneath it. The same source must compile the same way.
not depending on cache history, which is exactly the class of noise that produces phantom
regressions. I hit this: two of my baselines disagreed on these two cases and I initially read it
as a same-day regression.
#24163is closed with these cases red. They currently fail on master.Suggested next step
Dump the IR for the failing function under both cache states and diff it — the PHI node with
mismatched predecessors should be identifiable, and whether its predecessor set differs by cache
tier would say whether this is a lowering bug exposed by unit selection or a unit-linking bug.
Environment:
php-compiler:22.04-dev, PHP 8.2.32, LLVM 9, master235e9d7f2. Cases:test/differential/cases/m04_enum_match_this.php,k06_enum_backed_match.php.