FA-90400 / Garbage collector invariants / Member archive
Trial deletion: re-blackening does not restore counts · case 05
Live objects inspected by the collector come out with permanently lowered reference counts.
Case contract
Synchronous trial-deletion cycle collection. Reference counts are external references plus heap in-edges. For each candidate, mark gray: colour gray and, for every out-edge, decrement the child count and recurse. Then scan each candidate: a gray object with positive count is re-blackened together with everything it reaches, restoring one count per traversed edge; a gray object with zero count turns white and its children are scanned. White objects are garbage. Return the garbage and the counts of the surviving objects.
Why this case matters
Cycle collectors for reference-counted heaps depend on exact decrement/restore bookkeeping.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| externally held cycle restores its counts | {"garbage": [], "rc": {"51": 0, "52": 1}} | {"garbage": [], "rc": {"51": 1, "52": 2}} | 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 ↗