Skip to content

fix(mhfu): rabbitizer enums hash by value; 1.16's hash leaks an object a call - #129

Open
sp00ktober wants to merge 1 commit into
mainfrom
fix/rabbitizer-hash
Open

sp00ktober wants to merge 1 commit into
mainfrom
fix/rabbitizer-hash

Conversation

@sp00ktober

Copy link
Copy Markdown
Contributor

rabbitizer 1.16 (1.16.2 is the latest) leaks one object per hash() of any of its enums (registers, InstrId). The walkers key their state by registers and test instruction ids against sets, so one Zinogre derivation held 10-13 GB and a suite run in one process far more (four such processes took a 32 GB Mac down).

  • mhfu.mips gives rabbitizer.Enum a hash by value (agrees with ==).
  • Tests: 10k hashes leave no memory; an operand finds its register key; every module that imports rabbitizer loads mhfu.mips (each in its own process).

Peaks with data: test_zinogre_brain.py 0.29 GB (was over 8 GB for one of its tests), mhfu suite 0.70 GB, mhfu-port suite 0.46 GB. mhfu 1650 passed; mhfu-port 999 passed + the 6 raw-file tests with .../data_files.

🤖 Generated with Claude Code

…t a call

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant