Skip to content

Build: helper-unit dedup part B — one shared runtime prologue (common.o), re-emit the 446 committed units, move the 790 MB of objects out of git (re-#36198) (lib/AOT/HelperRuntimeCache.php, script/emit-helper-runtime-object.php) #36246

Description

@PurHur

Category

Foundation: · build architecture · child of #36188 · respin of #36198 (closed by PR #36238, which delivered part A only: per-function .text.<symbol> sections + --gc-sections + -s)

Problem

PR #36238's own summary: "Part B (shared common.o runtime prologue) and helper-cache refresh remain follow-ups — committed prelinked unit.o files still use monolithic .text until re-emitted." So today: every committed unit.o still embeds ~462 duplicate runtime symbols (prelinked/helper-runtime/x86_64-linux/units/ext_ctype_CtypeJitHelper_php/unit.o = 1.65 MB for 2 exported helpers), the cache is 446 units / 790 MB in git (.git 6.6 GB), and --gc-sections can only drop bodies from objects that have per-function sections — i.e. none of the committed ones.

PHP implementation target

  1. Re-emit the helper corpus with AotGcSections active (emit-helper-runtime-object.php --prelink) so the committed units carry .text.<fn> sections; record hello-world size before/after.
  2. Emit the shared runtime (__value__*, __string__*, __hashtable__*, __ref__*, memory manager, GC) once as prelinked/helper-runtime/<arch>/common.o; lower units with those functions as declarations (HelperRuntimeCache::declareExternFromBitcode path); fingerprint common.o with the units; keep the class-id/ABI hazard (emit-helper-runtime-object.php:353-357) in mind.
  3. Publish the per-arch cache as a release tarball fetched by core_fingerprint/llvm_identity_token; keep only manifests in git; offline fallback = local emit.

Done when

  • Median unit.o < 100 KB; hello-world stripped binary < 3 MB; script/aot-smoke.sh byte-identical output; AOT sweep unchanged
  • git ls-files prelinked/helper-runtime | grep -c '\.o$' = 0; fresh clone < 500 MB; cold hello-world build time unchanged after fetch

Activity

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

    MOST IMPORTANTThis are the most important targetsarea:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-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