Skip to content

Fix restrict of a dense node by a list/tiny node - #172

Open
adamv-symbolica wants to merge 1 commit into
Adam-Vandervorst:masterfrom
adamv-symbolica:restrict-lhs-mask
Open

adamv-symbolica wants to merge 1 commit into
Adam-Vandervorst:masterfrom
adamv-symbolica:restrict-lhs-mask

Conversation

@adamv-symbolica

Copy link
Copy Markdown
Contributor

Opus 5.5 xhigh:

prestrict_abstract scanned every child of the (up to 256 wide) dense self node and asked the list or tiny other node about each one, so a restriction by a sparse map cost O(width of the LHS) per node it passed through. It now intersects self's mask with other's branch mask and visits only the overlap, which is at most 2 bytes. TinyRefNode gets a real node_branches_mask to supply that mask.

Adds benches/restrict.rs, sweeping LHS/RHS branching, depth below the cut-off on either side, cut-off depth, overlap, and LHS/RHS size. LHS branching 256 goes from 554 to 47 µs (flat in branching now), and a 1M key random LHS restricted by 64 keys from 37 to 3.8 µs.

Adds an oracle test restricting wide maps by a few of their own paths, cut short, extended, diverging, or whole, through restrict, WriteZipper::restrict (including its status), and restricting.

…rictor's branches

`prestrict_abstract` scanned every child of the (up to 256 wide) dense
`self` node and asked the list or tiny `other` node about each one, so a
restriction by a sparse map cost O(width of the LHS) per node it passed
through.  It now intersects `self`'s mask with `other`'s branch mask and
visits only the overlap, which is at most 2 bytes.  `TinyRefNode` gets a
real `node_branches_mask` to supply that mask.

Adds benches/restrict.rs, sweeping LHS/RHS branching, depth below the
cut-off on either side, cut-off depth, overlap, and LHS/RHS size.
LHS branching 256 goes from 554 to 47 µs (flat in branching now), and a
1M key random LHS restricted by 64 keys from 37 to 3.8 µs.

Adds an oracle test restricting wide maps by a few of their own paths,
cut short, extended, diverging, or whole, through `restrict`,
`WriteZipper::restrict` (including its status), and `restricting`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant