You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a366b9f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(index): account for hash-table rounding in the remap materialization budget
`materialize_remap` checks its estimate against the translator's budget
before allocating the `HashMap<u64, Option<u64>>`, but it charged a flat 32
bytes per entry. hashbrown rounds `with_capacity(n)` up to
`next_power_of_two(ceil(n * 8 / 7))` buckets (4 or 8 below eight entries),
each a 24-byte `(u64, Option<u64>)` slot plus one control byte, and 16
trailing control bytes. For 7,350,000 fully moved addresses the flat charge
was 235,200,000 bytes (225.8 MiB with the 64 Ki-entry slice buffers), under
the 256 MiB default budget, while the table really allocates 16,777,216
buckets, 419,430,416 bytes.
The per-entry term is now `hash_map_bytes(entries)`, the rounded layout
above; the slice buffer term, the check before any allocation and
`DEFAULT_MATERIALIZATION_BUDGET_BYTES` are unchanged. A test pins the
7,350,000-entry allocation at 419,430,416 bytes (over 400 MiB) and checks
that a remapper reporting that many stored rows is declined with
`RemapUnavailable::OverBudget` under the default budget before any
translation.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
0 commit comments