Skip to content
Opensource internals
  • Posts

Rust

Provenance in Eight Bytes: How rustc Packs a Pointer's Identity

Oct 21, 2026 6 min read Jay Hubbert

rustc packs pointer provenance into a NonZero u64 with two flag bits, and stores the provenance of an allocation as sorted whole-pointer relocations rather than per-byte metadata.

RustInternalsCompilerConst evalMemoryPerformance

Read more →

The Init Mask Is a Single Boolean Until It Isn't: How rustc Tracks Uninitialised Memory

Oct 21, 2026 6 min read Jay Hubbert

rustc’s init mask starts as a single boolean meaning fully-initialised or fully-uninitialised, materialises a bitmap only on partial writes, and de-materialises again when a full …

RustInternalsCompilerConst evalMemoryPerformance

Read more →

One Interpreter, Two Machines: How rustc's Const Eval Powers Miri Too

Oct 21, 2026 6 min read Jay Hubbert

rustc’s const evaluator is a generic interpreter over a Machine trait; Miri instantiates it with provenance tracking and CTFE with a simpler one, and both get the same 8k lines of …

RustInternalsCompilerConst evalMiriPerformance

Read more →

Sixteen Bytes at a Time: How Rust Validates UTF-8

Oct 21, 2026 4 min read Jay Hubbert

Rust’s str validation is word-at-a-time: it reads two usize at a time looking for high bits, so pure-ASCII strings are validated at 16 bytes per iteration instead of one.

RustInternalsStdPerformanceUnicodeSimd

Read more →

One XOR and One CLZ: How Rust's Stable Sort Decides Which Runs to Merge

Oct 21, 2026 4 min read Jay Hubbert

Rust’s stable sort implements the powersort merge-tree heuristic from Munro and Wild, with the depth of each merge node computed as the leading zeros of an XOR of scaled midpoints.

RustInternalsStdPerformanceSortingAlgorithms

Read more →

← Newer Page 2 of 8 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·