Logo : Checkpointing Assembly State For Resume

Checkpointing Assembly State For Resume

Organisation
runtime-si
checkpointing-assembly-state-for-resume

Saves and restores the state of a long assembly run (a 550-piece jigsaw, a LEGO build, a domino layout) so a run stopped after hours resumes where it was. save_checkpoint writes one versioned JSON checkpoint atomically (temp file, fsync, rename) with a SHA-256 over its payload - task, step, placed pieces / bricks / items with cells and poses, the pending queue, backtracking-a-wrong-placement's ledger, the reference snapshot and items for detecting-disturbed-pieces-by-snapshot-diff, arms and what they hold, timestamps and an activity stream of what changed - keeping the newest N. resume_from_checkpoint loads the newest checkpoint that passes its hash (migrating older schema versions), compares it with a fresh observation through the snapshot-diff skill and, for bricks, verifying-build-against-model, and lists the items to re-verify before going on. Use after every few verified placements of a long run (save), and when a stopped run starts up again (resume); files and CPU only, no motion.

Présentation

Éditeurruntime-si
DépôtRoboSkillHub
Nom de la compétencecheckpointing-assembly-state-for-resume
Étoiles
242
Forks
27
Fichiers inclus
6
LicenceApache-2.0
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Fichiers inclus : 6

    Des scripts, des gabarits et des références que le modèle peut consulter pendant son travail. Les fichiers sont en lecture seule et ne sont jamais exécutés.

  • Open source

    Publiée par runtime-si sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Checkpointing Assembly State For Resume dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/runtime-si/RoboSkillHub/tree/main/skills/checkpointing-assembly-state-for-resume
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/runtime-si/RoboSkillHub.git /tmp/RoboSkillHub
mkdir -p .claude/skills
cp -r /tmp/RoboSkillHub/skills/checkpointing-assembly-state-for-resume .claude/skills/checkpointing-assembly-state-for-resume
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Checkpointing Assembly State For Resume dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Checkpointing Assembly State For Resume dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Checkpointing Assembly State For Resume n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

checkpointing-assembly-state-for-resume

A 550-piece jigsaw takes a robot 5-9 hours; a LEGO set or a domino field is similar. Over that time something stops the run - a motor fault, a crash, the end of the day. Graph-as-Policy's graph state lives in the process; this skill keeps the task's state on disk so a new process can pick it up, and then asks whether the world still looks like that state before building on it.

How it composes

  • Save after every verified step (or every few): the forward loop's placements (choosing-next-piece-and-slot / backtracking-a-wrong-placement: {piece, col, row, score?, margin?, confidence?, verified?, locked?}), the bricks placed so far (planning-brick-assembly-order's sequence entries: {id, seq, step, cell {x, y, layer, rotation}, size, colour, arm, ...}), generic items ({id, pose?, cell?, mask? | polygon_px? | box?} - dominoes, parts), the pending queue (choose_next's queue or the planner's remaining sequence), in_progress (the job started but not finished: {piece | id, col, row, arm, phase}), the ledger (ledger_path of backtracking-a-wrong-placement, read and embedded with its hash), the arms ({id, joints?, ee_pose?, gripper?, holding?}), grid, and a reference snapshot: snapshot_now (one robot.get_observation, cut to camera_name), reference_snapshot (an Observation or CameraFrame) or reference_snapshot_path (.npz with rgb / depth_m / K / pose, or an image; its arrays are copied in, so the file may go away). Take the snapshot only after a step passed its check; between snapshots the last one is carried over, so pieces placed since are known not to be in it.
  • Resume once at start-up, before the arms move: resumed - go on with pending; resumed_with_rechecks - park the arms (returning-to-a-recorded- pose), look for lost_items, run the jigsaw / brick checks on the recheck ids (a moved piece: nudge it back or re-seat it; missing / misplaced / unseated bricks: verifying-build-against-model's repairs), then go on; no_checkpoint - start fresh; state_mismatch - re-perceive the board (localizer, build check) and save a new checkpoint. The returned placements, bricks, pending, ledger_path, pieces are in the formats the other skills take.

save_checkpoint

  1. One file per save, <task>.<seq:08d>.ckpt.json in checkpoint_dir: {"schema", "schema_version": 3, "sha256", "payload"}, the hash over the payload's canonical JSON (sorted keys, no spaces). Written to a temp file in the same directory, flushed, fsynced, renamed over the name, then the directory is fsynced: a reader sees the old set of files or the old set plus the whole new one.
  2. Arrays (snapshot RGB / depth, item masks) go to blobs/<sha256>.npy.z (zlib-compressed .npy, named by the hash of the uncompressed bytes, written atomically before the checkpoint that names them); the payload holds {"$blob", "dtype", "shape"}. An unchanged snapshot is stored once. Arrays up to 64 numbers (a pose, K, joints) stay inline.
  3. Every save is the whole state except the reference, which is carried from the previous checkpoint unless a new one is given (carry_reference). Jigsaw placements become snapshot-diff items by cell when grid is given (the diff skill's grid forms); items with a mask, polygon or box are used as they are; or pass reference_items.
  4. Activity stream (py_trees' blackboard ActivityStream, adapted): the state is viewed as keys (/placements/<piece>, /bricks/<id>, /arms/<id>, /ledgers/<name>, /pending, /step_index, ...) and every key INITIALISED, WRITTEN or UNSET since the previous checkpoint is appended with its previous and current value and the step; the newest 500 are kept.
  5. Rotate: the newest keep (5) checkpoints of the task stay; blobs no checkpoint in the directory references are deleted once 10 minutes old.

resume_from_checkpoint

  1. Pick: the task's files newest first (or every task's with no task_id); the first that parses, matches its hash, is not from a newer schema and has a task and step is used. Each one skipped is listed in skipped with the reason; leftover temp files of a killed save are listed in stale_temp_files and ignored.
  2. Migrate older versions step by step: v1, a bare run state as the jigsaw / LEGO skills take it (placements, or a planner sequence with placed - the count already built -, ledger / ledger_path, queue, snapshot_path; no envelope, no hash); v2, the first envelope (step, queue, arms keyed by id, one snapshot_path, saved_at in unix seconds). A v1 file has no hash to check.
  3. Ledgers: the file at the saved path is compared with the embedded copy. Same - fine. Missing or unreadable - the copy is written back (restore_ledgers). More events than the copy - backtracking decided after the checkpoint, its actions may be half done: the event's piece and every piece its actions name are rechecked (ledger_after_checkpoint), and the newer file is returned.
  4. What the stop left behind: a piece an arm was holding is lost (held_when_stopped, lost_items); the in_progress job's piece is rechecked; a placement saved with verified: false too.
  5. Snapshot check: one fresh robot.get_observation (or current) goes to detecting-disturbed-pieces-by-snapshot-diff with the stored reference and items (and grid, diff_args): moved / lost items are rechecked with the shift, rotation and depth change it measured, occluded ones too; an item it calls unchanged although 40 % of its pixels changed is rechecked as appearance_changed (a removed thin piece can still match the table texture under it); unexplained changes become unexpected_object entries; items removed from the state since the snapshot (backtracking lifted them) are expected to be gone and ignored. Unregistrable views, or a quarter (and 3) of the items moved, give state_mismatch.
  6. Build check (bricks with a stored build - plate_pose, plate_studs, system, camera_name, args): the placed bricks are the target of verifying-build-against-model, seen through the fresh frame's depth or build_observed bricks; missing, misplaced, wrong_colour, unseated, extra and unverified bricks are rechecked; a quarter (and 3) wrong gives state_mismatch. Colour is off unless build.check_colour.
  7. Everything else that no check cleared is rechecked: placed_after_reference when the snapshot was compared but the piece is newer, not_checked when no check could run (no reference, no observation, a damaged snapshot blob, the sibling skill not installed). verify: none skips the checks and returns the state as saved.

Both sibling skills are loaded from the skills installed beside this one (or a GAP_SKILLS_PATH root); when one is missing its check is skipped and said so in detail.

Measured

All on the CPU (Intel Core Ultra 7 265KF, 20 cores), no robot, no GPU and no simulator: nothing moves, so the simulation check does not apply. tests/bundles/_checkpoint_eval.py reproduces every number below.

Killed writers (--part kill, 200 trials): a separate process saves a 550-piece jigsaw state (placements, the localizer records of all 550 pieces, a 40-event ledger file, a new 640 x 480 RGB-D snapshot every save, keep 5) in a loop and is SIGKILLed at a random moment after 1-3 saves. Resume returned a valid checkpoint 200 / 200 times: the last acknowledged one 148 times, the one being written (renamed but not yet acknowledged) 52 times, never an older one, no file skipped; 20 kills left a temp file, listed and ignored; the ledger compared same every time. SIGKILL does not lose the page cache, so this tests the rename protocol, not power loss (see Limits).

Damaged files (--part corrupt, 400 trials): one random byte of the newest checkpoint changed (200) or the file cut at a random length (200): 400 / 400 skipped with the reason and the previous checkpoint returned; no damaged state was ever accepted. (A flip that produced invalid UTF-8 crashed the reader before this run; fixed.)

Disturbed boards (--part disturb, seeds 100-119): the synthetic RGB-D boards of detecting-disturbed-pieces-by-snapshot-diff's tests (15 jigsaw pieces, 8 bricks or 8 standing dominoes; the overhead camera at 1 m or the wrist camera at 25 cm; sensor noise per frame), saved with a reference snapshot and the items' masks, resumed against a new render. 20 boards per row; "found" = disturbed items in recheck; "extra" = other items rechecked per board.

family / camerauntouched: resumedone moved 3-6 mm: foundone removed: foundtwo moved: found (mismatch)sweep 40 % moved: state_mismatchextra per board (mean / max)
jigsaw / overhead20/2020/2020/2040/40 (0)20/200-1.1 / 3
jigsaw / wrist20/2020/2020/2040/40 (3)20/200-1.15 / 3
bricks / overhead20/2020/2020/2040/40 (0)20/200 / 0
bricks / wrist20/2020/2020/2040/40 (0)20/200 / 0
dominoes / overhead20/2020/2020/2040/40 (0)20/200 / 0
dominoes / wrist20/2020/2020/2040/40 (2)20/200-0.2 / 1
  • The extra rechecks are the moved item's direct neighbours (the diff skill flags a slid jigsaw piece's neighbour whose footprint it overlaps); the sweep rows found 599 of 600 moved items.
  • "Two moved" ended state_mismatch on 5 of 120 small boards: two moved plus one flagged neighbour is 3 of 8 dominoes (or 4 of 15 pieces), over the quarter. On a 550-piece board the fraction decides, not the count.
  • Before the appearance_changed guard, 2 of 20 removed jigsaw pieces (overhead) resumed unflagged: the diff skill matched them to the table under them at 0.56-0.59 with 48-86 % of their pixels changed. The 0.4 threshold was then set on separate seeds (0-19: unmoved items read at most 0.21 of 3475); the table is the rerun on seeds 100-119.

Brick builds (--part build, 20 random 8-brick LEGO builds on a 12 x 12 plate, wrist D405 depth with the station noise model): untouched 20 / 20 resumed; a top brick removed 20 / 20 rechecked first as missing; a top brick moved one stud 19 / 20 first as misplaced (1 as an extra brick plus the brick missing), every one resumed_with_rechecks.

Recorded station frames (overhead Orbbec, RGB only, 5 sessions, the scene static; not committed): 24 pixel-square items on the table, saved from one frame's PNG through reference_snapshot_path, resumed against the next frame (10 consecutive pairs and first-to-last per session): 55 / 55 resumed, no recheck.

Time (--part timing, median of 15): save of the 550-piece state 36 ms (a 498 kB file), 79 ms with a new 640 x 480 RGB-D snapshot, 51 ms with the snapshot carried over; resume with verify: none 11 ms. A resume with the snapshot check is the diff skill's time: 0.7-0.8 s for 15 items at 640 x 480 alone, median 1.0-1.8 s with 12 resumes running at once.

Unit tests (tests/bundles/test_checkpointing_assembly_state_for_resume.py, 31): the envelope and round trip, rotation, the activity stream, a crash before the rename, torn / flipped / empty files, all files corrupt, writers SIGKILLed at random moments (4 runs), a corrupt snapshot blob, blob collection, a snapshot file deleted after saving, unstorable values; v1 bare jigsaw state, v1 planner sequence, v2 envelope, a newer version skipped, an edited v2 file, a migrated state saved again; held, in-progress and unverified items; no observation; a grid mismatch; a newer ledger file and a missing one; an untouched, knocked, emptied, swept and foreign board; pieces placed and lifted after the snapshot; grid cells as items; bricks from depth and from upstream perception; the examples' routes.

Limits

  • Power loss is not tested. The writes follow the POSIX recipe (fsync the file, rename, fsync the directory), and a SIGKILL never left a broken state, but a kill keeps the page cache; a power cut on a disk that lies about fsync can still lose the newest file (then the one before is used). fsync: false is faster and only safe against process crashes.
  • One writer per task. Two processes saving the same task_id into one directory can take the same sequence number; the rename keeps one of them whole. Different tasks may share a directory.
  • Only as good as the checks. Pieces placed after the last snapshot can only be listed (placed_after_reference), not verified; take a snapshot after each verified placement or batch. The snapshot check inherits the diff skill's limits (a 1 mm bump is under the overhead camera's noise, textureless items cannot have their move measured, the camera must not move by centimetres) and the build check the verify skill's (overhead LEGO seating is below the noise).
  • Arms are reported, not moved. The skill treats a held piece as lost and says so; parking (returning-to-a-recorded-pose) and finding the piece are the graph's job. The arms' saved joints are not compared with now.
  • Synthetic boards and static station frames only; no stopped robot run was resumed on hardware yet. The station frames are RGB only, without pieces.
  • Schema versions 1 and 2 are this format's own earlier drafts and the bare run state the jigsaw / LEGO skills pass; the migration chain is there for the versions that come next.
  • MAX_DISTURBED_FRACTION (a quarter) and MIN_MISMATCH_ITEMS (3) are design choices checked on the synthetic boards, not on robot runs.

The constants, and why

Each constant in scripts/ carries its source. In short: KEEP 5 (a torn newest file leaves four; 0.5 MB each for 550 pieces); MAX_ACTIVITY 500 (py_trees' ActivityStream default); INLINE_ARRAY_MAX 64 (a pose, K or a joint vector stays readable in the JSON); BLOB_ZLIB_LEVEL 1 (a full-frame mask 307 kB -> 1-2 kB); BLOB_GRACE_S 600 s (another task's blobs are never collected between its blob and checkpoint writes); MAX_DISTURBED_FRACTION 0.25 and MIN_MISMATCH_ITEMS 3 (a nudge moves 1-3 items, a sweep most; see the table); CHANGED_FRACTION_RECHECK 0.4 (unmoved items read at most 0.21).

Method

The candidate (jigsaw survey, "2 state / 8 long run") pointed at py_trees' blackboard - a keyed store with an activity log - as the pattern; no jigsaw code persists its state. This skill keeps that pattern: the state is viewed as blackboard keys (absolute_name with the / separator) and the difference between checkpoints is recorded as py_trees' activity items (INITIALISED / WRITE / UNSET with previous and current values) in a bounded stream - adapted from py_trees/blackboard.py (BSD-3-Clause, commit 49bcffd, header in scripts/checkpoint_store.py, licence in LICENSE.py_trees), with the stream dropping its oldest item where upstream's ActivityStream.push pops its newest. The file format (hashed envelope, content-addressed blobs, atomic rename, rotation, migration chain) and the resume logic (ledger reconciliation, held and in-progress items, the two sibling checks and the recheck list) are this skill's design. The candidate's append-only JSON-lines step log is not implemented: every checkpoint is a whole state, and the activity stream inside it says what changed.

Fichiers inclus

Le modèle lit ces fichiers à la demande lorsque la compétence est chargée. Ils sont accessibles en lecture et ne sont jamais exécutés.

Foire aux questions

À quoi sert la compétence IA Checkpointing Assembly State For Resume ?

Saves and restores the state of a long assembly run (a 550-piece jigsaw, a LEGO build, a domino layout) so a run stopped after hours resumes where it was. save_checkpoint writes one versioned JSON checkpoint atomically (temp file, fsync, rename) with a SHA-256 over its payload - task, step, placed pieces / bricks / items with cells and poses, the pending queue, backtracking-a-wrong-placement's ledger, the reference snapshot and items for detecting-disturbed-pieces-by-snapshot-diff, arms and what they hold, timestamps and an activity stream of what changed - keeping the newest N. resume_from...

Pourquoi utiliser Checkpointing Assembly State For Resume sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Checkpointing Assembly State For Resume se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Checkpointing Assembly State For Resume dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/runtime-si/RoboSkillHub/tree/main/skills/checkpointing-assembly-state-for-resume. TypingMind lit le fichier SKILL.md, regroupe les fichiers associés et installe le tout sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Checkpointing Assembly State For Resume ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Checkpointing Assembly State For Resume ?

Autant que vous le souhaitez. Vous pouvez utiliser Checkpointing Assembly State For Resume avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Checkpointing Assembly State For Resume est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par runtime-si sous licence Apache-2.0. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇