# Replica counter illustration Adapted from Shapiro et al., A comprehensive study of Convergent and Commutative Replicated Data Types, INRIA RR7506 (2011), section 3.1.2: https://perso.lip6.fr/Marc.Shapiro/papers/2011/Comprehensive-CRDTs-RR7506-2011-01.pdf This is a teaching illustration of the published G-counter construction, not a new algorithm or empirical research result. Two replicas independently increment. The table compares merging scalar totals with merging per-replica components. Run with Node.js: node --test model.test.mjs Print the table: node --input-type=module -e "import {examples} from './model.mjs'; console.table(examples())" Tests enumerate 16 states (two components in 0..3), 256 pairs and 4096 triples. An independent union of actor-event identities checks the preserved increments. Negative controls include replayed scalar sums and a reset reused identity. A client retry executed as another increment counts again, at either replica; replaying an unchanged state remains idempotent. No request deduplication is modeled. Assumptions: two fixed distinct replica identities, only each identity's owner increments its component, nonnegative exact integer arithmetic within the checked JavaScript safe-integer range, retained state and eventual exchange. No network, crash recovery, identity authentication, membership changes, linearizable reads, arbitrary application invariant or storage durability is implemented or tested. Code and tests: CC0-1.0. The cited papers retain their original rights.