mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5110] Game checkpoints duplicate every captured snapshot blob forever — no retention cap, O(n²) shard rewrites #2827
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2827
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Aug 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5110
Originally assigned to: @kolacheee on GitHub.
The problem
Game checkpoints store full immutable copies of what they capture —
snapshotData(the tracker snapshot),spatialSnapshotData(the World Map snapshot), and nowengineStateData(the turn-game/Experience state blobs, added by the #5102 checkpoint-restore fix). Nothing bounds how many checkpoints a chat accumulates: auto-checkpoints fire at session start, session end, and on every combat start and end, and only manual deletion removes one.Because
game_checkpointsis chat-sharded and the file store keeps tables in memory, a long campaign multiplies every captured blob into permanent heap and makes each new checkpoint re-serialize the chat's whole checkpoint shard — an O(n²) write pattern. With a game-surface Experience whose world save approaches its 256 KB cap, tens of sessions of auto-checkpoints add up to tens of megabytes duplicated per chat. This matters most on Android, where the whole app fights a ~1 GB heap (#4730 has the background).listForChatalso materializes every stored blob just to strip the fields before returning the list.Try it yourself
Create a Game Mode chat, enter and leave combat a dozen times, and inspect the chat's
game_checkpointsshard underdata/storage/tables/— every row carries full copies of all captured snapshots, even when nothing changed between checkpoints.Suggested direction
Any of these would help, roughly in order of value:
Found during the adversarial review of PR #5106 (the fix there was correctness of what is captured; this issue is about how much of it accumulates).