FA-90672 / Garbage collector invariants / Member archive
Mark parity: new objects always get mark 0 · case 02
Objects allocated in odd epochs look dead to the current cycle and alive to the next one.
Case contract
Mark bits flip meaning every cycle: an object is live when its mark equals epoch % 2. Initially every object has mark 0 at epoch 0. gc live_ids: finish sweeping every unswept page, advance the epoch, set the mark of each listed live object to the new parity, and mark all pages unswept. alloc id page: sweep the page first if it is unswept, then create the object with the current parity. finish sweeps the remaining pages. Sweeping a page removes objects whose mark differs from the current parity and logs [page, removed]. Return the sweep log and surviving objects per page.
Why this case matters
Flipping mark polarity avoids clearing mark bits but makes sweep ordering and allocation colour critical.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| second cycle with an unswept page | {"log": [[1, ["b2", "c2"]], [2, ["e2"]], [1, []], [2, ["d2"]]], "pages": {"1": ["a2", "x2"], "2": []}} | {"log": [[1, ["b2", "c2"]], [2, ["e2"]], [1, ["x2"]], [2, ["d2"]]], "pages": {"1": ["a2"], "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 ↗