Manuscript Offprint

arXiv:2610.21579

Learning to Search for Executable Patternmaking from Certified Programs

Zhuotao Xu, Chi Zeng, Liying Yang, Xinxing Yu, Yanyan Liang

ABSTRACT

Recent models generate sewing patterns from images or text, and program-based representations make these patterns executable. These systems produce a finished pattern and do not model how a patternmaker turns one pattern into another. In practice a new style is made by editing an existing pattern: lengthening the bodice, moving a dart, swapping a sleeve. Pattern archives record the results of such edits and none of the steps. We observe that the steps can be recovered by searching over editing actions until one pattern becomes the other. A deterministic compiler makes the recovered steps checkable. To this end, we present SemDraft, the first framework that learns to search for executable patternmaking programs from paired before-and-after sewing patterns without recorded editing steps. Specifically, a bounded search recovers a program of editing actions and certifies it only after three checks: it recompiles from scratch, every pair of its actions is classified as ordered or interchangeable, and an independent replay reaches the same pattern. The certified programs then train a model that ranks candidate actions inside the same search. On two frozen draws of 80 order-sensitive cases, with every other search component fixed, the learned ranker certifies 63 and 64 cases within 1,000 search executions, against at most 53 and 52 for non-learned rankers.

1 INTRODUCTION

Sewing patterns underlie digital garment creation, from virtual try-on to made-to-measure manufacturing. Recent systems generate complete patterns from images or text (Liu et al., 2023; He et al., 2024; Bian et al., 2025; Nakayama et al., 2025; Weng et al., 2026), and program-based representations make these patterns executable (Korosteleva & Sorkine-Hornung, 2023; Zhou et al., 2025). Patternmakers rarely draft a style from nothing. They edit an existing pattern by lengthening a bodice, adding and transferring darts, redistributing ease, or swapping a sleeve template. The expertise that makes garments fit is therefore stored only as its outcomes. We study this setting: given the pattern before the edits and the pattern after, recover an executable program of editing actions that connects them.

Recovering the editing actions is challenging for three reasons. First, the supervision is missing. Even when a base–target pair is available, industrial CAD archives keep no log of the operations that connect them. Second, a garment action is coupled. One action changes several panels, their seam partners and their symmetry groups at once, whereas the operations recovered by inverse CAD methods act on a single solid (Xu et al., 2021; Khan et al., 2024a; Dupont et al., 2024; Rukhovich et al., 2025). Third, order is ambiguous. Many orders of the same actions produce the same pattern, and some orders do not, because an attached sleeve template resolves its geometry against the host panels as they are at that moment. A single recovered sequence therefore leaves open which other orders of its actions are valid.

Our insight is that a deterministic compiler makes a recovered sequence checkable. Once a compiler executes the editing actions, a program that reaches the target can be recompiled from scratch. Each pair of its actions can then be classified as ordered or interchangeable, and an independent replay can confirm the result. We build SemDraft on this insight (Fig. 1). A drafting environment compiles nine semantic patternmaking actions to geometry. A bounded teacher search recovers programs and accepts only those that pass the three-stage certification. The certified programs train a learned action-selection prior that ranks the environment's legal candidates. Every training program is therefore executable and carries a certified dependency DAG, with the valid next actions at each

(a) Two patterns, no steps

(b) Recover a program and certify it

(c) One search, four rankings

Figure

Figure 1: Overview of SemDraft on one case of the development corpus. (a) The input is a base pattern and a target pattern; the editing steps between them are not recorded. Red marks the changes, numbered by the step that makes them. (b) A bounded search over nine editing actions, executed by a deterministic compiler, recovers a program, and three checks certify it; the certificate classifies every pair of actions as ordered or interchangeable, which here admits three orders. (c) Certified programs train a model that ranks candidate actions (P). It is compared with the teacher heuristic (H), a random order (R) and a template lookup (T) inside one bounded search with the same candidates, beam, stopping rule, certifier and budget; bars: certified main-test cases of 80 at beam 4.

intermediate state. A unified bounded search then runs every ranking signal, learned or not, with the same candidates, beam, stopping rule, certifier and a shared execution budget.

We evaluate on a newly generated and frozen test set of 80 order-sensitive cases, each requiring a template swap whose landing depends on the host panels. Under matched conditions, the learned prior with a beam of four certifies 63 of the 80 cases, averaged over two training seeds. A lookup of the training corpus's action-type statistics certifies 53, the teacher's own ranking heuristic 51, and a random order 37.7. The comparisons are paired on the same cases, the bootstrap range of each gain lies above zero, and an independent draw of 80 further cases reproduces them. The teacher itself, run unchanged on the same cases with its full wall-clock budget, certifies 30. Of the 50 cases it misses, the prior certifies 34 and the teacher heuristic 21, each within 1,000 search executions.

In summary, our main contributions are:

• We present the first framework that learns to search for executable patternmaking programs from paired before-and-after sewing patterns without recorded editing steps. A bounded search over semantic patternmaking actions accepts a program only after a three-stage certification: recompilation, a pairwise order check and an independent replay. Every training program is therefore executable and carries its certified dependency DAG and the valid next actions at each of its intermediate states.

• We propose a learned action-selection prior and evaluate it under matched conditions. The prior ranks the environment’s legal candidates inside one fixed bounded search. We compare it with the teacher’s heuristic, a random order and a template lookup under the same candidates, beams, stopping rule, certifier and execution budgets.

• We establish a frozen evaluation with replication, distribution shift and teacher-missed solutions. The test set is freshly generated, de-duplicated and split before use, with an independent replication draw and two distribution-shift sets. On the cases the teacher itself misses within its wall-clock budget, we test whether the prior finds certified programs.

References (40)

  • Thinking fast and slow with deep learning and tree search
  • Training with exploration improves a greedy stack LSTM parser
  • DeepCoder: Learning to write programs
  • ChatGarment: Garment estimation, generation and editing via large Language models
  • Learning to search better than your teacher
  • Training Verifiers to Solve Math Word Problems
  • TransCAD: A hierarchical transformer for CAD sequence inference from Point Clouds
  • Digital garment alteration
  • Write, execute, assess: Program synthesis with a REPL. In Advances in Neural Information Processing Systems (NeurIPS), 2019
  • DreamCoder: Bootstrapping inductive program synthesis with Wake-Sleep Library Learning
  • Training deterministic parsers with non-deterministic oracles
  • DressCode: Autoregressively sewing and generating garments from text guidance
  • PLAD: Learning to infer shape programs with pseudo-labels and approximate distributions
  • Learning to edit visual programs with self-supervision
  • Neural-guided deductive search for real-time program synthesis from examples
  • CAD-SIGNet: CAD Language inference from Point Clouds using layer-wise Sketch Instance Guided Attention
  • Text2CAD: Generating sequential CAD designs from beginner-to-expert level text prompts
  • cadrille: Multimodal CAD reconstruction with reinforcement learning
  • GarmentCode: Programming parametric sewing patterns
  • GarmentCodeData: A dataset of 3D Made-to-Measure garments with sewing patterns
  • SECAD-Net: Self-supervised CAD reconstruction by learning Sketch-Extrude operations
  • SfmCAD: Unsupervised CAD reconstruction by learning sketch-based feature modeling operations
  • Towards garment sewing pattern reconstruction from a single image
  • CAD-Assistant: Tool-augmented VLLMs as generic CAD task solvers
  • Optimal partial-order plan relaxation via MaxSAT
  • AIpparel: A multimodal foundation model for digital garments
  • The preregistration revolution
  • ExtrudeNet: Unsupervised inverse Sketch-and-Extrude for shape parsing
  • CAD-Recode: Reverse engineering CAD code from Point Clouds
  • CrossBeam: Learning to search in bottom-up program synthesis
  • Checked program recovery from execution video: A sound oracle for untrusted generators (opens arXiv in a new tab)
  • Nature, 550(7676):354–359, 2017
  • Scaling self-training for problem-solving with language models
  • TailorCoPilot: Enabling Agentic Pattern Making with Version-Controlled State Tracking
  • Attention is all you need
  • GarmentGPT: Compositional garment pattern generation via discrete latent tokenization
  • DeepCAD: A deep generative network for computer-aided design models
  • SkexGen: Autoregressive generation of CAD construction sequences with disentangled codebooks
  • Inferring CAD modeling sequences using Zone Graphs
  • Design2GarmentCode: Turning design concepts to tangible garments through program synthesis