Logo Choosing Next Piece And Slot

Choosing Next Piece And Slot

Tổ chức
runtime-si
choosing-next-piece-and-slot

Chooses the next jigsaw placement (which loose piece, which grid cell, which turn) from the board as believed, the pieces' localization candidates and backtracking-a-wrong-placement's ledger. Loose pieces are assigned to free cells with SciPy's linear_sum_assignment on -log P(piece belongs in cell), and the confident pairs are ranked by a stage plan - frame before interior, cells with the most placed neighbours, then confidence - skipping forbidden pairs and deferred cells and respecting corner / edge / interior classes. With two arms each job stays inside one free arm's reach and clear of the other's work, and each arm gets a short separated queue. When nothing is confident it names the best-supported slot and candidates for a shape match, the pieces to photograph again, or asks for more pieces. Use when a jigsaw-assembly loop needs its next pick, after localizing-a- piece-in-a-reference-image and after any backtrack; planning only, milliseconds on CPU.

Tổng quan

Nhà phát hànhruntime-si
Kho mãRoboSkillHub
Tên kỹ năngchoosing-next-piece-and-slot
Sao
242
Bản fork
27
Tệp đi kèm
4
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 4 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được runtime-si công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Choosing Next Piece And Slot trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/runtime-si/RoboSkillHub/tree/main/skills/choosing-next-piece-and-slot
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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/choosing-next-piece-and-slot .claude/skills/choosing-next-piece-and-slot
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Choosing Next Piece And Slot trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Choosing Next Piece And Slot ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Choosing Next Piece And Slot với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

choosing-next-piece-and-slot

The forward half of a jigsaw loop: before every pick, decide which loose piece goes where next. The localizer says, per piece, which cells it may belong to and how sure it is; backtracking-a-wrong-placement says which (piece, cell) pairs failed and which cells to leave for later. This skill turns both into one next placement and a short queue, or says what evidence is missing.

How

  1. Board. Free cells are those not placed and not deferred in the ledger (and not in exclude_cells). A cell is a corner, edge or interior cell of the grid; the frame is every corner and edge cell. Its placed neighbours are counted over the 4 sides.
  2. Probabilities. P(piece belongs in cell) from the localizer's score and margin over the piece's best other listed cell, through backtracking-a-wrong-placement's calibration (same constants, a test keeps them equal); a flat shortlist (score null) shares the piece equally; a candidate with confidence (a shape match's verdict) uses it. The ledger's posterior replaces P for a pair it has seen (except a newer shape verdict), halved per unexplained re-seat failure; forbidden pairs are dropped. A known piece_class (corner / edge / interior, from matching-a-piece-to-placed-neighbours) only goes to cells of that class.
  3. Assignment. All loose pieces against all open cells with linear_sum_assignment on -log P, a "stay loose" column per piece at -log 0.01. Two pieces never claim one cell, and a piece goes where it beats its rivals (the cell's own sure piece keeps it from an impostor).
  4. Rank the assigned pairs with P >= min_confidence (0.5). plan: frontier cells (a placed neighbour, or any cell on an empty board) before new islands; within that, key = -log P - neighbour_weight (1) x placed neighbours - frame_weight (100, i.e. strictly first) on frame cells while the frame is unfinished; on an empty board corners get two neighbours' worth. Baselines for comparison: frame_first (frame, then confidence), most_neighbours, confidence, random.
  5. Arms (optional). A job is feasible for a free arm when the whole straight pick-to-place path (1 cm steps) is inside that arm's reach (disc from its base with min/max radius, and/or a polygon) - so it never enters the zone only the other arm reaches - and at least 10 cm from a busy arm's busy_at. Jobs are dealt in rank order to the feasible arm with the shorter queue (then the nearer one); the jobs two arms do at the same queue position are at least 3 cells apart and their picks 10 cm apart. The first job dealt is chosen.
  6. Nothing confident. need_shape_match for the open cell with the most placed neighbours (frame first on ties, at least one neighbour, or a frame cell on an empty board), with the pieces listing it, likeliest first, and - once every piece is known (all_pieces_known, default: at least as many loose pieces as free cells) - the orphans, up to 50. Else deferred cells are reopened for pieces not forbidden there. Else need_relocalize for the orphans not yet re-photographed max_relocalize (1) times. Else need_more_pieces.

Call it again after every placement or backtrack: it keeps no state (the ledger belongs to the backtracking skill) and takes 1-8 ms for 540 pieces.

Inputs

  • grid_cols, grid_rows: the cut grid (the target is 20 x 27, see estimating-cut-grid-from-pieces).
  • placements: [{"piece", "col", "row"}], the board as believed (row 0 at the top of the picture, as the localizer counts).
  • pieces: one record per known loose piece (placed ones are ignored): localizing-a-piece-in-a-reference-image's output with piece (an id) and candidates (col, row, score, angle_deg); optional piece_class, position (world [x, y], or the localizer's piece_pose) for arms, relocalized (times photographed again), and candidates with confidence from a shape match.
  • ledger (dict) or ledger_path: backtracking-a-wrong-placement's ledger; read, never written.
  • arms: [{"id", "reach": {"base": [x, y], "max_radius", "min_radius"?} | {"polygon": [[x, y], ...]}, "busy"?, "busy_at"?: [x, y]}] with board_pose (origin: world x, y of the picture's top-left corner; yaw: world angle of the column direction, rows run at yaw - 90 degrees), board_width, board_height (m).
  • exclude_cells (a shape match found no fit there; clear them after the next placement next to them), policy (plan), queue_length (3), min_confidence (0.5), neighbour_weight (1), frame_weight (100), max_relocalize (1), allow_islands (true), reopen_deferred (true), all_pieces_known, seed (for random).

Outputs

route; for chosen: piece, col, row, angle_deg (the localizer's: turn the piece by -angle_deg to square it), prob, n_neighbours, cell_class, tier (0 frontier, 1 island), arm ("" without arms); queue ({arm id: [jobs]}, or {"any": [...]} without arms); for need_shape_match: slot, n_neighbours, shape_candidates; for need_relocalize: relocalize; for unreachable: unreachable (up to 10 jobs with each arm's reason: out_of_reach, near_busy_<id>, no_position); always n_free, n_placed, n_jobs, frame_done, reopened (when deferred cells were offered again) and detail.

Measured

eval/assembly.py (CPU, 12 processes) assembles whole 20 x 27 puzzles (the target's grid, 540 pieces) in a loop: the skill's answer is carried out, every placement is checked by the procedural cut's shape against its placed neighbours (tests/bundles/_backtrack_sim.py: a tab on a tab does not seat, a seam gap over 0.06 of the side fails, a piece with no placed neighbour always passes), and every failure goes to backtracking-a-wrong-placement until the board passes. need_shape_match is answered by a stand-in for matching-a-piece-to-placed-neighbours at that skill's measured fits rates and precision per cut and neighbour count (ambiguous / no_fit skip the slot until a neighbour is placed; when only skipped slots are left and every piece is known, its top answer is placed at its measured top-1 rate); need_relocalize swaps in a second photo's record. Every piece is known and carries its true class (the shape skill classifies 99.7-100 % right).

Evidence: localizer = localizing-a-piece-in-a-reference-image run on all 540 pieces of a 20 x 27 procedural picture (eval/localize_all.py: textured, a flat white band over the top 3 rows, a plaid patch; 81 % of top-1 cells right, 420 located, 51 flat pieces each listing all 60 band cells; a second photo seed for re-localizing); synth10 / synth25 = synthetic records with 10 % / 25 % of top-1 answers confidently wrong (score 0.80-0.95, margin 0-0.08, the true cell second in 70 % of them).

16 puzzles per row (cut seeds 0-15). "Finished": all 540 right. "Per failure": checks passed per check failed. "Correct" / "wrong" are cells at the end (a wrong piece that passed every check stays).

evidence, cutpolicycorrectwrongfinishedfailuresper failure
localizer, wavyplan540.00.016 / 167.473.4
most neighbours539.10.213 / 1620.426.5
frame first539.20.213 / 1621.725.0
confidence539.90.015 / 1618.629.2
random539.50.114 / 1617.930.2
localizer, classicplan536.31.86 / 1640.213.4
most neighbours534.23.45 / 1651.910.4
frame first523.110.60 / 1680.76.7
confidence523.210.50 / 1683.66.4
random519.412.80 / 1689.06.0
synth10, wavyplan539.80.013 / 1611.347.9
most neighbours539.80.013 / 1615.335.4
frame first539.90.015 / 1614.836.7
confidence539.70.114 / 1617.530.9
random539.40.19 / 1616.832.4
synth10, classicplan538.60.97 / 1615.634.9
most neighbours538.21.16 / 1619.827.5
frame first538.50.98 / 1615.335.4
confidence538.01.44 / 1617.531.0
random538.11.37 / 1616.832.4
synth25, wavyplan534.80.94 / 1679.56.8
most neighbours535.00.94 / 1672.47.5
frame first532.91.34 / 1688.46.2
confidence531.21.73 / 1697.95.5
random524.62.90 / 16118.44.6
synth25, classicplan524.28.30 / 16108.95.0
most neighbours522.49.10 / 16114.24.7
frame first521.49.30 / 16117.44.6
confidence524.97.90 / 16103.45.2
random518.111.90 / 16122.14.5
  • With the real localizer the plan is best on both cuts: wavy, every puzzle finished with 7 failures per 540 pieces against 18-22 for every baseline; classic (where a wrong piece passes one seam 46 % of the time and a one-neighbour shape match is right 19 %), 1.8 wrong cells left and 6 of 16 finished, against 10-13 wrong and none finished for random, frame-first and confidence order, and 3.4 / 5 for most-neighbours. The gain comes from where pieces meet their checks: the plan grows one connected region, so a wrong piece is usually set down against two or three neighbours and fails at once, and the flat band is filled by shape matches with 2-3 neighbours.
  • synth10: every policy places 538-540 right; the plan has the fewest or near-fewest failures. synth25: plan and most-neighbours tie (wavy 534.8-535.0 right, 72-80 failures), random is clearly worst (524.6 right, 118 failures, none finished); on the classic cut nothing finishes.
  • Unfinished runs end need_more_pieces with a few cells empty (a few synth25 runs hit the 2500-step budget instead): a wrong piece passed its checks somewhere (so the true piece of an empty cell is on the board), or the true piece never listed the cell and the shape stand-in found it ambiguous at a test placement.
  • Ablations (plan, cut seeds 0-7, localizer wavy / localizer classic / synth25 wavy / synth25 classic; correct cells, failures): default 540 / 537.5 / 535.9 / 524.2 right, 6.4 / 42.0 / 68.8 / 115.8 failures. neighbour_weight 0: the same except synth25 wavy 536.2 right, 58 failures (2: identical to 1; the shape-match slot order, which always puts neighbours first, carries most of the effect). min_confidence 0.3: 533.4 / 529.9 / 535.1 / 516.6 right, 72 / 59 / 80 / 168 failures; 0.7: 538.1 / 528.1 / 533.1 / 525.9, 23 / 68 / 86 / 105. Without piece classes: 539.9 / 532.0 / 530.1 / 511.5 right, 24 / 68 / 123 / 160 failures. frame_weight 0, 1, 3 against 100 (an earlier version of the benchmark, 8 puzzles): within 2 cells and 12 failures of each other, 3 identical to 100.
  • Two arms (--arms, 8 puzzles): YAMs at x = +-0.45 m with 0.6 m reach, the board centred between them, pieces staged beside the board on their cell's side (10 % on the wrong side). The plan used 373 / 407 / 367 / 422 rounds (one or two simultaneous placements) for the 555-650 placements, both arms busy in 178-190 of them; 19-24 pieces per puzzle went through the shared buffer after unreachable. Correct cells 539.5 / 531.9 / 532.6 / 522.1 (plan) against 539.5 / 523.2 / 524.9 / 516.0 (random).
  • Pieces arriving in batches of 60 (--batch 60, wavy, 8 puzzles): with the localizer every policy ends with 539-540 right; random had the fewest failures (6.8 against 18.2 for the plan: an island set down alone is never checked, so "failures" also counts how often a policy checks). With synth25 records every policy ran out of the 2500-step budget at 496-502 right (thousands of shape-match calls on slots whose piece is not known yet).

One call takes a median 1-5 ms (540 pieces, ~500 free cells, CPU; up to 8 ms with two arms).

Limits

  • Synthetic validation only. The checks are the cut's geometry, the shape match is a stand-in at that skill's published rates, and the localizer ran on synthetic crops of a procedural picture; no robot, camera or simulator run. The skill moves nothing, so no simulation check applies; none was run (no GPU host this round either).
  • Reach is a model. Discs or polygons and a straight pick-to-place path are what the skill checks; IK, wrist yaw and the arms' links are not (checking-dual-arm-clearance does that per move). ARM_CLEARANCE (10 cm) and PAIR_SEPARATION_CELLS (3) are assumptions.
  • The queue is a snapshot. Later queue entries assume the board as it is now (their neighbour counts do not include earlier entries); re-plan after every placement.
  • Ordering helps less than evidence. With 25 % confidently wrong top-1 answers every policy leaves cells wrong on the classic cut; the fix is better localization or shape evidence, not order.
  • NEIGHBOUR_WEIGHT, FRAME_WEIGHT and MIN_CONFIDENCE were chosen on the benchmark above, not on a robot.

The constants, and why

Each constant in scripts/choose_next.py carries its source. In short: CONF_*, MARGIN_CAP, FLAT_PROB_FLOOR, ATTEMPT_PROB_FACTOR, MIN_ASSIGN_PROB: backtracking-a-wrong-placement's, so both skills rank pairs alike. MIN_CONFIDENCE = 0.5: calibrated pairs at 0.5-0.9 were right 89 % of the time, under 0.5 at most 21 %. NEIGHBOUR_WEIGHT = 1, FRAME_WEIGHT = 100: the ablations above. SHAPE_MAX_CANDIDATES = 50 and SHAPE_MIN_NEIGHBOURS = 1: what matching-a-piece-to-placed-neighbours was measured with and needs; with 10 the true flat piece was often left out. ARM_CLEARANCE = 0.10 m, PAIR_SEPARATION_CELLS = 3: a wrist with a D405 is about 8 cm across (assumption).

Method

Written for the hub; no code copied. The assignment is SciPy's scipy.optimize.linear_sum_assignment (BSD-3-Clause, the modified Jonker-Volgenant algorithm of Crouse 2016, called as a library), as the jigsaw survey's candidate for this skill proposes (cost -log match probability; its travel term is replaced here by hard reach feasibility and the queue's nearest-arm tie-break). The stage plan (frame, most neighbours, confidence), the shape-match fallback, the ledger reading and the two-arm dealing are this skill's design.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Choosing Next Piece And Slot làm được gì?

Chooses the next jigsaw placement (which loose piece, which grid cell, which turn) from the board as believed, the pieces' localization candidates and backtracking-a-wrong-placement's ledger. Loose pieces are assigned to free cells with SciPy's linear_sum_assignment on -log P(piece belongs in cell), and the confident pairs are ranked by a stage plan - frame before interior, cells with the most placed neighbours, then confidence - skipping forbidden pairs and deferred cells and respecting corner / edge / interior classes. With two arms each job stays inside one free arm's reach and clear of...

Vì sao nên dùng Choosing Next Piece And Slot trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Choosing Next Piece And Slot là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Choosing Next Piece And Slot trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/runtime-si/RoboSkillHub/tree/main/skills/choosing-next-piece-and-slot. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Choosing Next Piece And Slot?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Choosing Next Piece And Slot với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Choosing Next Piece And Slot với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Choosing Next Piece And Slot có miễn phí không?

Có. Kỹ năng này được runtime-si phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇