Skip to content

Merge static_h branch from upstream Hermes repo#264

Merged
vmoroz merged 10 commits into
microsoft:mainfrom
vmoroz:PR/static_h_merge
Feb 24, 2026
Merged

Merge static_h branch from upstream Hermes repo#264
vmoroz merged 10 commits into
microsoft:mainfrom
vmoroz:PR/static_h_merge

Conversation

@vmoroz

@vmoroz vmoroz commented Feb 14, 2026

Copy link
Copy Markdown
Member

Summary

Integrates the upstream static_h branch from facebook/hermes
(commit 657380912e) into hermes-windows. The static_h branch is the
new default development branch in upstream Hermes, replacing main.

This PR also introduces a pluggable Intl (ECMA-402) implementation for
Windows, adopts the @rnx-kit/fork-sync tool for future upstream syncs,
and fixes previously suppressed JS test failures.


1. Upstream static_h Integration

The static_h branch brings a major architectural change to Hermes:
a new static compilation pipeline and accompanying runtime support.
Merging it required resolving conflicts across ~6,000 files and adapting
the Windows build for new upstream patterns.

Key integration fixes:

  • Moved external/boost to external/boost2 to avoid conflict with
    the upstream-added Boost dependency.
  • Fixed compilation issues for x64, x86, ARM64, and ARM64EC with Clang
    and MSVC (lld-link specifics, visibility, stack alignment).
  • Fixed x86 stack overflow in shermes (stack frame size difference
    between 32-bit and 64-bit).
  • Fixed ARM64EC build compatibility.
  • Fixed UWP compilation.

2. Fork Sync Tooling & Developer Script

Adopted @rnx-kit/fork-sync to manage upstream synchronization. Config
files added:

  • sync-config.json — tracks the upstream repo, branch, and last-synced
    commit.
  • sync-manifest.json — declares sync dependencies (hermes core,
    icu-small, test262).
  • tools/fork-sync/package.json — local fork-sync package.

Added dev.ps1 — a PowerShell task runner as a single entry point for
common developer tasks:

  • .\dev build [args] — builds Hermes (wraps build.js).
  • .\dev fork-sync --dep <name> — runs fork-sync for a dependency.
  • Auto-installs fork-sync npm dependencies on first use.

3. Pluggable Intl Implementation (Experimental)

Added a new ECMA-402 (Intl) implementation for Windows with a
runtime-selectable ICU provider architecture. All Windows-specific code
lives in lib/Platform/Intl/impl_win/, minimizing upstream merge
friction.

Architecture: A pure-C ICU vtable (hermes_icu.h) with ~260
function pointers matching ICU C API signatures. No static ICU linking
— all ICU access is via LoadLibrary/GetProcAddress at runtime.

Providers (resolved at runtime):

  1. Bundled ICUhermes-icu.dll built from vendored ICU 78
    (sourced from Node.js icu-small). Full ECMA-402 compliance.
  2. System ICU — Windows 10 1903+ built-in icu.dll. Full ECMA-402
    for most features.
  3. Dynamic ICU — Host-supplied ICU DLLs from any path.
  4. WinGlob — Windows NLS API fallback, always available. Basic Intl
    support without ICU.
  5. Host vtable — Custom function pointer table provided by the host.

Test results:

  • Test262 intl402: 348 pass / 0 fail (of 348 executed; 1167 skipped for
    features Hermes does not implement, e.g. Locale, PluralRules,
    Segmenter).
  • Hermes JS lit tests: 2888 pass / 0 fail (x64), 2887 pass / 0 fail
    (x86).

New test infrastructure:

  • tools/hermes_rt/ — lightweight JS runner using the public C API,
    supports --intl-provider flag for testing each provider.
  • external/test262/ — pinned Test262 suite for intl402 conformance.
  • build.js --test262-intl — new CI integration for running intl tests.

Note on ICU landscape (from investigation): The ICU C API has
significant gaps vs. the C++ API, making full ECMA-402 compliance
through C-only wrappers challenging. The bundled hermes-icu.dll
(which uses C++ internally) is the recommended path. System ICU and
WinGlob providers have inherent limitations.

4. JS Test Fixes

Removed lit.local.cfg test suppressions introduced in commit
725f1bd8 (issue #230) by fixing the underlying test issues:

  • TypedArray.js, array-functions.js, number-functions.js,
    proxy.js, string-functions.js — all fixed and re-enabled.
  • test/BCGen/HBC/deltamode/string-functions-update.js — re-enabled.
  • test/hermes/intl/ — re-enabled (now backed by the new Intl
    implementation).

5. Vendored Dependencies

  • external/icu-small/ — ICU 78 source from Node.js, builds
    hermes-icu.dll (~35 MB). Single export: hermes_icu_get_vtable.
  • external/test262/ — Pinned ECMA-402 test suite.

Build & Test

All platforms compile. JS tests pass on x64 and x86. ARM64 and ARM64EC
compile but tests are not run (cross-compilation).

.\dev build --platform x64              # build
.\dev build --jstest                    # JS lit tests
.\dev build --test262-intl              # ECMA-402 tests
.\dev fork-sync --dep icu-small         # sync icu-small from upstream

@vmoroz vmoroz requested a review from a team as a code owner February 14, 2026 05:07
@vmoroz vmoroz changed the title Merge static_h branch Merge static_h branch from upstream Hermes repo Feb 24, 2026
@vmoroz vmoroz merged commit 4df97b1 into microsoft:main Feb 24, 2026
13 checks passed
@vmoroz vmoroz deleted the PR/static_h_merge branch February 24, 2026 23:58
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.

2 participants