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
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
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
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52758
Changelog: [internal]
This is a change to how Fantom tests run in Meta infra via Buck.
After this, the biggest opportunity will be optimizing how we generate bundles with Metro.
Reviewed By: christophpurrer
Differential Revision: D78672863
fbshipit-source-id: 1152907f3ba60e7d2e48bcc588f3c07aef7bb393
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52861
Changelog: [internal]
We added this mode recently to support all local Hermes variants, but this doubles the number of build type combinations which regresses test execution time and give us little benefit, so we're removing it.
Reviewed By: rshest
Differential Revision: D79080370
fbshipit-source-id: e1b536427acb98ec01edfd44829e2fef9be9b18d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52863
Changelog: [internal]
We're seeing some issues in stress runs for Fantom tests in optimized mode, failing when compiling the bytecode with Hermes. The specific error in the Hermes compiler isn't clear, but this started failing when we changed the folders for output. It's possible that it's due to race conditions in stress runs, where multiple workers are attempting to compile in the same locations.
This forces every output in every runner to be in a different file to prevent these possible collisions.
Reviewed By: rshest
Differential Revision: D79084242
fbshipit-source-id: b4540e2e6c5378c7fc8630ac2fea674e0ef78a14
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52759
Changelog: [internal]
This introduces a new environment variable for Fantom to disable benchmarks (`FANTOM_FORCE_TEST_MODE`), without having to run in CI mode.
Reviewed By: rshest
Differential Revision: D78672864
fbshipit-source-id: ef445bd8b36703594658529da2436c75d5b87179
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52105
Changelog: [internal]
I just learnt there's a Hermes variant that we don't support (staging) so this adds support for it.
Reviewed By: christophpurrer
Differential Revision: D76897715
fbshipit-source-id: 3113edde3c785d71ad4a57dd435f16e13ab46976