ci(benchmark/react): force LynxNormalTask and LynxHighTask runs on ui thread in frozen mode#1693
Conversation
…n ui thread in frozen mode
|
📝 WalkthroughWalkthroughUpdates the PICK_COMMIT hash in packages/lynx/benchx_cli/scripts/build.mjs to a new commit ID. No other build steps or constants changed. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Pre-merge checks (1 passed, 1 warning, 1 inconclusive)❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| const COMMIT = 'd6dd806293012c62e5104ad7ed2bed5c66f4f833'; | ||
| const PICK_COMMIT = 'ff0c7dbe93ddf526c3a2b814215797ceeb3bb085'; | ||
| const PICK_COMMIT = '3d75a38c2e5b422da9b32851a1bd5dfe25ca8ed6'; |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Stale binary risk: changing only PICK_COMMIT won’t trigger a rebuild.
checkBinary() keys the cache solely on COMMIT, and the commit file is populated from git rev-parse HEAD. Because you cherry-pick with -n (no commit), HEAD remains COMMIT. Result: updating PICK_COMMIT can be silently ignored if dist/bin/benchx_cli already exists with the same base COMMIT. CI may keep using a binary that does not include the newly picked changes.
Fix by incorporating both COMMIT and PICK_COMMIT into the cache fingerprint and into the commit file.
Apply this diff:
const COMMIT = 'd6dd806293012c62e5104ad7ed2bed5c66f4f833';
-const PICK_COMMIT = '3d75a38c2e5b422da9b32851a1bd5dfe25ca8ed6';
+const PICK_COMMIT = '3d75a38c2e5b422da9b32851a1bd5dfe25ca8ed6';
+const BUILD_FINGERPRINT = `${COMMIT}:${PICK_COMMIT}`;
async function checkBinary() {
if (
existsSync('./dist/bin/benchx_cli')
&& existsSync('./dist/bin/benchx_cli.commit')
) {
const { exitCode, stdout } = await $`cat ./dist/bin/benchx_cli.commit`;
- if (exitCode === 0 && stdout.trim() === COMMIT) {
+ if (exitCode === 0 && stdout.trim() === BUILD_FINGERPRINT) {
return true;
}
}
return false;
}
// build from source
await $`
cd lynx
source tools/envsetup.sh
gn gen --args='enable_unittests=true enable_trace="perfetto" jsengine_type="quickjs" enable_frozen_mode=true' out/Default
ninja -C out/Default benchx_cli
mkdir -p ../dist/bin
cp ${
process.platform === 'darwin'
? 'out/Default/benchx_cli'
: 'out/Default/exe.unstripped/benchx_cli' // linux
} ../dist/bin/benchx_cli
- git rev-parse HEAD > ../dist/bin/benchx_cli.commit
+ echo ${BUILD_FINGERPRINT} > ../dist/bin/benchx_cli.commit
rm -rf out
`.pipe(process.stdout);Optionally, drop -n from git cherry-pick so HEAD advances, but you’d still want the composite fingerprint to cover changes beyond the base commit.
Also applies to: 53-64, 118-124
🤖 Prompt for AI Agents
In packages/lynx/benchx_cli/scripts/build.mjs around lines 33 (and also apply
same change to ranges 53-64 and 118-124), the script currently only fingerprints
and caches the binary by COMMIT (from git rev-parse HEAD) so changing
PICK_COMMIT won’t force a rebuild; update the cache key and the commit-file
contents to include both COMMIT and PICK_COMMIT (e.g. composite fingerprint like
`${COMMIT}:${PICK_COMMIT}`) wherever checkBinary/read/write commit-file logic
runs so the presence of a different PICK_COMMIT invalidates the cache and forces
rebuild; also, when performing the cherry-pick consider removing the `-n` flag
so HEAD advances (optional) but still ensure the composite fingerprint is
written to disk and used for cache checks.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
React Example#5008 Bundle Size — 238.2KiB (0%).b4b67bc(current) vs de8a1c7 main#5005(baseline) Bundle metrics
|
| Current #5008 |
Baseline #5005 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
163 |
163 |
|
67 |
67 |
|
46.88% |
46.88% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #5008 |
Baseline #5005 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
92.45KiB |
92.45KiB |
Bundle analysis report Branch hzy:p/hzy/bench_9 Project dashboard
Generated by RelativeCI Documentation Report issue
Web Explorer#5001 Bundle Size — 367.39KiB (+0.25%).b4b67bc(current) vs de8a1c7 main#4998(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch hzy:p/hzy/bench_9 Project dashboard Generated by RelativeCI Documentation Report issue |
CodSpeed Performance ReportMerging #1693 will improve performances by 12.39%Comparing 🎉 Hooray!
|
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
| ⚡ | basic-performance-nest-level-100 |
6.6 ms | 5.9 ms | +12.39% |
Summary by CodeRabbit
close: #1694
Checklist