Logo: Checkpointing Assembly State For Resume

Checkpointing Assembly State For Resume

Organisatioun
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.

Iwwersiicht

Editeurruntime-si
RepositoryRoboSkillHub
Skill-Nummcheckpointing-assembly-state-for-resume
Stären
242
Forks
27
Matgeliwwert Dateien
6
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 6 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    runtime-si huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Checkpointing Assembly State For Resume an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/runtime-si/RoboSkillHub/tree/main/skills/checkpointing-assembly-state-for-resume
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Checkpointing Assembly State For Resume an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Checkpointing Assembly State For Resume automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Checkpointing Assembly State For Resume net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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...

Firwat Checkpointing Assembly State For Resume op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Checkpointing Assembly State For Resume besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Checkpointing Assembly State For Resume an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/runtime-si/RoboSkillHub/tree/main/skills/checkpointing-assembly-state-for-resume an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Checkpointing Assembly State For Resume benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Checkpointing Assembly State For Resume benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Checkpointing Assembly State For Resume domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Checkpointing Assembly State For Resume gratis?

Jo. runtime-si huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇