Skip to content

Conversation

@tomusdrw
Copy link
Contributor

@tomusdrw tomusdrw commented Nov 10, 2025

Merge only after checking the performance using fluffybot. Note that currently we wait for new test results for 0.3.x series for better comparison.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated default backend configuration to use an alternative selection strategy.

Walkthrough

This pull request modifies a single configuration file to change the default PVM backend from BuiltIn to Ananas in the NODE_DEFAULTS object within the node configuration module. The change affects only the default backend selection logic without altering the configuration structure or other settings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Note: While the change itself is minimal (single value update), reviewers should verify that changing this default backend selection does not cause unintended side effects across the system or conflict with existing deployments or tests.

Possibly related PRs

  • Make builtin PVM the default #766 — Modifies the same NODE_DEFAULTS.pvm field in the same file but sets it to BuiltIn instead of Ananas, indicating a direct conflict or related feature work that should be coordinated.

Suggested reviewers

  • skoszuta
  • mateuszsikora
  • DrEverr

Poem

🐰 A tiny hop through config land,
Where backends shift by a fuzzy hand,
From BuiltIn to Ananas we go,
A pineapple default steals the show! 🍍

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided by the author, which is a significant omission for code review purposes. Add a description explaining why this change is needed, what impact it has, and any migration considerations for users.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating the default PVM backend from BuiltIn to Ananas for the 0.4.x series.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch td-anans

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf18f09 and 9361c86.

📒 Files selected for processing (1)
  • packages/jam/config-node/node-config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.ts

⚙️ CodeRabbit configuration file

**/*.ts: rules from ./CODESTYLE.md should be adhered to.

**/*.ts: Any function whose documentation mention it must not be used in production code,
can be safely used in *.test.ts files. Other usage should be carefuly reviewed
and the comment must explain why it's safe to use there.

**/*.ts: as conversions must not be used. Suggest using tryAs conversion methods.

**/*.ts: Classes with static Codec field must have private constructor and static create method.

**/*.ts: Casting a bigint (or U64) using Number(x) must have an explanation comment why
it is safe.

**/*.ts: When making changes to code with comments containing links (in classes, constants, methods, etc.)
to graypaper.fluffylabs.dev, ensure those links point to the current version for this update.

Files:

  • packages/jam/config-node/node-config.ts
🔇 Additional comments (1)
packages/jam/config-node/node-config.ts (1)

22-22: No issues found. The PvmBackend.Ananas default is valid and fully implemented.

All verification checks passed:

  • PvmBackend.Ananas is a properly defined enum value (value = 1)
  • Ananas backend has full implementation in InterpreterInstanceManager and importer protocol
  • Both backends are tested (accumulate.test.ts tests both in forEach loop)
  • BuiltIn references remain functional where explicitly needed (bin.ts, protocol handling)
  • Tests using NODE_DEFAULTS will now exercise the Ananas path, which is fully supported

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomusdrw tomusdrw marked this pull request as draft November 10, 2025 23:12
@tomusdrw
Copy link
Contributor Author

@fluffylabs-bot benchmark

@tomusdrw tomusdrw marked this pull request as ready for review November 11, 2025 12:47
@fluffylabs-bot
Copy link
Contributor

fluffylabs-bot bot commented Nov 11, 2025

Benchmark workflow triggered successfully! 🎉
Requested by: @tomusdrw
PR number: #770
Target repository: FluffyLabs/typeberry-testing

🔗 Check the Actions tab for workflow progress.

@github-actions
Copy link

View all
File Benchmark Ops
bytes/hex-to.ts[0] number toString + padding 320153.22 ±2.86% fastest ✅
bytes/hex-to.ts[1] manual 16470.95 ±0.19% 94.86% slower
hash/index.ts[0] hash with numeric representation 189.72 ±0.11% 27.39% slower
hash/index.ts[1] hash with string representation 116.39 ±0.29% 55.46% slower
hash/index.ts[2] hash with symbol representation 177.76 ±0.31% 31.97% slower
hash/index.ts[3] hash with uint8 representation 156.14 ±2.84% 40.24% slower
hash/index.ts[4] hash with packed representation 261.29 ±0.39% fastest ✅
hash/index.ts[5] hash with bigint representation 186.15 ±1.7% 28.76% slower
hash/index.ts[6] hash with uint32 representation 196.03 ±0.95% 24.98% slower
math/add_one_overflow.ts[0] add and take modulus 246097622.85 ±6.21% 5.21% slower
math/add_one_overflow.ts[1] condition before calculation 259629070.33 ±6.23% fastest ✅
codec/bigint.decode.ts[0] decode custom 172147907.72 ±3.15% fastest ✅
codec/bigint.decode.ts[1] decode bigint 108178587.14 ±2.26% 37.16% slower
bytes/hex-from.ts[0] parse hex using Number with NaN checking 140365.38 ±0.41% 83.47% slower
bytes/hex-from.ts[1] parse hex from char codes 849118.38 ±0.5% fastest ✅
bytes/hex-from.ts[2] parse hex from string nibbles 554863.3 ±0.24% 34.65% slower
collections/map-set.ts[0] 2 gets + conditional set 118288.9 ±0.32% fastest ✅
collections/map-set.ts[1] 1 get 1 set 60278.12 ±0.33% 49.04% slower
codec/bigint.compare.ts[0] compare custom 259426053.35 ±6.58% fastest ✅
codec/bigint.compare.ts[1] compare bigint 245833006.61 ±6.45% 5.24% slower
math/count-bits-u64.ts[0] standard method 10500750.68 ±0.78% 88.43% slower
math/count-bits-u64.ts[1] magic 90762390.86 ±1.92% fastest ✅
math/count-bits-u32.ts[0] standard method 82455605.42 ±2.23% 67.26% slower
math/count-bits-u32.ts[1] magic 251842620.39 ±5.42% fastest ✅
math/mul_overflow.ts[0] multiply and bring back to u32 252293103.22 ±6.46% 2.78% slower
math/mul_overflow.ts[1] multiply and take modulus 259495060.14 ±5.89% fastest ✅
math/switch.ts[0] switch 243935458.79 ±6.46% 4.17% slower
math/switch.ts[1] if 254550741.42 ±6.51% fastest ✅
logger/index.ts[0] console.log with string concat 6026845.99 ±60.55% fastest ✅
logger/index.ts[1] console.log with args 1493031.45 ±95.71% 75.23% slower
codec/decoding.ts[0] manual decode 11256766.84 ±1.39% 93.05% slower
codec/decoding.ts[1] int32array decode 161871714.58 ±3.1% fastest ✅
codec/decoding.ts[2] dataview decode 157780076.94 ±3.82% 2.53% slower
codec/encoding.ts[0] manual encode 1953987 ±0.91% 13.92% slower
codec/encoding.ts[1] int32array encode 2270052.81 ±1.19% fastest ✅
codec/encoding.ts[2] dataview encode 2088599.27 ±2.99% 7.99% slower
codec/view_vs_object.ts[0] Get the first field from Decoded 39698.48 ±76.06% 88.85% slower
codec/view_vs_object.ts[1] Get the first field from View 75837.78 ±0.79% 78.7% slower
codec/view_vs_object.ts[2] Get the first field as view from View 75325.66 ±0.77% 78.84% slower
codec/view_vs_object.ts[3] Get two fields from Decoded 356046.97 ±0.93% fastest ✅
codec/view_vs_object.ts[4] Get two fields from View 57937.42 ±1.14% 83.73% slower
codec/view_vs_object.ts[5] Get two fields from materialized from View 116114.15 ±1.7% 67.39% slower
codec/view_vs_object.ts[6] Get two fields as views from View 56067.88 ±2.97% 84.25% slower
codec/view_vs_object.ts[7] Get only third field from Decoded 341208.13 ±2.54% 4.17% slower
codec/view_vs_object.ts[8] Get only third field from View 69076.91 ±1.21% 80.6% slower
codec/view_vs_object.ts[9] Get only third field as view from View 70930.78 ±1.08% 80.08% slower
codec/view_vs_collection.ts[0] Get first element from Decoded 19122.6 ±1.3% 55.59% slower
codec/view_vs_collection.ts[1] Get first element from View 43054.84 ±1.14% fastest ✅
codec/view_vs_collection.ts[2] Get 50th element from Decoded 21338.95 ±1.27% 50.44% slower
codec/view_vs_collection.ts[3] Get 50th element from View 22220.29 ±1.18% 48.39% slower
codec/view_vs_collection.ts[4] Get last element from Decoded 20442.85 ±1.08% 52.52% slower
codec/view_vs_collection.ts[5] Get last element from View 16260.42 ±2.87% 62.23% slower
collections/map_vs_sorted.ts[0] Map 287876.43 ±1.66% fastest ✅
collections/map_vs_sorted.ts[1] Map-array 102310.24 ±0.22% 64.46% slower
collections/map_vs_sorted.ts[2] Array 60928.97 ±3.3% 78.84% slower
collections/map_vs_sorted.ts[3] SortedArray 193385.41 ±0.41% 32.82% slower
bytes/compare.ts[0] Comparing Uint32 bytes 12460.61 ±0.83% 37.94% slower
bytes/compare.ts[1] Comparing raw bytes 20078.95 ±0.78% fastest ✅
hash/blake2b.ts[0] our hasher 2.06 ±7.39% fastest ✅
hash/blake2b.ts[1] blake2b js 0.04 ±6.69% 98.06% slower
crypto/ed25519.ts[0] native crypto 5.33 ±18.95% 82.54% slower
crypto/ed25519.ts[1] wasm lib 10.4 ±3.53% 65.92% slower
crypto/ed25519.ts[2] wasm lib batch 30.52 ±0.54% fastest ✅

Benchmarks summary: 63/63 OK ✅

@fluffylabs-bot
Copy link
Contributor

fluffylabs-bot bot commented Nov 11, 2025

Picofuzz Benchmark Results

fallback

Metric Baseline Current Difference
min 12.91ms 13.57ms ≈ +0.67ms (+5.19%)
mean 16.38ms 16.52ms ≈ +0.13ms (+0.80%)
p90 18.67ms 18.84ms ≈ +0.18ms (+0.94%)
p99 23.05ms 24.30ms ≈ +1.25ms (+5.43%)

safrole

Metric Baseline Current Difference
min 13.92ms 14.02ms ≈ +0.09ms (+0.67%)
mean 65.13ms 65.36ms ≈ +0.23ms (+0.36%)
p90 143.17ms 143.91ms ≈ +0.74ms (+0.52%)
p99 148.24ms 148.04ms ≈ -0.20ms (-0.14%)

storage

Metric Baseline Current Difference
min 14.19ms 15.18ms ≈ +0.99ms (+6.99%)
mean 268.59ms 48.12ms 🟢 -220.47ms (-82.08%)
p90 702.96ms 92.17ms 🟢 -610.79ms (-86.89%)
p99 1084.18ms 121.49ms 🟢 -962.69ms (-88.79%)

storage_light

Metric Baseline Current Difference
min 16.25ms 14.98ms ≈ -1.27ms (-7.82%)
mean 103.07ms 33.18ms 🟢 -69.88ms (-67.80%)
p90 243.59ms 47.65ms 🟢 -195.93ms (-80.44%)
p99 382.11ms 72.40ms 🟢 -309.71ms (-81.05%)

🤖 Automated benchmark

@tomusdrw
Copy link
Contributor Author

@fluffylabs-bot benchmark

@fluffylabs-bot
Copy link
Contributor

fluffylabs-bot bot commented Nov 11, 2025

Benchmark workflow triggered successfully! 🎉
Requested by: @tomusdrw
PR number: #770
Target repository: FluffyLabs/typeberry-testing

🔗 Check the Actions tab for workflow progress.

@tomusdrw tomusdrw merged commit 27dfdd9 into main Nov 11, 2025
16 checks passed
@tomusdrw tomusdrw deleted the td-anans branch November 11, 2025 13:33
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.

3 participants