Skip to content

Coverage guided mutation fuzzing and mutation agnostic tests#5571

Open
ealmloff wants to merge 63 commits into
DioxusLabs:mainfrom
ealmloff:fuzzing
Open

Coverage guided mutation fuzzing and mutation agnostic tests#5571
ealmloff wants to merge 63 commits into
DioxusLabs:mainfrom
ealmloff:fuzzing

Conversation

@ealmloff
Copy link
Copy Markdown
Member

@ealmloff ealmloff commented May 19, 2026

While working on #5554, most of the tests need to be rewritten and they don't cover a lot of cases we care about. This PR makes them more resilient by:

  1. Asserting less about what diffing produces. Instead of asserting it produces a specific series of mutations with specific elementids change any time we change diffing, it asserts the oracle renderer produces the same dom state when moving from the previous state to this state and from an empty dom to this state
  2. Switching to a more robust mutation based prop based fuzzing

This is pulled out of #5554 to shrink the diff and separate out the bugs the proptesting finds from the placeholder removal

Bug fixes

  • Fragment([]) causes the diffing engine to panic
  • Template Hashing collisions
  • Suspense diffing to a placeholder and back instead of directly resolving and getting stuck if you suspend and unsuspend in one frame
  • Attribute mering bugs (div { width: "static", width: (i > 0).then("dynamic") })
  • A bunch of dead unreachable paths in core

Performance

Comparison vs main on the js-framework-benchmark overhead (take results with a grain of salt. some of this could be system noise):

Benchmark Main Avg Branch Avg Avg Delta
create rows 18.246 ms 17.829 ms -2.3%
create 1,000 rows 4.792 ms 3.150 ms -34.3%
create 10,000 rows 65.460 ms 40.389 ms -38.3%
replace all rows 6.157 ms 5.685 ms -7.7%
append 1,000 rows 5.668 ms 7.436 ms +31.2%
update every 10th row 1.407 ms 1.862 ms +32.3%
select row 1.340 ms 1.041 ms -22.3%
swap rows 1.471 ms 1.575 ms +7.1%
remove row 1.358 ms 1.452 ms +6.9%
clear rows 1.036 ms 1.152 ms +11.2%

Manual testing

I manually tested this branch with dioxus-code, dioxus-components, and the suspense examples

TODO

  • 100% diff code coverage in fuzzing
  • Hook up fuzzing in ci
  • Benchmark

Comment thread packages/core/src/diff/iterator.rs
Comment thread packages/core/src/events.rs
@ealmloff ealmloff marked this pull request as ready for review May 22, 2026 15:42
@ealmloff ealmloff requested a review from a team as a code owner May 22, 2026 15:42
Comment thread packages/dioxus/benches/jsframework.rs Outdated
Comment thread packages/fuzz/README.md
@ealmloff ealmloff added bug Something isn't working core relating to the core implementation of the virtualdom labels May 22, 2026
ealmloff added 14 commits May 22, 2026 12:34
`test -x` on the rustup path failed on the warp runner because
`llvm-tools-preview` does not always drop `llvm-symbolizer` at the
expected location. Try the rustup path first, fall back to whatever
the runner has on PATH, then to a versioned `/usr/bin/llvm-symbolizer-*`.
Without a symbolizer LSan reports unsymbolicated frames and the leak:
suppressions silently match nothing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core relating to the core implementation of the virtualdom

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant