Skip to content

AOT: localize cached-unit declaration types + call-site-lazy sprintf link; workflow skills (#15642, #15889)#16965

Merged
PurHur merged 3 commits into
masterfrom
fix/15642-sprintf-cache
Jul 6, 2026
Merged

AOT: localize cached-unit declaration types + call-site-lazy sprintf link; workflow skills (#15642, #15889)#16965
PurHur merged 3 commits into
masterfrom
fix/15642-sprintf-cache

Conversation

@PurHur

@PurHur PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Cache-machinery fixes

Hygiene

Spine sync 4181/4182 (3 new fleet DOM files) + honest sidecar refresh (d8ba2365). M5 fast green, AOT smoke green cache-on/off, unit sweep 119 fresh / 0 failed.

Skills (workflow documentation)

  • phpc-verify: PHP_COMPILER_LLVM_ASSERT=1 debugging recipe (segfault → PHP backtrace), gdb fallback, bundle-failure breadcrumbs, battery babysitter, gate-order note, the ->value vs loadValue() bug shape.
  • phpc-fix-loop: merge-race protocol (local resolution, --theirs on generated, spine uniq -d, push-verify, single-sequence merge), worktree-docker .git mount, vendor-patch shipping rules.
  • phpc-selfhost: spine-sync flags, duplicate-entry check, the honest deferral workflow.
  • NEW phpc-helper-cache: the split-compilation cache end-to-end (commands, fingerprints, debugging, sharp edges).
  • phpc-setup: committed cold-start caches, worktree/cwd traps.

🤖 Generated with Claude Code

anmichels and others added 3 commits July 6, 2026 18:48
…link; document workflows in skills (#15642, #15889).

Cache-machinery fixes (each independently load-bearing):

- HelperRuntimeCache::tryProvide rebuilds extern declaration types
  against the LOCAL context's named structs. LLVM re-suffixes named
  structs on bitcode parse (__string__ -> __string__.12) and suffixed
  declaration types fail module verify at every call site — a latent
  correctness bug for ANY consumer whose module defines the structs
  before binding (getStringFromType cannot stringify suffixed structs,
  so the fallback read struct names via LLVMGetStructName).
- StringFormat gains implementIfDeclared(): user-standalone builds
  skip ensureLinked at init (#13571), so printf()/sprintf()/
  number_format() died at link with undefined __compiler_sprintf
  (#15642). JitSprintf::format now links on first call-site lowering
  (builder insert-point saved/restored), and ensureJitHelperCompiled
  consults the helper cache first — with PHP_COMPILER_HELPER_RUNTIME_O=1
  the corpus binds as externs instead of a nested compile that OOMs a
  default-memory build. Remaining gap: cached units lack their init
  chains, so the sprintf unit crashes at runtime in user builds until
  per-unit llvm.global_ctors lands (epic #16075 step 4/5) — the link
  error is fixed, the runtime story is documented on #15642.
- PackArgvSerialize memcpy calls adapt to WHATEVER signature the module
  already declares (main-script i8* vs runtime void* ordering flip).

Spine sync to 4181/4182 (3 new fleet DOM files) + sidecar refresh
(stamp d8ba2365). M5 fast green, AOT smoke green cache-on and -off,
full unit sweep 119 fresh / 0 failed.

Skills: phpc-verify gains the LLVM-assert debugging recipe, battery
babysitter, and gate-order notes; phpc-fix-loop gains merge-race
protocol, worktree-docker and vendor-patch guidance; phpc-selfhost
gains spine-sync flags, dedup check, and the deferral workflow; new
phpc-helper-cache skill documents the split-compilation cache
end-to-end; phpc-setup documents the committed cold-start caches.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PurHur PurHur merged commit 4bad85d into master Jul 6, 2026
1 check failed
@PurHur PurHur deleted the fix/15642-sprintf-cache branch July 6, 2026 16:51
PurHur added a commit that referenced this pull request Jul 6, 2026
…16972)

Spine entry SHA drifted after #16964/#16965 require_once additions;
sync prelinked stamp/manifest and roadmap footnotes so ci-fast spine
gates pass without auto-heal.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.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