FA-74880 / CRDT convergence / Member archive
PN-Counter with local floor: the floor check ignores decrements already applied · case 05
Repeated decrements drive a replica's observed value below zero.
Case contract
Replicas keep a positive map and a negative map (replica->total). ["inc", r, k] and ["dec", r, k] need k > 0, otherwise the event index is rejected. A decrement is also rejected when r's locally observed value is below k. ["sync", src, dst] merges both maps of src into dst by pointwise maximum. Return values and rejected indices.
Why this case matters
Positive/negative counters are the standard way to support decrements in a state-based counter.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| second decrement cannot pass the floor | {"rejected": [], "values": [-1, 0, 0]} | {"rejected": [2], "values": [1, 0, 0]} | 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 ↗