Provide instance-owned, restorable ID sequences with checked exhaustion #7

Closed
opened 2026-12-02 18:45:52 +00:00 by faumaray · 1 comment
Owner

A Windows x64 simulation stores stable record IDs and the next available ID in each world. Loading a saved world, holding a snapshot and constructing a second world can all happen in one process. Each instance needs its own sequence. A removed record must keep its old ID retired when the world is saved and restored.

At the current game pin and Library HEAD, SeqId<Tag> uses a static atomic per tag. Its tests cover monotonic allocation and isolation between tags. The Core roadmap already calls out checked sequence exhaustion. Counted.hpp · Counted tests · Core roadmap, M-CORE-05

Would maintainers consider an instance-owned, restorable sequence with checked exhaustion? An application could start a sequence, copy its state at a completed boundary, restore a persisted high-water mark, and request a single ID or a contiguous batch. The caller needs an explicit exhausted result before any allocation changes its state. A fixed-width representation makes cross-platform saves reproducible. Checked integer arithmetic is already available in Void Math.

The downstream replacement checks are two worlds allocating independently, restoring after erasing the highest live record, replaying from a copy, and requesting a batch at the final representable boundary. On failure, neither the sequence nor any application record may change. The game keeps its validation of object references and ownership. Downstream M01 inventory and authority work

A Windows x64 simulation stores stable record IDs and the next available ID in each world. Loading a saved world, holding a snapshot and constructing a second world can all happen in one process. Each instance needs its own sequence. A removed record must keep its old ID retired when the world is saved and restored. At the current game pin and Library HEAD, `SeqId<Tag>` uses a static atomic per tag. Its tests cover monotonic allocation and isolation between tags. The Core roadmap already calls out checked sequence exhaustion. [Counted.hpp](https://git.faumaray.com/Void/Library/src/commit/7b0fea6095f603f9e1904f66dfdc7752f4be4792/include/Void/Core/Counted.hpp) · [Counted tests](https://git.faumaray.com/Void/Library/src/commit/7b0fea6095f603f9e1904f66dfdc7752f4be4792/tests/standalone/Core/Counted.cpp) · [Core roadmap, M-CORE-05](https://git.faumaray.com/Void/Library/src/commit/7b0fea6095f603f9e1904f66dfdc7752f4be4792/docs/roadmap/modules/Core.md) Would maintainers consider an instance-owned, restorable sequence with checked exhaustion? An application could start a sequence, copy its state at a completed boundary, restore a persisted high-water mark, and request a single ID or a contiguous batch. The caller needs an explicit exhausted result before any allocation changes its state. A fixed-width representation makes cross-platform saves reproducible. Checked integer arithmetic is already available in [Void Math](https://git.faumaray.com/Void/Library/src/commit/7b0fea6095f603f9e1904f66dfdc7752f4be4792/include/Void/Math/Numeric.hpp). The downstream replacement checks are two worlds allocating independently, restoring after erasing the highest live record, replaying from a copy, and requesting a batch at the final representable boundary. On failure, neither the sequence nor any application record may change. The game keeps its validation of object references and ownership. [Downstream M01 inventory and authority work](https://git.faumaray.com/Lagg1ng/stoneheart_at_home/pulls/6)
Author
Owner

Implemented on branch issue/7-restorable-id-sequences (commit f2b002e).

Void::Core::IdSequence added: instance-owned, copyable/restorable id sequences with checked exhaustion and all-or-nothing batches.

Branch: https://git.faumaray.com/Void/Library/src/branch/issue/7-restorable-id-sequences
Merge request: https://git.faumaray.com/Void/Library/pulls/new/issue/7-restorable-id-sequences

Implemented on branch `issue/7-restorable-id-sequences` (commit `f2b002e`). `Void::Core::IdSequence` added: instance-owned, copyable/restorable id sequences with checked exhaustion and all-or-nothing batches. Branch: https://git.faumaray.com/Void/Library/src/branch/issue/7-restorable-id-sequences Merge request: https://git.faumaray.com/Void/Library/pulls/new/issue/7-restorable-id-sequences
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Void/Library#7