diff options
| author | NotRexed <therealnothingfn@gmail.com> | 2026-11-27 16:14:04 -0500 |
|---|---|---|
| committer | NotRexed <therealnothingfn@gmail.com> | 2026-11-27 16:17:32 -0500 |
| commit | 6d40be2b88a60f8cba77799c654c203fa8d5aafa (patch) | |
| tree | 3aa5b16a59bc40fa99d887e4e25f7093fa8b11c3 /runtime/src/xma2_decoder.cpp | |
| parent | 46f0ef36d464375b21a2e7cbd841bf2bcad35ac0 (diff) | |
AddressHash: a key handed over as bytes is hashed eight bytes a step, not one
`AddressHash::write` took a step (a rotation, a multiplication, a fold) for
every byte. Keys that are integers or tuples of them never come that way,
but an array does: the standard library hands `[u32; 3]` over as its length
and then its twelve bytes at once. That is the key of the views a list made
(`descriptor::host::ListViews::made`: a descriptor record's tag, index and
generation), asked twice in `HostHeap::make_listed` for every slot of every
table a list makes afresh, and again by `listed_view` and `note_listed`:
thirteen steps each time. Now three: the length, eight bytes, and the four
left together with their number (so a key is not the longer key that ends
in zeros). Same tables, same contents; only the hash values differ.
What it is aimed at (CPU profile of 2026-11-27, Series X profile, about 9,500
draws a frame): `descriptor::host::HostHeap::make_listed`, 25 % of
`State::bind` on the threads that record lists.
Leonida's own; no other project's code.
New test `host::address_hash_tests::a_record_of_three_words_is_hashed_a_word_at_a_time`:
the standard library hands a record over as said (it fails if that changes),
the hash is the three steps done by hand, records that differ in any one bit
hash apart, bytes left over count, and 4,096 records of one tag spread.
Checked: `cargo check --profile diag -p leonida --features diagnostics,mimalloc`
(the 10 warnings of leonida-gpu from before); `cargo test -p leonida-gpu
--features diagnostics --lib address_hash_tests`: 2 passed. Not run in the
game.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/xma2_decoder.cpp')
0 files changed, 0 insertions, 0 deletions