Skip dense meet joined-mask scans#47
Open
MesTTo wants to merge 1 commit into
Open
Conversation
Implements the TODO in the dense meet: instead of walking both dense nodes' full masks and re-testing membership per byte, walk the intersection mask directly, so bytes absent from either side are never visited. No public API change; is_identity handling is equivalent (the intersection walk observes the same element/identity outcomes the full walk did). Motivated by the existing meet benchmarks, measured on this tree vs its base (interleaved, two reps each side, best median): superdense_meet 8000 26.1->25.0us, 16000 42.5->39.8us, 32000 100->93.9us (a consistent 4-6% where the masks are dense); sparse_meet and binary_meet at parity to -2% (their masks are thin, so there is little scan to skip). Result-identical: the full suite and the seeded algebra differential pass, including composed with the DenseByteNode operand-selection fix (both touch this file; they auto-merge and the differential passes with both applied).
3e26e0b to
5178984
Compare
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
Implements the TODO in the dense meet: instead of walking both dense nodes'
full masks and re-testing membership per byte, walk the intersection mask
directly, so bytes absent from either side are never visited. No public API
change;
is_identityhandling is equivalent (the intersection walk observesthe same element/identity outcomes the full walk did).
Result
Measured on this branch vs
master(interleaved, two reps each side, bestmedian):
superdense_meet8000 26.1→25.0us, 16000 42.5→39.8us, 32000100→93.9us (a consistent 4-6% where the masks are dense);
sparse_meetandbinary_meetat parity to -2% (their masks are thin, so there's little scanto skip). Composes cleanly with
pr/pathmap-hardening's DenseByteNodeoperand-selection fix (both touch this file; they auto-merge, and the
algebra differential passes with both applied).
Test plan
cargo test --release --lib(660/0, matches themasterbaseline)cargo test --release --test pathmap_algebra_differential(4/4)cargo bench --bench superdense_keys / sparse_keys / binary_keys -- meet