Skip to content

more resiliency to buggy user code in IdOrdMap#255

Merged
sunshowers merged 4 commits into
mainfrom
sunshowers/spr/more-resiliency-to-buggy-user-code-in-idordmap
May 22, 2026
Merged

more resiliency to buggy user code in IdOrdMap#255
sunshowers merged 4 commits into
mainfrom
sunshowers/spr/more-resiliency-to-buggy-user-code-in-idordmap

Conversation

@sunshowers
Copy link
Copy Markdown
Collaborator

@sunshowers sunshowers commented May 22, 2026

  • Use a two-phase commit pattern where no user code runs in between changing the btree table and changing the map. This requires switching over from BTreeSet to BTreeMap<_, ()>, but that is just what's required to be able to express this pattern.
  • If, for whatever reason (either a buggy comparator or some RefMut trickery), an efficient remove lookup didn't work, switch to a linear scan to ensure the index is removed. This ends up being load-bearing for aliasing.
  • Extend the panic safety tests to also cover Drop.

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
@sunshowers sunshowers merged commit 48dfbfc into main May 22, 2026
34 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/more-resiliency-to-buggy-user-code-in-idordmap branch May 22, 2026 16:56
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