102 Commits
Author SHA1 Message Date
Rubén Norteandmeta-codesync[bot] 9c4601abec Clean up feature flag "enableAccessToHostTreeInFabric" (#54322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54322

Changelog: [internal]

This just cleans up the feature flag, which is set to `true` by default and it's been enabled in `stable` already.

Reviewed By: lunaleaps, yungsters

Differential Revision: D85782127

fbshipit-source-id: 0a6174708066cfe597b4c6dbc8bb33829c6155e9
2025-10-30 08:37:04 -07:00
Nikita Lutsenkoandmeta-codesync[bot] 59affc38a6 clang-format | Format fbsource with clang-format 21.
Reviewed By: ChristianK275

Differential Revision: D85317706

fbshipit-source-id: b399c5c4b75252999442b7d7d2778e7a241b0025
2025-10-26 23:40:59 -07:00
Zeya Pengandmeta-codesync[bot] 43f464b218 pass down isAsync arg to start/stopOnRenderCallback to indicate thread (#54252)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54252

## Changelog:

[Internal] [Added] - pass down isAsync arg to start/stopOnRenderCallback to indicate thread

make it more explicit where start/stopOnRenderCallback is invoked so we can handle it on each platform in a more thread safe way

Reviewed By: lenaic

Differential Revision: D85365058

fbshipit-source-id: 5f0ee1343547fe3466fcd23282e0f27e129a2e7d
2025-10-24 11:52:48 -07:00
Rubén Norteandmeta-codesync[bot] e58bbbcd8e Allow passing refs where nodes are expected (#54221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54221

Changelog: [internal]

Small change in the Fantom API to accept refs and reduce boilerplate. See next diff for examples

Reviewed By: javache

Differential Revision: D85143177

fbshipit-source-id: fd65abcc1b107df8726fee172b284f5dc96e88a6
2025-10-21 09:34:49 -07:00
Zeya Pengandmeta-codesync[bot] d2eca58996 use processor flag -DRN_USE_ANIMATION_BACKEND to gate animation backend dep (#54091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54091

## Changelog:

[Internal] [Changed] - use processor flag -DRN_USE_ANIMATION_BACKEND to gate animation backend dep

So it's only enabled for catalyst and fantom when building with BUCK while gated from other meta apps, and enabled by default in oss version

Reviewed By: sammy-SC

Differential Revision: D84157729

fbshipit-source-id: e822f11c4b64b77b17a698bf3b60b5c5a4faf4f4
2025-10-09 19:01:20 -07:00
Bartlomiej BloniarzandFacebook GitHub Bot 325c681cb1 boostrap shared animation backend (#53994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53994

# Summary

This diff introduces the Shared Animation Backend - a class that can be used by animation frameworks to schedule and run animation updates.

## Changelog:

[GENERAL] [ADDED] - AnimationBackend-itest.js AnimationBackend BUCK/CmakeLists
[GENERAL] [ADDED] - useSharedAnimationBackend feature flag
[GENERAL] [CHANGED] - make AnimatedNodesManager use the backend behind the flag

Reviewed By: zeyap, sammy-SC

Differential Revision: D80809364

fbshipit-source-id: dbfe273362410cdf2f9fc37d78adac7faf4cd118
2025-10-01 04:15:11 -07:00
Vitali ZaidmanandFacebook GitHub Bot 3a954caf4f don't require projectRoot in devMiddleware (#53921)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53921

Changelog: [Internal] `devMiddleware` removed the unused option `projectRoot`

This option was used only in a dead branch of the code inside `InspectorProxy`.

The scenario where it appeared was enabling resolving script sources (`Debugger.getScriptSource`) starting with `file://` which were coming from the file system. However, we don't seem to ever point scripts at the filesystem this way.

Reviewed By: huntie

Differential Revision: D82739662

fbshipit-source-id: 9a130eaa83cb94ae0e36a5a1102c56ff8a36cffc
2025-09-24 12:47:24 -07:00
Andrew DatsenkoandFacebook GitHub Bot 22002bb70c Allow to disable coverage via flag & disable it for benchmarks (#53912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53912

Changelog: [Internal]
Add new fantom flag `fantom_disable_coverage` to be used in tests that are sensitive to things like memory allocation.
Also disable coverage for any benchmark test.

Reviewed By: arushikesarwani94

Differential Revision: D83070065

fbshipit-source-id: a885e79e3d0c88cfb7adef30cb60ab46a617edac
2025-09-23 13:40:31 -07:00
Andrew DatsenkoandFacebook GitHub Bot 2e4da10b52 fix coverage patterns (#53881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53881

Changelog: [Internal]
To make sure that coverage is insertect correctly when run in different metro setup where patterns do not match perfectly, we need to add glob prefix

Reviewed By: sammy-SC

Differential Revision: D82968565

fbshipit-source-id: c2676ef4c774411938039fc5b98a3b953f6ec916
2025-09-22 10:48:45 -07:00
Andrew DatsenkoandFacebook GitHub Bot e97ef8f1fb Fix dotslash issue in OD (#53842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53842

Changelog: [Internal]
There is a conflict between dotslash in node_modules and in OD it does not invoke buck2

Reviewed By: javache

Differential Revision: D82724326

fbshipit-source-id: c90cab58818e0245f8763b729c7e5432735eb05e
2025-09-18 07:39:22 -07:00
Andrew DatsenkoandFacebook GitHub Bot 10a46f7b52 Add support for JS coverage (#53410)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53410

Changelog: [Internal]
Adding babel-istanbul-plugin to instrument bundle code with coverage reporting.
Metro will transform source code only when coverage flag is set up globally in jest.
Coverage map is then provided by runner as part of test result.

Reviewed By: sammy-SC

Differential Revision: D80716433

fbshipit-source-id: 3831f227f8793f874f0d2366759bb6916e747c72
2025-09-04 07:19:56 -07:00
Andrew DatsenkoandFacebook GitHub Bot 42b94fc709 Add babel-plugin-istanbul for code covearage (#53413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53413

Changelog: [Internal]
Add dependency on istanbul plugin so we can collect code coverage.

Reviewed By: christophpurrer

Differential Revision: D80723825

fbshipit-source-id: bf0ac0e49e12ea1b01f72c11362019ef68e09ff9
2025-08-25 10:45:16 -07:00
Marco WangandFacebook GitHub Bot da9136f587 Turn on null strict comparison check for xplat js (#53379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53379

X-link: https://github.com/facebook/react/pull/34240

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D80648362

fbshipit-source-id: cc47ae207f29a3ddb68bc0e029b8773f89503c52
2025-08-21 16:46:23 -07:00
Jakub PiaseckiandFacebook GitHub Bot 776fca1e7c Change hermes atrifact names (#53094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53094

Changelog: [General][Changed] - Changed names of hermes binaries

Reviewed By: cipolleschi, cortinico

Differential Revision: D79163127

fbshipit-source-id: 54be34ba1f6ce90067768394ca9a6e9c4048be90
2025-08-21 04:00:04 -07:00
Rubén NorteandFacebook GitHub Bot 78f089906c Use React Native built-in definitions for Event and EventTarget in Fantom (#53362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53362

Changelog: [internal]

This just replaces the polyfills for `Event` and `EventTarget` that we're defining inline in Fantom with the implementations that already exist in RN.

Reviewed By: javache

Differential Revision: D80612067

fbshipit-source-id: 047c8f12cbb1f4afea2d05a5a1235d9dff2e25f9
2025-08-20 06:01:22 -07:00
Nivaldo BondançaandFacebook GitHub Bot d1a1020a4a Codemod format for trailing commas change
Reviewed By: VladimirMakaev

Differential Revision: D80576929

fbshipit-source-id: 1310f77f5d9d489b780b14875454ebda7f7adfc9
2025-08-19 18:15:18 -07:00
Marco WangandFacebook GitHub Bot 8351a5d186 Pre-Suppress errors for xplat/js for general strict comparison in non-generated files (#53342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53342

Commands

```
scripts/flow/tool add-comments --comment 'Error discovered during Constant Condition roll out. See https://fburl.com/workplace/4oq3zi07.' .
```
```
arc f
```

drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D80487235

fbshipit-source-id: 9e7c1a2641ddc0da0400fa1aff598b112a0434d5
2025-08-19 01:09:22 -07:00
Sam ZhouandFacebook GitHub Bot cf664c65e2 Standardize subtyping error code into incompatible-type in react native and metro (#53312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53312

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D80400976

fbshipit-source-id: 196af69c0b9621b2a2675b232406639773e04933
2025-08-18 09:04:31 -07:00
Rubén NorteandFacebook GitHub Bot 6b4af382c2 Apply better default options in benchmarks (#53320)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53320

Changelog: [internal]

This improves the defaults the options related to minimum number of iterations and test duration in benchmarks.

If you indicate a minimum duration, we set the minimum number of iterations so the duration is honored. We do the same if what's specified is the number of iterations.

This is useful when you want to make sure all the tests in a benchmark suite use the same number of iterations without having to explicitly set the time to 0 in all of them.

It also changes the default for warmup iterations to be just 1 (that's enough to load all modules and all the code into memory).

Reviewed By: rshest

Differential Revision: D80405287

fbshipit-source-id: 41a61c4d1979db6a25dd30f0c84b5de319416885
2025-08-18 08:57:52 -07:00
Rubén NorteandFacebook GitHub Bot 219fc99e99 Rename minDuration as minTestExecutionTime for clarity (#53321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53321

Changelog: [internal]

Just a rename to make it easier to understand.

Reviewed By: rshest

Differential Revision: D80404378

fbshipit-source-id: 3d7e89797be3b92599e07b4b64d2a720756a4f3b
2025-08-18 08:57:52 -07:00
Rubén NorteandFacebook GitHub Bot 6c37b5b682 Improve typing of benchmark functions (#53322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53322

Changelog: [internal]

This changes the types for benchmark functions to improve safety:
1. It makes the return object be an object instead of an interface, to catch when `overriddenDuration` is misspelled.
2. It makes the function always synchronous, as asynchronous tests aren't supported in Fantom (even though they are in `tinybench`).

Reviewed By: rshest

Differential Revision: D80404121

fbshipit-source-id: c0e2fb9f67174432f50e31c399f5b10cfe098ae6
2025-08-18 08:57:52 -07:00
Rubén NorteandFacebook GitHub Bot 180996683b Print information about benchmark duration (#53323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53323

Changelog: [internal]

This just makes it easier to understand when the benchmark itself has started running and how long the benchmark itself took to run.

Reviewed By: rshest

Differential Revision: D80400268

fbshipit-source-id: b447c4c389d563f7b2b1cbe82822d5d3a93272da
2025-08-18 08:57:52 -07:00
Samuel SuslaandFacebook GitHub Bot 3a3e3b884c Move C++ Animated to ReactCommon (#53278)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53278
changelog: [internal]

C++ Animated should be in ReactCommon, it is code shared across all platforms.

Reviewed By: christophpurrer, zeyap

Differential Revision: D80261447

fbshipit-source-id: 8ad5d0bb65c9b499b1d9f60fc8babef8d4d90078
2025-08-18 04:13:13 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot e3183739bb Options to run Fantom with address and thread sanitizers enabled (#53300)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53300

# Changelog:
[Internal] -

This adds two new modes to Fantom, allowing to run the native (C++) side with enabling either:
* Address sanitizer, which would detect memory overwrites
* Thread sanitizer, which can detect potential threading issues, such  as race conditions

This are opt-in for now.

Currently, both modes already detect different errors, which have a high chance to be real issues and have to be fixed.

Reviewed By: lenaic

Differential Revision: D80339524

fbshipit-source-id: 784ddb9f0af79a04b074e107e4955724d54d5685
2025-08-15 08:12:04 -07:00
Rubén NorteandFacebook GitHub Bot 38e1e0de53 Use string references in Fantom native module (#53274)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53274

Changelog: [internal]

Minor refactor

Reviewed By: rshest

Differential Revision: D80255982

fbshipit-source-id: 703f32a1edf5c225b0b07b3c519932ebe167b2c8
2025-08-14 06:19:00 -07:00
Rubén NorteandFacebook GitHub Bot e8bf982bac Support overriddenDuration in Fantom benchmarks (#53250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53250

Changelog: [internal]

This updates the types for Fantom benchmarks to support the new `overriddenDuration` option from `tinybench`.

It also exposes a new method in the benchmark namespace to access the same timestamp used in benchmarks.

Reviewed By: rshest

Differential Revision: D80169515

fbshipit-source-id: 59af197eababbf5b8544ee9f1862b206756dc87d
2025-08-13 10:14:21 -07:00
Rubén NorteandFacebook GitHub Bot 4ee326f52c Add documentation for JS memory profiler in Fantom (#53226)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53226

Changelog: [internal]

This adds documentation about how to take JS memory heap snapshots in Fantom.

Reviewed By: lenaic

Differential Revision: D80090283

fbshipit-source-id: 04f66a62aa756d1020b8d8ef6fc0ea7e68341710
2025-08-12 11:08:08 -07:00
Rubén NorteandFacebook GitHub Bot 90804fd088 Add documentation for JS sampling profiler in Fantom (#53227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53227

Changelog: [internal]

This adds docs for the new JS sampling profiler in Fantom

Reviewed By: lenaic

Differential Revision: D80090284

fbshipit-source-id: 0f7fa498cf141a51ac6fda331522945d42fc494d
2025-08-12 11:08:08 -07:00
Rubén NorteandFacebook GitHub Bot e2035379b6 Add documentation for debugging in Fantom (#53228)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53228

Changelog: [internal]

This adds some documentation about how to debug Fantom tests (C++ and JS).

Reviewed By: lenaic

Differential Revision: D80090286

fbshipit-source-id: 435d2079abfe72e93de0c297347b15dc39b25a89
2025-08-12 11:08:08 -07:00
Rubén NorteandFacebook GitHub Bot 0bf7721862 Use Jest naming for test regex in Fantom docs (#53229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53229

Changelog: [internal]

Tiny change to align with how Jest refers to this argument in its docs: https://jestjs.io/docs/cli#jest-regexfortestfiles

Reviewed By: lenaic

Differential Revision: D80090285

fbshipit-source-id: 86a4ad75078eb9b7575fca9659cc1a2e678f7a0a
2025-08-12 11:08:08 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 641a79dc51 Improve benchmark comparison printout ("slower"->"faster") (#53221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53221

# Changelog:
[Internal] -

This changes the benchmark test results comparison print the results slightly differently, in particular it now uses the slowest result as a baseline and prints how much faster the other ones are (as opposed to printing "slower" previously).

This arguably brings a more positive vibe when looking into the benchmark results :)

Reviewed By: andrewdacenko

Differential Revision: D80082134

fbshipit-source-id: 7dc9c7c520afe08270d4f5da9031db02261690ba
2025-08-12 06:56:14 -07:00
Rubén NorteandFacebook GitHub Bot 65974e938c Add support for JS debugging in Fantom (#53215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53215

Changelog: [internal]

This adds a new environment variable to Fantom that allows debugging the JS code in tests.

Usage:

```
FANTOM_DEBUG_JS=1 yarn fantom <test>
```

**Does NOT work in OSS yet**. We need to include a third-party library to send HTTP and WebSocket requests and implement a wrapper on top of it.

Reviewed By: christophpurrer

Differential Revision: D79883372

fbshipit-source-id: d077c373a036033344e61d58274d5cd14028bda4
2025-08-12 05:41:11 -07:00
Rubén NorteandFacebook GitHub Bot 9c201c0f8f Automatically inject debugger statements in tests in preparation for debug mode (#53205)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53205

Changelog: [internal]

This injects a custom Babel transform for Fantom tests that automatically injects `debugger` statements in the generated code. This simplifies debugging by providing a default interruption point in the test setup for the test author to decide what to debug.

This has no effect unless the debugger is opened, which isn't happening yet.

Reviewed By: rshest

Differential Revision: D79996000

fbshipit-source-id: 6153587264d293a067e359edba4f64f41898c506
2025-08-12 05:41:11 -07:00
Rubén NorteandFacebook GitHub Bot e0b22e1ebf Rename global variable with Metro server for Fantom (#53202)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53202

Changelog: [internal]

Just a minor refactor to follow the convention of prefixing Fantom-related globals and environment variables.

Reviewed By: rshest

Differential Revision: D79804007

fbshipit-source-id: 0c9a57c1b08ae18ae03cd66d1a6ef9690e0dea42
2025-08-12 05:41:11 -07:00
Rubén NorteandFacebook GitHub Bot 6fb0072f01 Refactor logic to find available port for Metro in Fantom (#53204)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53204

Changelog: [internal]

This changes the logic to find an available port for Metro on Fantom to do this outside Metro. Before, we'd set `0` as the port for Metro to find an available port, but in a following change we'll need to know the port before calling into Metro. This allows that.

Reviewed By: rshest

Differential Revision: D79804005

fbshipit-source-id: 5c2e2f4acbba3a79771586799b65653d46b8fe72
2025-08-12 05:41:11 -07:00
Andrew DatsenkoandFacebook GitHub Bot 6738dbcc7e Generalize accessibility testing (#53182)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53182

Changelog: [Internal]
Move accessibility tests into reusable test suite.

Reviewed By: rshest

Differential Revision: D79897200

fbshipit-source-id: d98ebc7d16e7fd5c3c81086df4eec07dfdcb2fb0
2025-08-11 13:59:43 -07:00
Zeya PengandFacebook GitHub Bot 5517c046ab Cache result when RenderOutput::render() is called (#53112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53112

## Changelog:

[Internal] [Changed] - Cache result when RenderOutput::render() is called

Rreviously, root.getRenderedOutput in fantom doesn't really reflect the result of direct manipulation from native animated (see the test case added here). This stack is enabling it.

* make RenderOutput an instance owned by TestMountingManager that can cache render result
  * why is this needed - native animation's direct manipulation should modify the render result (analog to directly manipulating host views on a platform) instead of props on a StubView
* here i also make sure that `RenderOutput::render()` will only re calculate the render result for a tree after StubViewTree::mutate is called

Reviewed By: andrewdacenko

Differential Revision: D79737991

fbshipit-source-id: ee2193b708e319c1519b06bc672054c4f7105da1
2025-08-08 10:54:05 -07:00
Andrew DatsenkoandFacebook GitHub Bot 8363a4c515 Add static methods tests (#53087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53087

Changelog: [Internal]
As title

Reviewed By: lenaic

Differential Revision: D79665922

fbshipit-source-id: 024c10960a59e1332aacf2411a68ca85c17142db
2025-08-08 06:00:58 -07:00
Rubén NorteandFacebook GitHub Bot 2f33eece41 Fix retry logic in Fantom when requesting bundles from Metro (#53161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53161

Changelog: [internal]

This fixes a bug in the retry logic in Fantom when requesting bundles from Metro, where we cache the error from a previous attempt and use it to determine we didn't succeed after the attemps.

Reviewed By: rshest

Differential Revision: D79881488

fbshipit-source-id: 566b2d700db2f9653b9ea9acd577d7eb03770b76
2025-08-08 04:22:16 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 5fc23d7c62 Add type-safe API for passing around benchmark results (#53143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53143

# Changelog:
[Internal] -

This refactors the way Fantom benchmark test results are passed to the top level, making it type safe and more maintainable.

Reviewed By: andrewdacenko

Differential Revision: D79812707

fbshipit-source-id: d8bfef7e1b0c11b277a08f5e4c810f8c1efd7f89
2025-08-07 10:46:26 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 77ee24ddce Print benchmark comparison results in a tabular format (#53097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53097

# Changelog:
[Internal] -

This makes the benchmark results comparison printout, added in https://github.com/facebook/react-native/pull/52925, be done in a tabular form, so it's easier to read and copy/paste around.

Reviewed By: lenaic

Differential Revision: D79728695

fbshipit-source-id: 4dfc999ad4a9a8c2d67efdfce11aff75383cf645
2025-08-07 08:11:32 -07:00
Rubén NorteandFacebook GitHub Bot 789fc57254 Improve API to take JS heap snapshots in Fantom (#53071)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53071

Changelog: [internal]

The current API to take JS heap snapshots has some problems:
1. Ergonomics: it requires you to input the filepath where you want to store the snapshot. This isn't aligned with the behavior we have for JS traces where the output path is provided to you.
2. It doesn't work in optimized builds, as it requires a specific option in Hermes.

For 1), this replaces `Fantom.saveJSMemoryHeapSnapshot(filePath)` with `Fantom.takeJSMemoryHeapSnapshot()` that outputs the snapshot in a predefined path and prints it to the console.

For 2), this adds a new environment variable to force building Hermes with memory instrumentation (`FANTOM_ENABLE_JS_MEMORY_INSTRUMENTATION`). This is exposed as an option and not set by default because it has a performance overhead at runtime that we don't want to pay (especially in benchmarks).

This option only works when using Buck in development, because we want to generate this new binary type on demand when necessary, instead of making it part of the prebuilts we do before running tests in OSS and CI.

Reviewed By: lenaic

Differential Revision: D79642314

fbshipit-source-id: a2980616a495bd6dca29c0709a9581db6fb3f2cc
2025-08-06 05:40:02 -07:00
Rubén NorteandFacebook GitHub Bot 2187f653f6 Improve filenames of JS sampling profiler traces (#53069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53069

Changelog: [internal]

This changes the names of the JS traces from Fantom from using a unix timestamp in the file name to using the ISO date:

- From: `View-itest.js-1754406329686.cpuprofile`
- To: `View-itest.js-2025-08-05T15:05:29.686Z.cpuprofile`

Reviewed By: rshest

Differential Revision: D79646760

fbshipit-source-id: d8a654724c1abc2d3e285ee658c2d390d3241d82
2025-08-06 05:40:02 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 743db63570 Fix logspam when there is no benchmarking results (#53091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53091

# Changelog:
[Internal] -
This fixes some excessive printing from the benchmarking results, which happened even if there was no benchmarks ran.

Reviewed By: rubennorte

Differential Revision: D79719026

fbshipit-source-id: 0e75d97ae9c762cab25007bfab5ca8a6dc43e148
2025-08-06 05:32:11 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 8ef39b491c Implement benchmark comparison of different feture flag configurations (#52925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52925

# Changelog:
[Internal] -

This adds an extra "ranking" report when running Fantom benchmark vs different React Feature flag configurations.

It can be very useful when implementing some particular optimization, to streamline the before/after comparison wit this optimization enabled/disabled.

Reviewed By: andrewdacenko

Differential Revision: D79269601

fbshipit-source-id: f29e761e313d6857e5b3ac65faf2a387a84be9df
2025-08-05 08:34:35 -07:00
Rubén NorteandFacebook GitHub Bot b903ed7940 Add support for JS sampling profiler (#52827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52827

Changelog: [internal]

This adds **support for creating Hermes/JS sampling profiler traces in Fantom**, which is especially useful when running benchmarks.

Usage:
```
FANTOM_PROFILE_JS=1 yarn fantom Animated-benchmark
```

Output:

 {F1980642216}

After this, the trace is fully symbolicated.

Can be opened directly in Google Chrome:
{F1980642229}

Or in the built-in viewer in VSCode:

 {F1980642242} {F1980642240} {F1980642241}

When collapsing frames in the Flame Chart viewer in VSCode, we can quickly identify opportunities for optimizations.

This also supports multi-config environments. In that case, trace file names are created using a short representation of the configuration.

User guide for benchmarks in Fantom, including how to use this, will be done in a future diff.

NOTE: This still doesn't work in OSS because we don't support optimized mode there. In dev mode, there's a segmentation fault coming from this line: `hermesRuntime->sampledTraceToStreamInDevToolsFormat(fileStream)`

Reviewed By: sammy-SC

Differential Revision: D78905646

fbshipit-source-id: 382ddd5034db601309bd118cedde2fe0d57fde98
2025-08-05 05:36:26 -07:00
Rubén NorteandFacebook GitHub Bot 064750daa8 Improve type safety of constants passed from runner to runtime (#53034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53034

Changelog: [internal]

This is just a refactor to make sure that the constants we pass from the Fantom runner to its runtime are correct by using Flow to typecheck it.

Reviewed By: andrewdacenko

Differential Revision: D79565574

fbshipit-source-id: cbbab9cdec5ef5b3c82b929b8939c76c0ef41823
2025-08-05 05:36:26 -07:00
Rubén NorteandFacebook GitHub Bot f2e72c3859 Implement HighResTimeStamp mocking in Fantom (#53019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53019

Changelog: [internal]

This adds support for mocking `HighResTimeStamp` values in Fantom tests via a new `Fantom.installHighResTimeStampMock` function.

See new tests for more details on how it works.

Reviewed By: rshest

Differential Revision: D79554723

fbshipit-source-id: 8b0fb292948be118c7616fde1a8a84014af82de8
2025-08-04 11:21:03 -07:00
Rubén NorteandFacebook GitHub Bot 2016118aeb Centralize path definitions for Fantom builds and move to .out (#52829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52829

Changelog: [internal]

Just a small refactor to move the definitions of output paths to a specific module. We'll add more to this in a latter diff.

Reviewed By: sammy-SC

Differential Revision: D78905645

fbshipit-source-id: 011e6cec13396301dad8e76400b6f2b9e13568f0
2025-08-04 05:56:51 -07:00
Rubén NorteandFacebook GitHub Bot 6760383470 Create source maps for Fantom lazily (#52786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52786

Changelog: [internal]

It takes around 300ms to generate each source map file, and we really only need them if tests throw errors. Requesting source maps also increases contention to access the Metro server from each test worker.

This refactors the code so we only generate them in that case, which could save up to 20s in test execution time.

Reviewed By: rshest

Differential Revision: D78807672

fbshipit-source-id: af9f0f0377ddcf05014b5aca0b28db938dfb4ce2
2025-08-04 05:56:51 -07:00