Skip to content

[DO NOT MERGE] test jsc upgrade#189

Draft
Kudo wants to merge 20 commits intomainfrom
@kudo/wip/bun-alignment
Draft

[DO NOT MERGE] test jsc upgrade#189
Kudo wants to merge 20 commits intomainfrom
@kudo/wip/bun-alignment

Conversation

@Kudo
Copy link
Member

@Kudo Kudo commented Dec 13, 2025

No description provided.

matthargett and others added 19 commits October 17, 2025 12:22
…nary, but without vectorization (helped by the -O2 inlining), the interpreter hot path might not stay hot in the CPU caches. if using JSC on Android, users probably have a Very Good Reason(tm), but I'm not sure which they care about more: app download size or performance per watt efficiency.
Co-authored-by: Kudo Chien <ckchien@gmail.com>
…warning (to about warnings as errors killing the build unnecessarily), but also disable loop vectorization options until NDK can be bumped. downgrade to c++20 to align with React Native constraints.
…about LTO for the binary bits that end up in the app package itself anyway. gradefully degrade to generic LTO when clang isn't detected on the system. when clang is detected, make sure we use it for generating the ICU host-run codegen
… (pixel 2 and above) for the superior vectorization codegen that's possible
…-class GC collectible, which can cause OOM on a specific synthetic stress test on mobile/wearable devices
…le React Native's lagging toolchain from other downstream users like BabylonNative
…for that matter, use cccache so that incremental updates from upstream bun-sh/webkit don't trigger the 90+ minute (time three, for each NDK) build.
…s lost when rebasing the existing patch stack on the new JSC. efault collator lazy-property is now wrapped in #if ENABLE(INTL) so the no-intl flavor never tries to instantiate ICU

    machinery it does not ship. BabylonNative needs Inspector APIs to be available, and SharedArrayBuffer is now enabled for efficient communication via N-API native modules. add a small smoketest binary for NDK 28 and NDK 29 validation in Android simulator outside of the React Native-mandated NDK 27. we now have a way to validate runtime effectiveness of all NDK variant compiles within CI.
…so maybe something else is up in the compiler environment now?
@Kudo
Copy link
Member Author

Kudo commented Mar 1, 2026

Code review

Found 4 issues:

  1. Smoke test reads Promise result before microtask queue drains -- runSmokeTest schedules a .then/.catch chain via Promise.resolve() in one JSEvaluateScript call and immediately reads __jscSmokeTestResult in a second call. The JSC C API does not automatically drain the microtask queue between JSEvaluateScript calls, so the result will be "pending" and the test will always throw. A call to drain microtasks (or a synchronous test) is needed between the two evaluations.

evaluateToString(
ctx,
"var __jscSmokeTestResult = undefined;\n"
"Promise.resolve().then(function() {\n"
" throw {value: JSON.stringify({foo: 1})};\n"
"}).catch(function(error) {\n"
" __jscSmokeTestResult = error.value;\n"
"});\n"
"__jscSmokeTestResult;");
std::string capturedResult = evaluateToString(
ctx,
"typeof __jscSmokeTestResult === 'string'\n"
" ? __jscSmokeTestResult\n"
" : __jscSmokeTestResult === undefined ? 'pending' : String(__jscSmokeTestResult);");
if (capturedResult != "{\"foo\":1}") {
throw std::runtime_error("Unexpected result: " + capturedResult);
}

  1. Unstripped distribution directories are never archived -- The Archive step only copies dist-${{ matrix.variant }} but not dist-${{ matrix.variant }}.unstripped. The publish job's publish.js will silently skip the missing unstripped directories, so unstripped packages will never be published for any NDK variant.

run: |
rm -rf archive
mkdir -p archive
if [[ -d "dist-${{ matrix.variant }}" ]]; then
cp -R "dist-${{ matrix.variant }}" archive/
else
echo "Distribution directory dist-${{ matrix.variant }} was not produced." >&2
exit 1
fi

  1. Publish job setup-node missing registry-url -- actions/setup-node only writes NODE_AUTH_TOKEN into .npmrc when registry-url is specified. Without it, npm publish will run unauthenticated and fail. Add registry-url: 'https://registry.npmjs.org' to the publish job's setup-node step.

- name: ⬢ Setup Node
uses: actions/setup-node@v4
with:
node-version: 22

  1. NDK variant ID mismatch breaks smoke tests -- package.json defines the NDK28 variant with "id": "ndk28c", but the CI matrix passes variant: ndk28. run-js-smoketest.sh does a strict ID lookup (entry.id === variantId) with no fallback, so it will exit with "Unknown NDK variant: ndk28" on every CI run.

{
"id": "ndk28c",
"label": "Android NDK r28c",

const variants = Array.isArray(pkg.config?.ndkVariants) ? pkg.config.ndkVariants : [];
const variant = variants.find((entry) => entry && entry.id === variantId);
if (!variant) {
console.error(`Unknown NDK variant: ${variantId}`);
process.exit(1);
}

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

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