luvcraft/persistence.lisp
Return the portable value description stored for block in a world save.
Resolve a portable block value with keyword kind and property description.
Return overlay's current values in deterministic world-coordinate order.
Restore one authored edit, migrating the retired gnome block to air.
Gnomes became embodied agents rather than terrain after save format version 1 had already written them as block edits. This compatibility belongs at the world-edit boundary: a legacy gnome occupied a cell, so removing that obsolete occupant means an explicit air edit. Other uses of block descriptions remain strict; in particular a selected or carried block cannot silently become air.
Return source as portable semantic data, excluding resident chunks.
Restore a world source named by keyword kind from description.
Return world as a portable description without resident materializations.
Restore a world named by keyword kind from description.
carried are the blocks the player holds that are worth writing down:
per-instance ones such as films, which no palette would give back.
Capture one immutable, printable checkpoint description. See #TR2JNQ.
Return CAMERA, PLAYER, selected block, and carried blocks restored from
description.
Return the world and resume description represented by description.
Read and validate one luvcraft save from pathname.
Return the restored world and its still-portable resume description.
Atomically replace pathname with the printable save description.
Persist immutable description on writer's worker thread.
Retain an earlier failure until shutdown reports it. A later successful coalesced checkpoint must not make lost durability look like an entirely successful writer lifetime.
Make a sleeping latest-value worker for atomic world checkpoints.
Submit immutable description without waiting for filesystem I/O.
Only the latest checkpoint which has not begun is retained. Return its monotonic ticket.
Flush the latest requested checkpoint, stop writer, and join its thread.
(plist context)A MuPDF context: its allocator, its store, and its error stack.
(plist key context &key optional default)(description context)Logical conjunction of tests and raw truth values.
(block)Return the portable value description stored for BLOCK in a world save.
(kind description)Resolve a portable block value with keyword KIND and property DESCRIPTION.
Logical disjunction of tests and raw truth values.
(name &optional (error-p t))Return the shared block kind whose durable semantic name is NAME. When ERROR-P is true, signal an error rather than returning NIL for an unknown name. Save files and other external descriptions refer to block kinds through this vocabulary instead of printing CLOS object identities.
(description)(left right)Test whether one compatible scalar is less than another.
Test whether two compatible scalars are equal.
(description)Restore one authored edit, migrating the retired gnome block to air. Gnomes became embodied agents rather than terrain after save format version 1 had already written them as block edits. This compatibility belongs at the world-edit boundary: a legacy gnome occupied a cell, so removing that obsolete occupant means…
(descriptions)(overlay block x y z)(source)Return SOURCE as portable semantic data, excluding resident chunks.
(kind description)Restore a world source named by keyword KIND from DESCRIPTION.
(world)Return WORLD as a portable description without resident materializations.
(kind description)Restore a world named by keyword KIND from DESCRIPTION.
(vector)A canonical product of symbolic base dimensions raised to rational powers.
(&key (id (gensym "BLOCK-WORLD-"))
(chunk-width 16)
(chunk-height 16)
(chunk-depth 16)
(cell-extent 1d0)
source)(camera player selected-block &optional carried)CARRIED are the blocks the player holds that are worth writing down: per-instance ones such as films, which no palette would give back.
(world &key camera player selected-block carried)(description)Return CAMERA, PLAYER, selected block, and carried blocks restored from DESCRIPTION.
(x y z)(description)(pathname)Read and validate one luvcraft save from PATHNAME. Return the restored world and its still-portable resume description.
(pathname)Headings, paragraphs, figures and their IDs, mentions, marks.
(description pathname)(writer description)Persist immutable DESCRIPTION on WRITER's worker thread.
(writer)(writer ticket condition)(pathname)(writer description)Submit immutable DESCRIPTION without waiting for filesystem I/O. Only the latest checkpoint which has not begun is retained. Return its monotonic ticket.
(writer &key (timeout 10.0))A luvcraft save is a readable, versioned s-expression containing the block-world space, its procedural source, and the sparse authored edit overlay. Block values use durable semantic names such as :stone and :crystal rather than printed CLOS identities. Explicit air remains a value, distinct from the absence of an…
Durable descriptions and asynchronous checkpoints for the little world.
A save contains the procedural source and sparse authored edits. Resident chunks and their derived products are deliberately absent. The render owner captures an immutable description; a dedicated latest-value worker performs printing and atomic replacement without file I/O in a frame.