From 38176b23579025aee2e1d3687d16b4748f96bead Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 22 Nov 2026 17:44:12 +0000 Subject: [PATCH] Version Packages --- .changeset/fixed-loop-step-in-frame.md | 7 --- .changeset/netcode-events-across-saves.md | 21 --------- .changeset/netcode-one-message-per-frame.md | 26 ----------- packages/browser/CHANGELOG.md | 7 +++ packages/browser/package.json | 2 +- packages/core/CHANGELOG.md | 8 ++++ packages/core/package.json | 2 +- packages/devtools/CHANGELOG.md | 10 +++++ packages/devtools/package.json | 2 +- packages/devtools/src/internal/version.ts | 2 +- packages/math/CHANGELOG.md | 7 +++ packages/math/package.json | 2 +- packages/netcode/CHANGELOG.md | 49 +++++++++++++++++++++ packages/netcode/package.json | 2 +- packages/oxlint-plugin/CHANGELOG.md | 4 ++ packages/oxlint-plugin/package.json | 2 +- packages/pixi/CHANGELOG.md | 6 +++ packages/pixi/package.json | 2 +- packages/render/CHANGELOG.md | 7 +++ packages/render/package.json | 2 +- packages/tools/CHANGELOG.md | 4 ++ packages/tools/package.json | 2 +- packages/tools/src/internal/version.ts | 2 +- 23 files changed, 113 insertions(+), 65 deletions(-) delete mode 100644 .changeset/fixed-loop-step-in-frame.md delete mode 100644 .changeset/netcode-events-across-saves.md delete mode 100644 .changeset/netcode-one-message-per-frame.md diff --git a/.changeset/fixed-loop-step-in-frame.md b/.changeset/fixed-loop-step-in-frame.md deleted file mode 100644 index 63f0428c..00000000 --- a/.changeset/fixed-loop-step-in-frame.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@typeonce/ritmo": minor ---- - -`FixedLoop`'s `update` gets a second argument, `at: FixedLoop.StepInFrame`: `at.last` is true on the frame's last update (by the accumulator and `maxStepsPerFrame`), for code that acts once per frame after its steps, as a networked session does to send what the frame said in one message. An `update` that takes no arguments is unchanged. - -The `ritmo` skill's netcode playbook says that a session sends one message per link per frame and repeats what was lost, so a link sends each message as it is (no outbox or batching of its own), that a game's `update` around `session.update` passes the loop's arguments through, and to measure with `status().sent`. diff --git a/.changeset/netcode-events-across-saves.md b/.changeset/netcode-events-across-saves.md deleted file mode 100644 index feceae0c..00000000 --- a/.changeset/netcode-events-across-saves.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -"@typeonce/ritmo-netcode": minor ---- - -**`session.events` confirms the ticks a save makes final.** A save (the match's start, `resync()`, a page seated again after it loaded again, a hidden page back under `"resync-on-return"`) is the host's world as it ran, guesses of other seats' input included. Until now every peer, the host too, withdrew the ticks it had run before the save but not confirmed yet, and never confirmed them: their events were gone without a word. Under rollback that is up to `maxRollback` ticks on every page at each save: a page that reloads mid-match lets the others run on guesses of its seat until it is back, so a lap, a checkpoint, or a sound of that stretch never reached any page. The page the save seated was not affected: it confirms every tick from the save on, as before. - -- The host confirms every tick it ran before its save. -- The save carries the inputs each of its last ticks ran with on the host. Every other peer confirms the ticks it ran with the same inputs, from a tick both confirmed; what `predicted()` handed out of them stands. -- The ticks before the save that a peer ran otherwise, confirmed otherwise (it had an input the host's world never got), or did not run at all, are reported by `lost()` with the new reason `"save"`, and what was predicted of them is withdrawn. A page the save seats for its first match (one that loaded again) is told nothing of the ticks before it: the save's world holds them. -- Fixed: a peer ahead of the host can confirm the save's own tick and the `inputDelay` ticks after it; `lost()` reported one tick fewer when a resync ran them again with other events. - -The sync message carries the inputs (protocol version 6, with this release's other session changes): every page of a match runs this release. - -**Breaking (types only):** `EventsLost["reason"]` is `"unread" | "resync" | "save"`. A `switch` over it adds a case; ticks reported `"save"` are ones whose events this peer cannot tell, like `"resync"`: - -```ts -const lost = hits.lost() -if (lost !== undefined && lost.reason !== "unread") { - // "resync" or "save": the match ran ticks lost.from to lost.to otherwise than this page acted on -} -``` diff --git a/.changeset/netcode-one-message-per-frame.md b/.changeset/netcode-one-message-per-frame.md deleted file mode 100644 index 02f2695e..00000000 --- a/.changeset/netcode-one-message-per-frame.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -"@typeonce/ritmo-netcode": minor ---- - -**A session sends one message per link per frame, and lighter ones.** Until now a session handed its links a message for each thing it said (inputs, checksums, pings, pongs), every step, so a frame that ran several steps sent several of each, and a relay that bills per message (a Cloudflare Durable Object) paid for all of them. Now everything one frame says goes out as one message per link, a bundle: driven by `session.update` from a `FixedLoop`, one per host frame however many steps it ran; each `advance` called directly is a frame of its own. - -- A bundle names the protocol, the sender, and its epoch once. It still carries every input a peer has not acknowledged (a lost message costs nothing the next one does not repeat), but writes each distinct input once and which of them each tick had: a held input is two numbers however many ticks it was held. Acknowledgements are written as how far behind the sender's tick they are. -- A message that must survive loss (a seat reported gone, a change of who plays) goes out with the next five frames' bundles instead of five times in one frame. A page that hides still sends its announcement five times at once: no frame follows. -- `status().sent` counts the messages handed to the links and their bytes in UTF-8. - -Over 120 ms with 60 ms of jitter and 5% loss, on pages at 60 Hz that sometimes run two or three steps in a frame: 2 peers went from 139 messages and 62 KiB a second to 97 and 16 to 23 KiB; 8 peers from 728 and 290 KiB to 387 and 73 to 103 KiB (the lower figure for input held 20 frames, the higher for input that changes nearly every frame). - -**Breaking: every page of a match must run this version.** The session protocol changed (version 6): a peer on 0.26 or older ends with `ProtocolMismatch`. - -**Breaking: the function `session.update(...)` returns takes the loop's two arguments.** Passed to `FixedLoop.start` as it is, nothing changes. Called from the game's own `update`, pass them through, so the session knows the frame's last step: - -```diff - const tick = session.update({ input: readInput, onHalted }) - FixedLoop.start({ - ...loop, -- update: () => tick(), -+ update: (seconds, at) => tick(seconds, at), - }) -``` - -A link that batched the session's messages itself (an outbox flushed once per task) can send each as it is now. diff --git a/packages/browser/CHANGELOG.md b/packages/browser/CHANGELOG.md index 8ca686f0..17f6074c 100644 --- a/packages/browser/CHANGELOG.md +++ b/packages/browser/CHANGELOG.md @@ -1,5 +1,12 @@ # @typeonce/ritmo-browser +## 0.27.0 + +### Patch Changes + +- Updated dependencies [7828818] + - @typeonce/ritmo@0.27.0 + ## 0.26.0 ### Patch Changes diff --git a/packages/browser/package.json b/packages/browser/package.json index 6856688d..5264748d 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/ritmo-browser", - "version": "0.26.0", + "version": "0.27.0", "description": "Browser fixed-step loop, keyboard, gamepad, pointer, and touch actions, merged input, local multiplayer, and input capture for Ritmo", "author": "Sandro Maglione", "license": "MIT", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 61769c69..b93fdfd8 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,13 @@ # @typeonce/ritmo +## 0.27.0 + +### Minor Changes + +- 7828818: `FixedLoop`'s `update` gets a second argument, `at: FixedLoop.StepInFrame`: `at.last` is true on the frame's last update (by the accumulator and `maxStepsPerFrame`), for code that acts once per frame after its steps, as a networked session does to send what the frame said in one message. An `update` that takes no arguments is unchanged. + + The `ritmo` skill's netcode playbook says that a session sends one message per link per frame and repeats what was lost, so a link sends each message as it is (no outbox or batching of its own), that a game's `update` around `session.update` passes the loop's arguments through, and to measure with `status().sent`. + ## 0.26.0 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 4e137512..5939202e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/ritmo", - "version": "0.26.0", + "version": "0.27.0", "description": "The agent-first, type-safe ECS runtime for TypeScript", "author": "Sandro Maglione", "license": "MIT", diff --git a/packages/devtools/CHANGELOG.md b/packages/devtools/CHANGELOG.md index af1687c4..7f0f0302 100644 --- a/packages/devtools/CHANGELOG.md +++ b/packages/devtools/CHANGELOG.md @@ -1,5 +1,15 @@ # @typeonce/ritmo-devtools +## 0.27.0 + +### Patch Changes + +- Updated dependencies [7828818] +- Updated dependencies [e7078d5] +- Updated dependencies [7828818] + - @typeonce/ritmo@0.27.0 + - @typeonce/ritmo-netcode@0.27.0 + ## 0.26.0 ### Minor Changes diff --git a/packages/devtools/package.json b/packages/devtools/package.json index 2b5a4347..bbff0d0a 100644 --- a/packages/devtools/package.json +++ b/packages/devtools/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/ritmo-devtools", - "version": "0.26.0", + "version": "0.27.0", "description": "Headless debug sessions, trace history, text reports, replays, and fuzzing for Ritmo runtimes", "author": "Sandro Maglione", "license": "MIT", diff --git a/packages/devtools/src/internal/version.ts b/packages/devtools/src/internal/version.ts index c5286885..269f9042 100644 --- a/packages/devtools/src/internal/version.ts +++ b/packages/devtools/src/internal/version.ts @@ -3,4 +3,4 @@ * `package.json` by `scripts/sync-version.ts` (run by \`pnpm version-packages\`) * and checked by a test. */ -export const libraryVersion = "0.26.0" +export const libraryVersion = "0.27.0" diff --git a/packages/math/CHANGELOG.md b/packages/math/CHANGELOG.md index 277f5837..ca78e046 100644 --- a/packages/math/CHANGELOG.md +++ b/packages/math/CHANGELOG.md @@ -1,5 +1,12 @@ # @typeonce/ritmo-math +## 0.27.0 + +### Patch Changes + +- Updated dependencies [7828818] + - @typeonce/ritmo@0.27.0 + ## 0.26.0 ### Patch Changes diff --git a/packages/math/package.json b/packages/math/package.json index 8cb671cf..a41db0d2 100644 --- a/packages/math/package.json +++ b/packages/math/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/ritmo-math", - "version": "0.26.0", + "version": "0.27.0", "description": "The 2D helpers most Ritmo games would otherwise rewrite (vectors, angles, swept collision, flow field), plain data in and out, built on Ops so they replay the same on every engine", "author": "Sandro Maglione", "license": "MIT", diff --git a/packages/netcode/CHANGELOG.md b/packages/netcode/CHANGELOG.md index 3b9bbf65..873417fb 100644 --- a/packages/netcode/CHANGELOG.md +++ b/packages/netcode/CHANGELOG.md @@ -1,5 +1,54 @@ # @typeonce/ritmo-netcode +## 0.27.0 + +### Minor Changes + +- e7078d5: **`session.events` confirms the ticks a save makes final.** A save (the match's start, `resync()`, a page seated again after it loaded again, a hidden page back under `"resync-on-return"`) is the host's world as it ran, guesses of other seats' input included. Until now every peer, the host too, withdrew the ticks it had run before the save but not confirmed yet, and never confirmed them: their events were gone without a word. Under rollback that is up to `maxRollback` ticks on every page at each save: a page that reloads mid-match lets the others run on guesses of its seat until it is back, so a lap, a checkpoint, or a sound of that stretch never reached any page. The page the save seated was not affected: it confirms every tick from the save on, as before. + + - The host confirms every tick it ran before its save. + - The save carries the inputs each of its last ticks ran with on the host. Every other peer confirms the ticks it ran with the same inputs, from a tick both confirmed; what `predicted()` handed out of them stands. + - The ticks before the save that a peer ran otherwise, confirmed otherwise (it had an input the host's world never got), or did not run at all, are reported by `lost()` with the new reason `"save"`, and what was predicted of them is withdrawn. A page the save seats for its first match (one that loaded again) is told nothing of the ticks before it: the save's world holds them. + - Fixed: a peer ahead of the host can confirm the save's own tick and the `inputDelay` ticks after it; `lost()` reported one tick fewer when a resync ran them again with other events. + + The sync message carries the inputs (protocol version 6, with this release's other session changes): every page of a match runs this release. + + **Breaking (types only):** `EventsLost["reason"]` is `"unread" | "resync" | "save"`. A `switch` over it adds a case; ticks reported `"save"` are ones whose events this peer cannot tell, like `"resync"`: + + ```ts + const lost = hits.lost() + if (lost !== undefined && lost.reason !== "unread") { + // "resync" or "save": the match ran ticks lost.from to lost.to otherwise than this page acted on + } + ``` +- 7828818: **A session sends one message per link per frame, and lighter ones.** Until now a session handed its links a message for each thing it said (inputs, checksums, pings, pongs), every step, so a frame that ran several steps sent several of each, and a relay that bills per message (a Cloudflare Durable Object) paid for all of them. Now everything one frame says goes out as one message per link, a bundle: driven by `session.update` from a `FixedLoop`, one per host frame however many steps it ran; each `advance` called directly is a frame of its own. + + - A bundle names the protocol, the sender, and its epoch once. It still carries every input a peer has not acknowledged (a lost message costs nothing the next one does not repeat), but writes each distinct input once and which of them each tick had: a held input is two numbers however many ticks it was held. Acknowledgements are written as how far behind the sender's tick they are. + - A message that must survive loss (a seat reported gone, a change of who plays) goes out with the next five frames' bundles instead of five times in one frame. A page that hides still sends its announcement five times at once: no frame follows. + - `status().sent` counts the messages handed to the links and their bytes in UTF-8. + + Over 120 ms with 60 ms of jitter and 5% loss, on pages at 60 Hz that sometimes run two or three steps in a frame: 2 peers went from 139 messages and 62 KiB a second to 97 and 16 to 23 KiB; 8 peers from 728 and 290 KiB to 387 and 73 to 103 KiB (the lower figure for input held 20 frames, the higher for input that changes nearly every frame). + + **Breaking: every page of a match must run this version.** The session protocol changed (version 6): a peer on 0.26 or older ends with `ProtocolMismatch`. + + **Breaking: the function `session.update(...)` returns takes the loop's two arguments.** Passed to `FixedLoop.start` as it is, nothing changes. Called from the game's own `update`, pass them through, so the session knows the frame's last step: + + ```diff + const tick = session.update({ input: readInput, onHalted }) + FixedLoop.start({ + ...loop, + - update: () => tick(), + + update: (seconds, at) => tick(seconds, at), + }) + ``` + + A link that batched the session's messages itself (an outbox flushed once per task) can send each as it is now. + +### Patch Changes + +- Updated dependencies [7828818] + - @typeonce/ritmo@0.27.0 + ## 0.26.0 ### Minor Changes diff --git a/packages/netcode/package.json b/packages/netcode/package.json index 1cbe8bb4..5b7d3213 100644 --- a/packages/netcode/package.json +++ b/packages/netcode/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/ritmo-netcode", - "version": "0.26.0", + "version": "0.27.0", "description": "Rollback and lockstep sessions over any transport for Ritmo: input timelines, checkpoint history, pacing, resync, and desync checks", "author": "Sandro Maglione", "license": "MIT", diff --git a/packages/oxlint-plugin/CHANGELOG.md b/packages/oxlint-plugin/CHANGELOG.md index fc81894c..292e01a9 100644 --- a/packages/oxlint-plugin/CHANGELOG.md +++ b/packages/oxlint-plugin/CHANGELOG.md @@ -1,5 +1,9 @@ # @typeonce/oxlint-plugin-ritmo +## 0.27.0 + +No changes in this release. + ## 0.26.0 No changes in this release. diff --git a/packages/oxlint-plugin/package.json b/packages/oxlint-plugin/package.json index 487a8d10..d5f081f1 100644 --- a/packages/oxlint-plugin/package.json +++ b/packages/oxlint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/oxlint-plugin-ritmo", - "version": "0.26.0", + "version": "0.27.0", "description": "Oxlint rules for Ritmo games: deterministic, headless simulation code and checked runtime results", "author": "Sandro Maglione", "license": "MIT", diff --git a/packages/pixi/CHANGELOG.md b/packages/pixi/CHANGELOG.md index 522aa8e7..fd087ed7 100644 --- a/packages/pixi/CHANGELOG.md +++ b/packages/pixi/CHANGELOG.md @@ -1,5 +1,11 @@ # @typeonce/ritmo-pixi +## 0.27.0 + +### Patch Changes + +- @typeonce/ritmo-render@0.27.0 + ## 0.26.0 ### Patch Changes diff --git a/packages/pixi/package.json b/packages/pixi/package.json index e2086878..c96710b4 100644 --- a/packages/pixi/package.json +++ b/packages/pixi/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/ritmo-pixi", - "version": "0.26.0", + "version": "0.27.0", "description": "Pixi container adapter for Ritmo render-node registries", "author": "Sandro Maglione", "license": "MIT", diff --git a/packages/render/CHANGELOG.md b/packages/render/CHANGELOG.md index 8efcf327..ed739b0d 100644 --- a/packages/render/CHANGELOG.md +++ b/packages/render/CHANGELOG.md @@ -1,5 +1,12 @@ # @typeonce/ritmo-render +## 0.27.0 + +### Patch Changes + +- Updated dependencies [7828818] + - @typeonce/ritmo@0.27.0 + ## 0.26.0 ### Patch Changes diff --git a/packages/render/package.json b/packages/render/package.json index d50f9b5c..61296fac 100644 --- a/packages/render/package.json +++ b/packages/render/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/ritmo-render", - "version": "0.26.0", + "version": "0.27.0", "description": "Renderer-agnostic entity-to-node mirroring for Ritmo", "author": "Sandro Maglione", "license": "MIT", diff --git a/packages/tools/CHANGELOG.md b/packages/tools/CHANGELOG.md index 7e5c2334..3f994afe 100644 --- a/packages/tools/CHANGELOG.md +++ b/packages/tools/CHANGELOG.md @@ -1,5 +1,9 @@ # @typeonce/ritmo-tools +## 0.27.0 + +No changes in this release. + ## 0.26.0 No changes in this release. diff --git a/packages/tools/package.json b/packages/tools/package.json index 6f206860..fc198b86 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/ritmo-tools", - "version": "0.26.0", + "version": "0.27.0", "description": "Asset tools for games made with Ritmo, for agents: fixes AI-made pixel art and animation sheets onto a true pixel grid and a palette, makes normal maps for art a game lights, keeps game sounds as JSON recipes, writes game music as JSON songs built around a hum, and draws pixel art effects as code, each with a review page for a person, pixel art included", "author": "Sandro Maglione", "license": "MIT", diff --git a/packages/tools/src/internal/version.ts b/packages/tools/src/internal/version.ts index 9fe83579..5a097958 100644 --- a/packages/tools/src/internal/version.ts +++ b/packages/tools/src/internal/version.ts @@ -3,4 +3,4 @@ * `package.json` by `scripts/sync-version.ts` (run by `pnpm version-packages`) * and checked by a test. */ -export const toolsVersion = "0.26.0" +export const toolsVersion = "0.27.0"