iddqd, or the hardest kind of unsafe Rust
iddqd is a Rust map library, used in Oxide's Omicron control plane, where keys are borrowed from the values themselves. That avoids both passing key and value around separately and duplicating the key in both places. Internally each map pairs a slab-like ItemSet (a Vec of Occupied/Vacant slots with a free chain) with a hashbrown HashTable or B-tree index of slot indices, and BiHashMap and TriHashMap keep two or three such indexes over the same records. Because these generic structures call back into user-supplied trait code, their unsafe code (notably mutable iteration) must stay sound even against adversarial safe Rust. That is a harder standard than the slice-local or module-local reasoning needed for cases like split_at_mut, illustrated with a broken ExactSizeIterator example.
Related posts
- Supporting faster file load times with memory optimizations in Rust
Figma mediumAdept
Figma's Rust multiplayer server represented each file node as a BTreeMap from u16 property IDs to pointers, and memory profiling showed this map used over 60% of a file's memory. Because the schema has fewer than 200 fields and nodes average about 60 keys, the team swapped it for a flat sorted vector. Despite worse big-O complexity, the cache-friendly layout cut p99 deserialization time by 20% and fleet memory by about 20%. A further experiment stored the field ID in the unused top 16 bits of x86-64 pointers, saving only about 5% more RSS. That change was not shipped because of the risk of getting reference counts wrong and corrupting memory.
- Announcing Rust 1.99.0
Rust Blog mediumAdept
Rust 1.99.0 stabilizes defining C-ABI variadic functions in Rust using `...`, typed as `VaList` (ABI-compatible with C `va_list`) with readable types gated by the `VaArgSafe` trait. It also stabilizes `Layout::for_value_raw`, `mem::size_of_val_raw` and `mem::align_of_val_raw`, settling the safety rules for getting size and alignment from raw pointers to unsized types. The `Box::leak` docs now recommend against later deallocating leaked memory because it interacts badly with compiler optimizations and upcoming custom allocators, so `Box::into_raw` or `Box::into_non_null` should be used instead. Other stabilized APIs include `Vec::into_parts`/`from_parts`, `String::from_utf8_lossy_owned` and `std::fs::set_times`.
- This Week at Zed Industries: #12
Zed mediumAdeptZed publicly launched its preview channel and reports progress across the editor: Vim search commands, macOS ctrl-click remapped to right click in the platform layer, terminal Cmd+hover navigation, a semantic index that collapses nested tree-sitter symbols to cut embedding tokens, and a lock-contention bug where slow git status in huge repos serializes file scanning. The most substantive section covers CRDB, Zed's planned collaboration backbone. It uses serde-bare instead of Protocol Buffers so message types live entirely in Rust, routes messages by TypeId, and syncs replicas with vector clocks as a distributed set union. Operations are applied by reconstructing revisions from a DAG of operations with cached snapshots and copy-on-write B-trees.
- This Week at Zed Industries: #14
Zed easyNoviceZed's weekly update covers a reworked search UI with semantic search, the start of WebAssembly extensions for custom language servers, and near-complete collaboration channels. The most technical section describes CRDB repository sync without vector timestamps. Client and server find a shared prefix of a Lamport-ordered operation log by comparing Bromberg associative-hash digests over ranges, computed in O(log n) via a B-tree, trading extra round trips against sending redundant operations. Channels are modeled as a DAG whose permissions cascade downward, and GPUI layout is expressed with chained Rust builder calls instead of a macro DSL.
- This Week at Zed Industries: #1
Zed mediumAdeptZed grew out of Xray, the experimental editor Nathan Sobo and Antonio worked on at GitHub in 2018, and this weekly update recaps the path from there to a company and a private alpha. It also describes the team's first "quality week" of bug fixing, which they plan to repeat every six weeks. Multibuffer performance in project-wide search got much faster after two fixes. Rope fingerprints, computed with the monoid-homomorphic bromberg_sl2 hash and aggregated through a B-tree, are now stored as HashMatrix values instead of allocated Strings. Excerpts are also built on a background thread and streamed into the multibuffer so the main thread no longer blocks.