Skip to content

JIT: shape-aware nested Variable writes + class-const autoload/case fixes (#16565 round 2) - #16933

Merged
PurHur merged 1 commit into
masterfrom
fix/16565-round2
Jul 6, 2026
Merged

PurHur merged 1 commit into
masterfrom
fix/16565-round2

Conversation

@PurHur

@PurHur PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Six more helper-runtime units unlocked, each found in minutes via the PHP_COMPILER_LLVM_ASSERT=1 patch (now extended with a zExt operand assert):

  • VariableWriteNested (Variable::int/bool/float/string/array nested lowerings) blindly zExt(loadValue(...)): box-backed args yielded %__value__ structs handed to i64/i8/double params — module verify failures in Sprintf/FilterBatch/ClassUses*/GetClassMethods units. Now shape-aware (boxed → __value__read* accessors; native → width-adjust; bool via JitValueBox::writeBool direct stores, dodging the __value__writeBool signature drift).
  • JitSprintf::writeArg — same class, fixed at both the TYPE_VALUE case and mistyped box-backed native args.
  • Class-const native fallback now autoloads (Zend parity) with original-case name hints threaded from call sites (registry names are lowercased → PSR-4 miss) — unlocks SleepJitHelper.

Unit ledger since session start: segfaults 17 → 0, misc verify/type errors 6 → 2 (Opendir return-type inference, ScopeBuiltin null ARG_SEND operand — precise repros captured for follow-up), remainder = the known corpus-dependency class.

Also observed (pre-existing, baseline reproduces): user-build printf/sprintf linking fails with undefined __compiler_printf — separate #15642-class gap.

Verified: AOT smoke green · LateStatic 3/3 · M5 fast green · inventory + generated docs clean.

🤖 Generated with Claude Code

…ixes; zExt assert (#16565 round 2).

Six more helper-runtime units unlocked, found via the LLVM assert patch:

- VariableWriteNested (Variable::int/bool/float/string/array in nested
  helpers) blindly zExt'd loadValue() results: box-backed args
  (TYPE_VALUE or __value__ storage) yielded %__value__ structs handed
  to i64/i8/double parameters — module verify failures in Sprintf,
  FilterBatch, ClassUses*, GetClassMethods units. Now shape-aware:
  boxed args read through __value__read* accessors, native args
  width-adjust; bool writes via JitValueBox::writeBool direct field
  stores (the __value__writeBool symbol signature drifts between
  modules).
- JitSprintf::writeArg: same class — TYPE_VALUE case now uses
  valuePtrFromVariable (not loadValue), and mistyped box-backed
  native args copy the box.
- Class-const native fallback (tryJitNativeClassConstant) now
  autoloads like Zend does — the registry name is lowercased which
  breaks PSR-4, so callers thread the original-case literal as a hint
  (unlocks SleepJitHelper: VmSleepPure::PAST_TIMESTAMP_WARNING).
- patches/php-llvm-structgep-assert.patch gains a zExt operand-kind
  assert (found VariableWriteNested in one run).

Unit ledger: 47 disabled units at session start -> segfaults 17 -> 0;
misc errors 6 -> 2 (Opendir return-type inference, ScopeBuiltin null
ARG_SEND operand — precise repros captured); remainder are the known
corpus-dependency class. Note: user-build sprintf linking
(__compiler_printf undefined) is broken on master baseline — separate
pre-existing #15642-class gap.

Verified: AOT smoke green, LateStatic tests 3/3, M5 fast green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PurHur
PurHur merged commit 4d51ec4 into master Jul 6, 2026
@PurHur
PurHur deleted the fix/16565-round2 branch July 6, 2026 14:08
PurHur added a commit that referenced this pull request Jul 6, 2026
… follow-up). (#16934)

Docs: inventory/profile regen after VariableWriteNested helpers (#16933 follow-up).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
PurHur added a commit that referenced this pull request Jul 6, 2026
…16881/#16933 fixes. (#16940)

10 more units cached (Sleep, Unlink, Rmdir, Rename, Sprintf,
FilterBatch, ClassUses, ClassUsesRecursive, GetClassMethods + late-
static class). 38 remaining: 36 corpus-dependency (extern class-method
binding, epic #16075), Opendir return-type inference, ScopeBuiltin
null ARG_SEND operand. AOT smoke green with the cache on.

Co-authored-by: PurHur <tedyyyyy@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants