Skip to content

REGRESSION: e30_array_lit_dim_assign_shift no longer compiles — HashTable::shiftFirst() unresolved #24025

Closed

Description

@PurHur

Summary

test/differential/cases/e30_array_lit_dim_assign_shift.php no longer compiles under AOT:

Call to undefined method PHPCompiler\VM\HashTable::shiftfirst()

It was passing in this session's earlier baseline (it is absent from the 15-case failing set
recorded in test/differential/AOT-BASELINE.md at 96ddddeb1).

Same shape as #23974

That issue covered HashTable::sliceCopy() and HashTable::iterateKeyed() reported as undefined
while existing in lib/VM/HashTable.php — a registration problem, not missing implementations.
Worth checking whether shiftFirst is the same:

grep -n 'function shiftFirst' lib/VM/HashTable.php

If it exists there, this is the same defect resurfacing on a third method, and #24013's fix for
#23974 may have covered only the two methods named in that issue rather than the underlying
registration path.

Note the name arrives lowercased (shiftfirst) — as established on #23974, that is the error
path's display fallback ($class->methodNames[$methodLc] ?? $methodLc), not evidence of a
case-normalisation bug.

Candidate range

Between the two measurements: 96ddddeb1..556c97d1d.

Environment: php-compiler:22.04-dev, PHP 8.2.32, LLVM 9, master 556c97d1d.

Activity

  1. added
    bugSomething isn't working
    phase-3:aotPhase 3 – AOT deployment
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 27, 2026
  2. PurHur commented on Jul 27, 2026

    @PurHur
    OwnerAuthor

    claim: worker-lane-B — starting this run

    Gate snapshot (pre-claim):

  3. PurHur commented on Jul 28, 2026

    @PurHur
    OwnerAuthor

    Confirmed: the method exists — this is registration, same as #23974

    lib/VM/HashTable.php:783:    public function shiftFirst(): ?Variable
    

    Present and public. So HashTable::shiftfirst() being "undefined" at build time is the third
    instance of the pattern from #23974, where sliceCopy() and iterateKeyed() were likewise present
    in source but unresolved for AOT.

    That makes it likely #24013's fix addressed the two methods named in #23974 rather than whatever
    registration path lets a HashTable method be resolved at all. Worth checking how those two were
    made visible and whether the same treatment generalises — otherwise the next HashTable method a
    case happens to reach will fail the same way.

    The lowercased name (shiftfirst) is, as established on #23974, the error path's display fallback
    ($class->methodNames[$methodLc] ?? $methodLc) rather than a case-normalisation bug — mentioning
    it again only so nobody re-chases it.

  4. PurHur commented on Jul 28, 2026

    @PurHur
    OwnerAuthor

    claim: worker-lane-B — continuing (no PR yet; implementing NestedJIT HashTable::shiftFirst registration, same pattern as #23974 sliceCopy/iterateKeyed)

    Gate snapshot:

    • user_release_ready: yes, north-star5-fast: ok, inventory OK 6598/6598
    • gen-0 seed still stale (known; not this issue)
  5. PurHur commented on Jul 28, 2026

    @PurHur
    OwnerAuthor

    claim: worker-lane-B — continuing this run (workspace already on agent/issue-24025-hashtable-shiftfirst)

    Gate snapshot:

    • user_release_ready: yes, north-star5-fast: ok, inventory OK 6598/6598
    • WIP: NestedJIT shiftfirst → HashTableShiftFirst, ArrayShiftJitHelper empty via getNumElements, spine require + unit assert
    • Next: AOT repro for e30_array_lit_dim_assign_shift + unit test
  6. PurHur commented on Jul 28, 2026

    @PurHur
    OwnerAuthor

    Merged #24046

    Fixed: AOT compile of e30_array_lit_dim_assign_shift — HashTable::shiftFirst NestedJIT registration + HashTableShiftLlvm inline emit (was Call to undefined method …::shiftfirst()).

    Verified: e30 compiles; empty/non-empty array_shift AOT matches Zend; VM e30 differential OK; unit filters green; inventory 6600/6600.

    Still open for full e30 AOT differential: master json_encode AOT segfaults even on json_encode(1); array-literal capture of $a after in-literal mutations can still be empty (#23990 was VM-only). Separate from the shiftFirst resolution gap.

  7. PurHur commented on Jul 28, 2026

    @PurHur
    OwnerAuthor

    Lane B note: #24025 closed by #24046 before this run's PR (#24048) could merge — closed #24048 as duplicate.

    Gate snapshot from this run (before noticing #24046):

    • user_release_ready: yes, north-star5-fast: ok, inventory OK
    • e30 AOT compile green after HashTableShiftFirst WIP; semantic shift without json_encode matched Zend (99 then 2,3)
    • json_encode(1) AOT segfaults on master (independent; not this issue)
  8. PurHur commented on Jul 28, 2026

    @PurHur
    OwnerAuthor

    Confirmed fixed — shiftFirst resolves now

    e30_array_lit_dim_assign_shift.php compiles on f51d0b180. The
    Call to undefined method PHPCompiler\VM\HashTable::shiftfirst() error is gone, so #24046 resolved
    what this issue reported.

    The case still fails, at a later stage

    It now segfaults at runtime:

    zend: [99,99,[2,3]]
    aot : phpc: fatal signal (segfault) after c:main_before_php
    
    0/5 runs matched
    

    Deterministic, not intermittent. Filing separately rather than reopening — the registration defect
    this issue is about is genuinely fixed, and a runtime segfault in the same case is a different
    problem that would only be confused by sharing a title.

    This is the fourth time today a fix in this area has moved a failure to a later stage rather than
    eliminating it (#23792, #23815, #23911, and now this). Not a criticism — each fix was correct and
    exposed the next link. Worth knowing when reading "case still red" that it may mean progress.

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 / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-3:aotPhase 3 – AOT deployment

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions