Repository navigation
test: add Rust and JS differential fuzzing - #1047
Merged
zxch3n merged 5 commits intoJul 20, 2026
Merged
Conversation
Fix event frontier tracking, UTF-16 delete hints, tree snapshot and checkout semantics, and pure TypeScript event parity found by differential fuzzing. Promote minimized failures to the permanent corpus.
zxch3n
marked this pull request as ready for review
July 19, 2026 18:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The pure TypeScript runtime must remain semantically interchangeable with Rust across updates, snapshots, checkout, events, and malformed inputs. Differential fuzzing exposed cases where final state, tree metadata, or event payloads diverged even though ordinary examples passed.
Root causes
Impact
This improves Rust/WASM/TypeScript parity, preserves deleted tree state across snapshots and checkouts, and makes event behavior consistent for downstream consumers. The permanent corpus keeps the discovered edge cases covered.
Validation
cargo fmt --all -- --checkcargo test -p loro-internal local_event_starts_after_net_empty_importcargo test -p loro-internal tree_fast_snapshot_accepts_noncanonical_sibling_ordercargo test -p loro-internal --features wasm txn_events_split_merged_utf16_delete_opspnpm --filter loro-js lintpnpm --dir loro-js typecheckpnpm --filter loro-js test— 240 testspnpm --filter loro-js buildpnpm --filter loro-js fuzz:interop -- --corpus-only— 19 corpus cases, 32 malformed-import casespnpm --filter loro-js fuzz:interop:native— 19 corpus cases, 32 malformed-import casesStack
This PR targets
perf/loro-js-c1-snapshot-import. It should be retargeted tomainafter the performance branch lands.The final diff excludes generated JavaScript. The temporary add/remove generated-file commits can be squashed before marking the PR ready for review.