---
title: "perennial: design · perennial"
description: "perennial is a set of persistent (immutable, structurally shared) collections for Rust — HashMap, HashSet, OrdMap, OrdSet and Vector — whose public interface…"
canonical: "https://perennial.avarok.net/docs/design/"
lastmod: "2026-12-01T23:57:36Z"
tokens: 929
---

1. [Docs](https://perennial.avarok.net/docs/)

# perennial: design

perennial@0.1.0·Updated 2026-12-01·1 min read·[View as markdown](https://perennial.avarok.net/docs/design/index.md)

perennial is a set of persistent (immutable, structurally shared) collections for Rust — `HashMap`, `HashSet`, `OrdMap`, `OrdSet` and `Vector` — whose public interface is a drop-in replacement for **im-rc 15.1.0** and **im 15.1.0**, with the additions of **imbl 7.0.2**. It is an independent implementation written from a clean-room behavioural specification (`docs/spec/`) and the published algorithm literature; see `NOTICE`.

## Chapters

1. [The interface perennial matches](https://perennial.avarok.net/docs/design/01-interface/): crates and migration lines, shape decisions, and every place where the references disagree or are defective, with the choice made and why.
2. [Architecture](https://perennial.avarok.net/docs/design/02-architecture/): crates, the pointer-kind abstraction, copy on write by ownership, SBIO layering, the `unsafe` policy, the module map.
3. [Where the speed comes from](https://perennial.avarok.net/docs/design/03-speed/): a black-box probe of the references first, then the mechanism and the predicted gain per collection, and the honest limits.
4. [Safety and the known bug classes](https://perennial.avarok.net/docs/design/04-safety/): one negative test per advisory, panic safety by construction, iterative drop, fuzzing.
5. [Proof plan](https://perennial.avarok.net/docs/design/05-proof/): differential model tests against imbl, im/im-rc and std; cargo's own test suite with perennial-rc in place of im-rc; compile-level API checks.
6. [Benchmark method](https://perennial.avarok.net/docs/design/06-bench/): contenders, workloads, harness and outputs.

Behaviour differences, item by item: [COMPAT.md](https://perennial.avarok.net/docs/compat/).

## Decisions in one place

- Reference versions: im-rc 15.1.0, im 15.1.0, imbl 7.0.2; rpds 1.2.1 and std are measured alongside.
- Two crates: `perennial` (Arc, im paths) and `perennial-rc` (Rc, im-rc paths); both are aliases over generic types parameterised by a pointer kind.
- `#![forbid(unsafe_code)]`; no I/O; `no_std` + `alloc` with the `std` feature on by default (it supplies `RandomState`).
- OrdMap/OrdSet: B+tree; HashMap/HashSet: CHAMP-style HAMT; Vector: RRB tree with head/tail buffers and a cached focus. Mutation edits uniquely owned nodes in place.
- Where im 15.1 and imbl 7 disagree, chapter 1's table decides; every such row has a test.

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://thomaspbraun.com/#person",
      "@type": "Person",
      "name": "Thomas Braun",
      "sameAs": [
        "https://github.com/tbraun96",
        "https://x.com/tbraun96"
      ],
      "url": "https://thomaspbraun.com",
      "worksFor": {
        "@type": "Organization",
        "name": "Avarok",
        "url": "https://avarok.net"
      }
    },
    {
      "@id": "https://perennial.avarok.net/docs/design/",
      "@type": "WebPage",
      "author": {
        "@id": "https://thomaspbraun.com/#person"
      },
      "dateModified": "2026-12-01T23:57:36Z",
      "description": "perennial is a set of persistent (immutable, structurally shared) collections for Rust — HashMap, HashSet, OrdMap, OrdSet and Vector — whose public interface…",
      "inLanguage": "en",
      "isPartOf": {
        "@id": "https://perennial.avarok.net/#website",
        "@type": "WebSite",
        "name": "perennial",
        "url": "https://perennial.avarok.net/"
      },
      "name": "perennial: design · perennial",
      "url": "https://perennial.avarok.net/docs/design/"
    }
  ]
}
```
