Two Agents Contending for a Bounded Resource: Exactly One Claim Commits

Claim

In the eOS-Harness MVA running against DGD 1.7.9 plus the eOS-kernellib chat-app write-coherence branch, when two users contend for the single open slot in a capacity-bounded chat room, the runtime serializes the two claim operations so that exactly one commits and the other reads the committed state and is refused -- with no lock, no retry loop, and no coordination protocol. The mechanism: obj/room.c carries a capacity and a claim_slot(user) that re-reads the room's CURRENT member list (query_members()) at write time and refuses (returns 0) when sizeof(current) >= capacity. The phase sets a room's capacity to 1, then has two users (frank, grace) both call claim_slot. Each call runs as its own atomic DGD task, so DGD's single-threaded scheduling runs them one after another: the first reads zero members, takes the slot, and commits; the second reads the post-commit membership (one member, at capacity) and is refused. The driver asserts exactly one claim returned 1, the room holds exactly the winner, and the loser is not a member (sentinel COHERENCE-SERIALIZE OK). The losing writer never executes a lock acquisition or a compare-and-swap retry -- its plain read of current state at write time already reflects the winner's commit, which is the coherent-state primitive providing the serialization for free.

Grounds

This is an Empirical Observation. The grounds are a captured three-boot smoke run 2026-05-30 against the live MVA demonstration instance with examples/chat-app/ overlaid into the isolated runtime staging tree.

Setup (verifiable from repo state):

Load-bearing source (examples/chat-app/obj/room.c and a phase of examples/chat-app/sys/test.c):

/* room.c: the serialized slot claim */
int claim_slot(object user)
{
    object *current;
    int cap;

    cap = query_capacity();
    current = query_members();           /* current state, read at write time */
    if (cap > 0 && sizeof(current) >= cap) {
        return 0;                        /* room full -- the loser sees the update */
    }
    if (!member(user, current)) {
        set_property("chat-room.member-list", current + ({ user }));
    }
    return 1;
}

/* test.c: two users contend for the one slot */
room_c->set_capacity(1);
frank_won = room_c->claim_slot(frank);   /* commits, room now full */
grace_won = room_c->claim_slot(grace);   /* reads the full room, refused */
/* asserts: frank_won + grace_won == 1; sizeof(members) == 1; loser not a member */

Smoke transcript (the load-bearing portion of the result log after boot 1):

ChatApp:test: EVENT-ROLLBACK OK
ChatApp:test: COHERENCE-SERIALIZE OK
ChatApp:test: LOST-UPDATE OK

COHERENCE-SERIALIZE OK writes only when exactly one of the two claims returned 1, the room holds exactly one member, and the losing user is not a member. The assertion is inside catch{}; both-or-neither winning, a wrong member count, or the loser still joined each log a distinct FAIL.

What the evidence establishes:

What the evidence does not establish:

What Would Revise It

Sources

Relations