Skip to content

There's no way of telling why a polNode is supposed to be remembered #287

@kcalvinalvin

Description

@kcalvinalvin

The problem

To remember a polNode, we set the niece[0] of the polNode to itself. Telling whether a leaf is supposed to be remembered or not can be figured out by polNode.niece[0] == polNode.

There's two cases where a polNode needs to be remembered:

1: The leaf will be spent soon and is therefore cached.
2: The leaf is a sibling of the leaf to be deleted soon and is therefore cached. Important to note that the leaf by itself doesn't necessarily need to be cached as it'll stick around for a while.

These two cases need to be handled differently. Before decision tree shows how each case should be handled.
Screen Shot 2021-07-07 at 3 13 37 PM

However, since there's only one way of remembering polNode.niece[0] = polNode, there's no way of doing this.

Suggestion

Easiest way to solve this would be to denote case 2 as polNode.niece[1] = polNode. This might be a good stopgap until we have a swapless accumulator design working.

But in my opinion, I think maybe separating out the roots and leaves as different structs might work better. A polNode could be an interface and we can have root, leaf and node as this is how we're treating the polNodes anyways. This is a bigger change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions