Version 0.18.0 #59

Merged
aslan merged 14 commits from imperfect-galaxy-work into main 2026-10-30 13:40:59 +01:00
Owner
No description provided.
The design and plan of the backend rewritten in Rust (ROADMAP.md 2.0.0), from the user's brief:
1:1 behaviour, better code, performance, parallel processing, less memory, LMDB through heed, a
third folder, built incrementally against the real game, the AI last. A Cargo workspace mirroring
the TypeScript layers; the game thread owning the world; how 1:1 is checked by tools (fixtures,
seeded generation, shadow ticks, schema conformance, recorded sessions, view diffs, the TypeScript
minds as an oracle through a sidecar); nine phases; the JavaScript semantics to mirror; ten
decisions for the user. PLAN.md and AGENTS.md point at it. Nothing built yet.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
RUST.md §9 records the user's answers: the live game switches only after phase 7 (the TypeScript
minds through the sidecar a test oracle alone), MessagePack rows, the configs copied into the Rust
folder from phase 0 with a drift test, a simple management web interface on the local network in
place of an admin socket, float tolerances, the test-only TypeScript additions, one AI crate, reads
on the game thread, axum, the agents' tooling ported. The phases adjusted to them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Checked claim by claim against the TypeScript backend and fixed: the tick's order
(simulateTick), the crates layered by what is actually imported (galaxy_core for the
enums and rows, galaxy_protocol for the wire and the minds' types, config checks with
the crates owning their rules, AI modules the services use ported early), a Map's order
(deletes, undo to the end, ordered index sets), the value checks kept, jsonb's key
order, Fastify's coercion and code-point lengths, the JavaScript semantics (ToInt32,
toFixed ties, Number::toString, trim, slices, random-comparator sorts, the locale),
V8's floats against Rust's measured, the libraries' versions.

Added: §3.1, the TypeScript and Rust backends benchmarked side by side at every phase;
dependencies kept to the minimum (§6, §8: about 100 crates in the tree from about 230,
our own WebSocket, JWT, logger, validators and ids, no PostgreSQL client); the code's
layout Rust's own (§2.1, §2.10); the user's answers to the review's calls (§9, 11-14).
PLAN.md's 2.0 section follows (its measurements dated before ship stacks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first of RUST.md's pieces, each checked in the real web client: a Cargo
workspace (imperfect-galaxy-rust/), the world's 52 tables generated from
world/schema.ts (scripts/exportRustSchema.mjs) with their order, indexes,
keys, value checks and transactions, LMDB through heed, the world's export
(scripts/exportWorld.mjs) and galaxy_tools import (a dump too), views by
area with their deltas, our own WebSocket with permessage-deflate, login,
/auth/me and logout. RUST.md, PLAN.md and AGENTS.md say what is built and
how to run it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Piece 2, the player's colonies and fleets on the map; piece 3, the read-only
screens; piece 4, the tick: every step ported and shadow-diffed equal on the
dump, a game day forward equal at its end, the views with detections and
shots, the game log, the game master (galaxy_llm over rustls), benchmarks
against TypeScript (compareBackends.mjs: tick 74 / 13 ms, sync 11 / 1.5 ms,
RSS 419 / 137 MB) and shadow scenarios for the rarer paths.

Piece 5, the players' actions: all 99 routes, every request checked against
its route's schemas as Fastify does (route_schemas.json from
exportRouteSchemas.mjs; the validator matching Fastify's ajv on 7,474
inputs), registration, passwords, settings, the reset, the starter ship at
login, rate limits and IP bans kept in the store. Request scripts replayed
on both backends (replayRequests.mjs, galaxy_tools replay): the answers and
the worlds after them equal for every route group and malformed requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Piece 6: saving on a thread of its own, the configs checked at boot with
configChecks.ts's words (6,013 mutated configs agreeing), update notices, the
management interface (Status, Notices, Save, Backups, Game master, AIs),
galaxy_tools backup, restore, export, dump, report, fix and notice, the systemd
unit, dev/clientFlow.mjs (the web client's flow against a running backend),
clippy pedantic, rustfmt and cargo deny clean; a 30-minute live test and the
switch rehearsed from a running TypeScript server.

Piece 7: galaxy_ai, the whole of src/ai, judged by TypeScript minds' turns
recorded at the mind's boundary (scripts/recordAiTurns.mjs, the AI harness with
AI_TURNS_DIR) and replayed by galaxy_tools ai-turns: 42,206 of 42,208 turns ask
the same requests and end with the same memory and line (two differ by one ulp
of atan2). The runtime, gateway and spawner: the dump ticked a game day with 20
AIs on both backends ends with every row equal; a 30-minute live test with all
150 AIs played clean. The designer's reused-parts key kept on its value: the
mind 12x faster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Construction sites seen by others: within a player's sensor range (no
  roll) and through Intel allies' intel after its hop delay, then live
  (IntelKind SITE with AllySiteIntel, FOREIGN_SITE in memory); the view's
  foreignSites as changes, none in an AI's view; drawn and paneled in the
  web client.
- Deuterium the only fuel: the Fusion Reactor burns Deuterium alone at
  today's rate, probes launch with Deuterium alone, reactor modules still
  burning Helium-3 rewritten once at load; the AI's fuel and loads follow;
  the client's words, Galactopedia and changelog.
- The web unit tests read the Rust configs and sources now that the
  TypeScript backend is gone; galaxy_ai doc backticks for clippy.
- AGENTS.md, PLAN.md and RUST.md updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only what reaches the screen stays in Excalibur's scene: a margin of a fifth
of the screen's larger side, culled every sixteenth of the screen (1,690
entities to 385 on the phone stand-in, the main thread busy 52 % to 24 %). A
star is fewer entities and textures: its picture in a group on its actor, its
name and class one label, one corona canvas a spectral type.

The map's pictures go to the graphics card one at a time just after the game
starts and stay there, past Excalibur's 60 s: they had all come in the first
zoom out's long frames (62 MB of uploads to 18 MB). A small note in the bottom
left corner says so while they load.

mapBenchmark.mjs works again without the TypeScript backend in the tree
(--data for a Rust world, --backend-dir for a checkout of the old one), with
WebGL counters, --inject and --shot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its working directory is /opt/imperfect-galaxy, holding this folder's contents
as the TypeScript backend's unit had its own: the binary, configs, .env, the
world, backups and log.log. It names its config folder rather than relying on
the build's path, and its comments say how to move a live game off the
TypeScript service, whose export script goes with that backend's folder.
PRISMA.md went with the backend it was about.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The version in the web client and the Rust workspace, so open pages reload
onto this release. The unit runs the installed binary: a deploy replaces the
binaries and config/ and never empties the folder, which holds the world. Its
comments say how to install, update and move the live game off PostgreSQL,
for which exportWorld.mjs is kept in imperfect-galaxy-rust/dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aslan merged commit 5e9794c7f3 into main 2026-10-30 13:40:59 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aslan/imperfect-galaxy!59
No description provided.