You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The split native codegen-unit path cannot materialize the relocatable ptrtoint constant expression that every non-entry JS module uses to pass its __init_body function pointer through the integer-valued runtime ABI.
This blocks production-sized webpack graphs before application code can run.
The whole-module text path accepts the same IR because LLVM parses the constant
expression itself; the in-process native dialect reader instead feeds the full
expression to the integer literal parser.
Exact reproduction
Base: fe0d4979204dfd6b8b166320e1ebdd2318f30518 (current main after #8044)
Using the pinned Next.js 16.3.0 webpack production route graph from #8034,
compiled as an app-only dylib with native split units:
perry compile --no-cache --no-auto-optimize --output-type dylib perry-host.js -o next-app-route.dylib
Perry collects 91 modules and reaches native codegen, then independently fails
all four large split modules, including the generated next/dist/compiled/next-server/app-route.runtime.prod.js:
native codegen unit ... failed: ...
bad integer `ptrtoint (ptr @<module-prefix>__init_body to i64)`
Perry correctly refuses to link the incomplete dylib (87/91 modules emitted).
Minimal compiler-level reproduction
Define two functions in an LlModule: an __init_body, and an __init wrapper
whose runtime call uses this operand:
i64ptrtoint (ptr@fixture_js__init_bodytoi64)
Then invoke compile_module_units_native(..., 2, ...). This forces independent
native construction and object emission followed by the real partial-link path.
Before the fix it reaches i128::parse and fails with bad integer; a parse-only
or textual-backend test does not reproduce the defect.
Acceptance
The focused two-unit emitted-object/link regression passes.
The exact production graph gets past these four ptrtoint construction
failures.
Summary
The split native codegen-unit path cannot materialize the relocatable
ptrtointconstant expression that every non-entry JS module uses to pass its__init_bodyfunction pointer through the integer-valued runtime ABI.This blocks production-sized webpack graphs before application code can run.
The whole-module text path accepts the same IR because LLVM parses the constant
expression itself; the in-process native dialect reader instead feeds the full
expression to the integer literal parser.
Exact reproduction
Base:
fe0d4979204dfd6b8b166320e1ebdd2318f30518(currentmainafter #8044)Using the pinned Next.js 16.3.0 webpack production route graph from #8034,
compiled as an app-only dylib with native split units:
Perry collects 91 modules and reaches native codegen, then independently fails
all four large split modules, including the generated
next/dist/compiled/next-server/app-route.runtime.prod.js:Perry correctly refuses to link the incomplete dylib (87/91 modules emitted).
Minimal compiler-level reproduction
Define two functions in an
LlModule: an__init_body, and an__initwrapperwhose runtime call uses this operand:
Then invoke
compile_module_units_native(..., 2, ...). This forces independentnative construction and object emission followed by the real partial-link path.
Before the fix it reaches
i128::parseand fails withbad integer; a parse-onlyor textual-backend test does not reproduce the defect.
Acceptance
ptrtointconstructionfailures.
AppRouteRouteModule.handlepath must still actually execute with the requiredmoving/verifier evidence before that separate production ticket can close.
Refs #8034 and #8040.