Skip to content

Fix dynamic promise runtime gating - #117

Open
eli-sterling wants to merge 1 commit into
vercel-labs:mainfrom
eliware:fix/dynamic-promise-runtime-gating
Open

Fix dynamic promise runtime gating#117
eli-sterling wants to merge 1 commit into
vercel-labs:mainfrom
eliware:fix/dynamic-promise-runtime-gating

Conversation

@eli-sterling

Copy link
Copy Markdown
Contributor

Summary

When a typed Promise crossed the checked-dynamic boundary, the compiler emitted scr_dyn_new_promise_adapting but did not always link the runtime translation unit defining it.

This caused a linker failure for valid programs using typed promises through dynamic callbacks.

Fix

moduleUsesDynAsync() now detects Promise-typed IR values and enables the dynamic Promise runtime support when required.

Validation

  • Focused regression test passed:
    npx pnpm exec vitest run tests/harness/island.test.ts -t "links the dynamic promise adapter"
  • Result: 1 passed, 25 skipped.
  • Full suite was attempted but was not green within the available run.
  • The reported static-size failures reproduce on main with the same 418664-byte result, so they are not introduced by this patch.

Commit: 27537e0

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

@eli-sterling is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

}
// Promise values crossing the checked-dynamic boundary are boxed by
// emit-walkers through scr_dyn_new_promise_adapting(). That constructor
// lives in scr_async_dyn.c, so promise-typed IR must pull that TU in even

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The moduleUsesDynAsync() promise gate matches every promise-typed IR node, over-linking scr_async_dyn.c into fully-static async programs that never box a promise to dyn.

Fix on Vercel

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.

1 participant