Skip to content

[codegen] In-process LLVM backend fails the 5 biggest Next App Route modules on current main (silent per-module failure; regression in 3c95020f8..07c8040bf) #8228

Description

@proggeramlug

Symptom

On current main-equivalent (07c8040bf, perry-dev profile), compiling the pinned production Next App Route fixture (tests/release/packages/next-app-route/, 104 modules) with the in-process LLVM backend — the default whenever PERRY_LLVM_INPROCESS is unset, i.e. what fixture.sh step [5/7] runs — fails deterministically:

✗ 5 module(s) failed to compile — REFUSING TO LINK
  - .next/server/chunks/2.js
  - .next/server/chunks/430.js
  - node_modules/next/dist/compiled/jsonwebtoken/index.js
  - node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js
  - node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js

Those are the app's 5 biggest modules (the 4 that "run exclusively to cap peak memory" plus jsonwebtoken). Reproduced 5/5 times on the bench mini (macOS 26.5.1 arm64, 8 GB, LLVM 22.1.8): four full fixture.sh runs (with PERRY_MODULE_JOBS=2 and both PERRY_CODEGEN_UNIT_JOBS=2 and =1) and one bare compile:

cd tests/release/packages/next-app-route
PERRY_MODULE_JOBS=2 PERRY_CODEGEN_UNIT_JOBS=1 PERRY_RUNTIME_DIR=<provider release dir> \
  perry compile perry-host.js --output-type dylib --no-auto-optimize --no-cache -o /tmp/app.dylib
# exit 1

Two aggravating details

  1. No per-module error text is emitted. The failure summary says "Fix the codegen errors above (search for Error compiling module)" — but no such line exists anywhere in the output (grepped the full logs). The modules visibly make progress (LLVM unit 1/10 finished, froze 3/10 units, the fix(next): pass production App Route dylib gate #8082 RS4GC-optnone fallback fires for perry_closure_…app_page_runtime_prod_js__5118) and then are reported failed with nothing to act on. Whatever fails should say what failed.
  2. It is a fresh regression. The untouched fixture.sh compiled the same app clean, in-process, on this same box earlier today at 3c95020f8 (the [Next.js/dylib] Forced-evacuation App Route arm: stale closure from a holder outside the GC heap #8163 validation runs, and [Next.js/dylib] Full production App Route compatibility tracker #8040's DoD audit — 500 serving batches). The window is 3c95020f8..07c8040bf; commits touching codegen in it: perf(codegen): decide scalar parameter descriptors with the typed-abi leaf guards #8201 (scalar parameter descriptors via typed-abi leaf guards), perf(gc, codegen): recover the instruction cost of the 56 B → 48 B header shrink (#8122) #8204 (recover the 56→48 B header-shrink instruction cost), gc: verify GC_STORE_AUDIT claims against emitted IR and source structure, not comments (#8185) #8206 (verify GC_STORE_AUDIT claims against emitted IR).

PERRY_LLVM_INPROCESS=0 (external clang/opt — the configuration tests/test_next_app_route_dylib.sh pins) compiles all 104 modules clean at the same commit on the same box, and the resulting app serves. So the release-tier fixture and anything else on the in-process default is blocked, while the external-backend path is fine.

Evidence on the bench mini

  • ~/perry-bench.noindex/tmp-8040-knob/probe-inprocess.log — bare-compile repro (exit 1, full output).
  • ~/perry-bench.noindex/tmp-8040-knob/fixture-v2.log, fixture-v10.log, fixture-v10-diag.log, rerun-v2.log — four fixture.sh failures (FAIL next-app-route — Perry dylib compile failed). Note: in three of these the process also died without printing the refusing-to-link summary at all.
  • ~/perry-bench.noindex/tmp-8040-knob/ext-v2.log — same fixture, same commit, PERRY_LLVM_INPROCESS=0: compile clean, PASS next-app-route (20 batches, …).

Found while validating #8209/#8210; the serving-side results there are unaffected (validated on the external backend).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions