Skip to content

Adding WriteZipper::remove_subtrie - #162

Open
luketpeterson wants to merge 1 commit into
masterfrom
remove_subtrie_api_addition
Open

luketpeterson wants to merge 1 commit into
masterfrom
remove_subtrie_api_addition

Conversation

@luketpeterson

@luketpeterson luketpeterson commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Adding WriteZipper::remove_subtrie as this is a more fundamental operation than remove_branches, but remove_branches is useful and correct in its own right.

This new method balances the API, helping define and explain the consistency fixes proposed in #104 Also, in the future this will be the lowest-cost way to just chop a subtrie, although the current implementation doesn't offer much perf benefit vs. remove_branches.

I also updated the lean model to include the new method. However, this shifted the number of opcodes and threatened to invalidate the existing .bin files. So I made a change to the .bin header to include the opcode count, rather than hard-coding the %56 that was in there.

I pondered going further and actually redoing the .bin format entirely, storing opcodes + args instead of the raw fuzz signal, so decoding only happens once before saving a reproduction - but I didn't go that far because it seemed unnecessary and like I'd be over-stepping.

Thoughts, @imlvts?

…ation than remove_branches, but remove_branches is useful and correct in its own right.

Updating documentation
Future-proofing fuzzer .bin format by carrying opcode count in header
@luketpeterson
luketpeterson requested a review from imlvts October 9, 2026 03:09
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Bench A/B vs base: done

job log · 2026-10-09 03:17:28 UTC

base cb4e1e4 → head 0c9e6b7, 3 round(s), median of each run averaged; negative is faster

bench cases geomean largest gain largest loss >5% faster >5% slower
shakespeare 7 +3.4% -0.3% shakespeare/shakespeare_words_insert +12.2% shakespeare/shakespeare_sentences_get 0 2
cities 5 -0.8% -2.2% cities/cities_val_count_act +0.3% cities/cities_val_count 0 0
sparse_keys 96 -0.7% -3.9% sparse_zipper_cursor/1600 +1.2% sparse_k_path_iter/50 0 0
binary_keys 77 -1.7% -12.5% binary_descend_until_max_bytes/1000 +2.2% binary_insert/1600 3 0
superdense_keys 104 -0.8% -6.3% superdense_val_count_bench/200 +6.7% superdense_drop_bench/100 2 1
act_paths 46 -1.1% -10.6% shape_map_to_act_cata/random_long +2.5% size_dense_paths_to_act/25000 2 0
zipper_head_owned 16 +1.7% -1.5% zipper_head_owned/map_reader_is_val +11.3% zipper_head_owned/shared_parent_reader_val 0 2
product_zipper 4 +0.1% -2.0% product_zipper/generic_act_act +1.8% product_zipper/introspecting_pathmap_pathmap 0 0
12 case(s) moved more than 5%
bench case base head change
binary_keys binary_descend_until_max_bytes/1000 69.18 µs 60.50 µs -12.5%
shakespeare shakespeare/shakespeare_sentences_get 46.59 ms 52.27 ms +12.2%
zipper_head_owned zipper_head_owned/shared_parent_reader_val 1.26 µs 1.41 µs +11.3%
act_paths shape_map_to_act_cata/random_long 44.83 ms 40.08 ms -10.6%
shakespeare shakespeare/shakespeare_words_val_count 304.97 µs 327.70 µs +7.5%
binary_keys binary_set_val_at_short_replace/1 13 ns 12 ns -6.8%
superdense_keys superdense_drop_bench/100 50 ns 53 ns +6.7%
act_paths shape_map_to_act_cata/small_alphabet 10.76 ms 10.07 ms -6.4%
binary_keys binary_descend_until/500 33.86 µs 31.71 µs -6.3%
superdense_keys superdense_val_count_bench/200 100 ns 93 ns -6.3%
superdense_keys superdense_drop_head/4000 29.05 µs 27.43 µs -5.6%
zipper_head_owned zipper_head_owned/borrowed_head_read_value_in_shared_parent 13.52 µs 14.28 µs +5.6%

Full tables per bench are in the job log and the bench-out artifact.

@Adam-Vandervorst

Adam-Vandervorst commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

I believe this is good iff it's upheld by a lot of laws.
Such as being equivalent to remove_branches ; remove val or restrict(PathMap::new())

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