Tempest, compiled ahead of time.
Tempest 3.16.2 · 20 source + 0 vendor + 1 runtime patches · real Tempest HTTP pipeline · finite web AOT profile
An experimental port that compiles a pinned Tempest 3.x checkout into a finite native elephc web binary while keeping every rewrite required by the verified request graph in a reviewable patch corpus.
Important
This is a narrow AOT web profile, not complete Tempest compatibility and not a production-ready application.
- Upstream
tempestphp/tempest-framework, branch3.x, releasev3.16.2(commita14f676369) is the pinned baseline. Tempest sources stay byte-identical to that import in a fresh checkout. - Compiler compatibility rewrites live in an explicit, file-level patch corpus: 20 Tempest source patches, no Composer dependency patches, and 1 isolated runtime Composer patch. Every patch has one target, original and patched blob hashes, and a path mirroring its target. Application is idempotent; a divergent file stops the process.
- The minimum corpus was revalidated against Elephc main commit
605fb1d78c(crate version0.27.0). It contains only files reached by the finite web entry point. Removed framework-wide patches are not a claim of complete Tempest compatibility. - The profile targets PHP 8.5 and is compiled with
--php-version 8.5 --web. The build refuses to run unless the complete patch series is applied. - A real request runs through Tempest's
HttpApplication,GenericRouter,MatchRouteMiddleware,GenericRouteMatcher, route model, controllers, and response classes. Runtime discovery, reflective dependency injection, and dynamic callable dispatch are replaced by finite AOT adapters. - Verified routes:
/(200HTML),/health(200JSON),/hello/:name(200text),/elephc(302to the Elephc website), and a real404fallback for unknown paths.
ELEPHC_REPO must point to an elephc checkout; the build runs Cargo from that
checkout, so no global elephc executable is involved.
export ELEPHC_REPO=/path/to/elephc
COMPOSER_ROOT_VERSION=3.x-dev composer install
./scripts/apply-elephc-patches.sh
./scripts/build-elephc.sh
./elephc/runtime/server --listen 127.0.0.1:8080 --workers 1Verify the supported behavior:
npm run test:elephc # HTTP checks against the compiled binary
npm run audit:patches # patch corpus integrity
npm run test:clean-room # full install-patch-build-test cycle in a source-only export./scripts/apply-elephc-patches.sh --check reports the applied root source
state without modifying files (the vendor series is now empty).
scripts/build-elephc.sh then installs the isolated runtime Composer graph,
applies its one manifest patch, builds the compiler from a temporary archive of
ELEPHC_REPO, installs the locked PCRE2 native package required by current
Elephc, verifies the object-expression ::class regression probe, and compiles
the web binary. The Elephc checkout itself remains unchanged.
After changing a source patch in an existing checkout, reinstall the mirrored Tempest package while the source patches are applied before rebuilding:
COMPOSER_ROOT_VERSION=3.x-dev composer reinstall tempest/framework \
--working-dir elephc/runtime --no-interaction --prefer-distThe entry point is elephc/runtime/server.php. Its isolated Composer project
mirrors the patched Tempest package instead of symlinking it and disables the
framework's eager autoload.files list with a committed runtime patch. No
synthetic Symfony, Whoops, or PHP internal-type declarations are part of the
compiled graph.
The verified request path is:
elephc worker
-> Tempest\Router\HttpApplication
-> Tempest\Router\GenericRouter
-> Tempest\Router\MatchRouteMiddleware
-> Tempest\Router\Routing\Matching\GenericRouteMatcher
-> AOT controller dispatcher
-> controller with #[Get]
-> Tempest\Http\Response
-> AOT response sender
Bootstrap contains the finite route manifest. The #[Get] attributes remain
on the controller methods, but Elephc does not discover them with runtime
reflection. AotRequest, StaticContainer, AotRouteHandler,
AotResponseSender, and AotKernel are the explicit finite AOT boundary.
The supported profile currently has GET routes, one required string parameter, status/header/body/JSON/redirect responses, HEAD body suppression, and a 404 fallback. Runtime discovery, general reflective DI, arbitrary middleware stacks, views, sessions, cookies, uploaded files, and parsed request input are not claimed as supported.
full-framework.php remains a diagnostic probe for the reflective
FrameworkKernel::boot() path. That path stays open-ended for AOT because
BootDiscovery scans runtime filesystem paths and instantiates classes
reflectively, which elephc cannot enumerate from the request entry point. The
verified profile therefore uses the static manifest instead of claiming full
dynamic compatibility.
After patching, the working tree is an AOT build tree and should not be treated as a normal upstream Tempest checkout.

