B2.3 · dive 1 — the forest and the placement law
The brand routes; the integer hashes.
EchoData.BrandedChamp is a forest: a top-level map from the 3-byte namespace
to a CHAMP trie, with the trie keyed by the snowflake integer — the id is split at the boundary,
the base62 payload decoded once, and the integer enters the trie.
Source: content/bcs2.3.md; the gate is H1 in bcs_rung_2_3_check.out;
the integrated modules are committed at
runtimes/elixir/lib/echo_data/champ/{branded_champ,champ_node,champ_server}.ex.
The transcript
bcs_rung_2_3_check.out · verbatim · this dive reads H1H1 canon ok -- placement delegated to the contract hash: compute_hash_int -> BrandedId.hash32; reference snowflake round-trips
The full record — all seven gates, the mid-record [debug] boot line
included — is frozen on the module hub; it closes
PASS 7/7.
The amendment — one placement law
content/bcs2.3.md · What · HowThe drop's compute_hash_int carried a single mixing round — the first
fmix64 constant, once — under a comment claiming it matches the Go side. The canon's Go
is the full fmix64 behind hash32 (the committed 234878118
vector, at 0.9586 ns), and Chapter 1.2's law admits exactly one placement function. The integration
performs the alignment as a delegation — the amendment is three lines and a comment:
# Chapter 2.3 integration review: placement delegated to the contract hash. defp compute_hash_int(key) when is_integer(key) and key >= 0 do EchoData.BrandedId.hash32(key) end
H1 gates it from both sides: compute_hash_int -> BrandedId.hash32
asserted in the integrated source, and the reference snowflake round-tripping through the trie. The
comment's intent is now true. The decision the manuscript records: any future structure that hashes
identities delegates to the contract or does not merge.
The two-bitmap node
content/bcs2.3.md · What · Steindorfer & VinjuThe nodes are the CHAMP design proper: two 32-bit bitmaps per node —
datamap for inline pairs, nodemap for children — over a popcount-indexed
compact array, 5-bit hash fragments for 32-way branching, and the canonical representation the paper
introduced so that equal maps are equal structures. Around the core: an O(1) cached census per namespace
(namespace_size/2), the Access, Enumerable, and
Collectable protocols, and a by-snowflake operation family that skips string handling when
the caller already holds the integer.
hash32(274557032793636864) = 234878118 (content/contract.md) — into its 5-bit
fragments, level by level. Select a level; the readout shows the fragment's bits, its value, and the
slot it selects.The walk in words: the trie shifts the hash right by five bits per level and masks
the low five — (hash >>> (5 × level)) & 31. The bitmaps then answer for
the fragment: a set datamap bit means the pair sits inline here; a set
nodemap bit means the walk descends; neither means absence — no probing, no empty
slots.
References
sources · relatedSources
- Steindorfer & Vinju — Optimizing Hash-Array Mapped Tries (OOPSLA 2015)the two-bitmap node, popcount indexing, the canonical representation
- Erlang/OTP — the ets modulethe flat-table comparison arm this module measures against
Related
- B2.3 — The CHAMP Property Databasethe module hub; the full rung in context
- B2 — The Elixir BCS Corethe chapter landing; the Part II arc
- B2.2 — Property Stores on ETSthe flat table — chronology as a property of the keyspace
- Functional Programming in Elixirthe umbrella where echo_data lives