FA-90725 / Garbage collector invariants / Member archive
Identity hash: moved objects hash their current address · case 05
hashCode changes after every collection that moves the object.
Case contract
objs maps id -> [address, size]. The identity hash of an object is (address >> 3) & 0xFFFF of the address at which it was first hashed. Objects start unhashed; hash marks them hashed and returns the hash computed from the current address while they have not moved. The first move of a hashed object stores that hash in a new 8-byte trailing slot (size grows by 8) and later moves keep it; moving an unhashed object stores nothing. Return all hashes and the final [address, size] layout.
Why this case matters
Moving collectors must keep identity hashes stable even though they are derived from addresses.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: hash survives a move | {"hashes": [8205, 4096], "layout": {"1": [32768, 32], "2": [8192, 16], "3": [201272, 32]}} | {"hashes": [8205, 8205], "layout": {"1": [32768, 32], "2": [8192, 16], "3": [201272, 32]}} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗