AI Tool Benchmark · Case Study

2D Bin Packingwith Cursor

Building an industrial desktop application using AI‑assisted development. Part of an internal benchmark comparing Cursor, Claude Code, and ChatGPT Codex on the same real‑world engineering task.

AUTHORLukáš Moravanský
ORGJIC Smart Factory
TOOLCursor IDE · Pro Plan
BUDGET40 hours · $24/month
UTIL 0% PLACED 0/0 STATUS PACKING…

What is 2D Bin Packing?

You have a pallet of fixed size and a set of boxes with different dimensions. The goal: fit as many boxes as possible without overlaps, maximizing space utilization.

A classic optimization problem in logistics and manufacturing. The benchmark required building a complete desktop application — interactive GUI, solver algorithms, input validation, and system logging.

Requirements

LANGUAGEPython 3.10+ with PyQt5
ARCHModular — GUI separated from solver logic
OUTPUTApp, GitHub repo, docs, presentation
TIME40 hours maximum
EVALDev speed, code quality, manual fixes, context handling
Interactive Demo
PLACED 0/7 UTIL 0% CONFLICTS: 0 ← drag pieces to pallet

What is Cursor?

An AI‑powered code editor built as a fork of VS Code. Same familiar environment, but with built‑in AI agents that plan, write, and modify code across your entire project.

01

Built on VS Code

Familiar environment. Imports your settings, extensions, keybindings. Zero learning curve.

02

Multi-model access

Claude, GPT-4, Gemini, or Cursor's own Composer — all within one $20/mo subscription.

03

Agent workflow

Beyond autocomplete. Reads your project, plans changes, creates files, iterates in conversation.

Why is the GUI the hardest part?

GUI stands for Graphical User Interface — what users actually see and click. AI models trained on massive amounts of web code can produce beautiful websites easily. This project required PyQt5 — a Python library for building native desktop apps (programs installed and running on your computer, not in a browser) — with far less training data and no visual feedback loop.

✓ Web (HTML/CSS/JS)

Massive training data. AI produces polished, responsive UIs on the first try. Instant browser preview for feedback.

AI confidence — high
✗ Desktop (PyQt5)

Limited training data. Specialized widgets. The agent writes code but cannot see the rendered result — no automatic visual feedback.

AI confidence — needs guidance

Original plan: Use Figma → HTML → PyQt pipeline. Cursor supports Figma integration, but it requires Figma's paid plan. Adding another subscription wasn't worth it.

What happened: I let the AI agent handle design autonomously, using reference screenshots of award-winning interfaces. This saved hours of manual design work and produced better results than expected.

Skills, Sub-agents & Rules

The biggest lesson: how you configure the AI agent matters more than which model you use. Cursor lets you define persistent instructions that guide the agent's behavior — similar to setting up a Claude Project with custom instructions, but for code development.

SPAWNS CRITIQUE APPLIES CRITIQUE MANUAL VISUAL FEEDBACK LOOP PROMPT your request AGENT reads rules + skills SUB-AGENT reviews & critiques EDITS CODE direct, no re-prompt SCREENSHOT manual visual feedback
PROMPT your request AGENT reads rules + skills SUB-AGENT reviews & critiques EDITS CODE direct, no re-prompt SCREENSHOT manual visual feedback ↓ SPAWNS ↑ CRITIQUE APPLIES CRITIQUE MANUAL VISUAL FEEDBACK LOOP
01 — RULES

Project Rules

Persistent instructions extracted from the specification. Instead of feeding the full PDF every prompt (wasting tokens), the agent summarized key requirements into compact rules — architecture, output format, validation.

≈ Claude Project instructions
02 — SKILLS

Specialized Knowledge

Knowledge files teaching the agent how to approach specific tasks. My "PyQt GUI Front-End Design" skill defined a complete design methodology — visual hierarchy, styling states, verification checklist.

≈ Claude Knowledge base
03 — SUB-AGENTS

Autonomous Reviewers

Agents called by the main agent when needed. My "senior-product-ui-critic" evaluates layout hierarchy, spacing, color, visual authority — UX expertise I couldn't articulate myself.

≈ Automated QA reviewer
⚠

Why this matters: After ~20 prompts, the agent forgets original architecture. It won't check the spec PDF even if the file is in the project. Rules and Skills act as persistent, compact memory — and save tokens by replacing bulky source documents.

Development Timeline

Cursor offers four interaction modes. For the initial build: Ask → Plan → Agent (Build) → Iterate.

Ask

Q&A only. Doesn't touch files.

Plan

Architecture, diagrams, rules. Project start.

Agent

Writes, edits, deletes code. Primary tool.

Debug

Targeted error resolution.

Ask
→
Plan
→
Agent (Build)
→
Iterate

How it went

Attempt 1

Functional code, ugly GUI

Agent found a solver online and produced working code. Boxes placed correctly. The interface? Zero design thinking.

Iteration

Gradual redesign with references

Fed award-winning web designs as visual references. Screenshots as feedback. Incremental improvement, but hitting limits without proper agent configuration.

Mid-project — Composer 2

New model, decision to restart

Cursor shipped Composer 2 mid-development. Rather than continuing with the old model, I restarted with proper preparation — Skills, Sub-agents, and Rules configured before the first prompt.

Attempt 2

Prepared agent, dramatically better

Sub-agent analyzed a design reference screenshot. Skill guided PyQt styling. The second first-shot produced a significantly better interface. Solver added in prompt #2.

Before
After — redesigned 2D palletization GUI (prepared-agent first shot)
BEFORE
AFTER
BEFORE
AFTER
Polish

Iterative fixes and self-critique

Circled visual issues on screenshots. Asked the agent to find and fix flaws autonomously. Sub-agent caught spacing, alignment, and hierarchy issues I would have missed.

The Final Application

Fully functional 2D bin-packing app with multiple solvers, clean industrial interface, and modular architecture designed for extensibility.

Final application — 2D bin packing desktop app
1
Pallet ConfigWidth, height, gap settings
2
Solver StrategyMaxRects, Skyline, GA MaxRects
3
Item TypesDimensions, quantity, rotation
4
VisualizationUtilization, placed count, solve time
5
System LogTimestamped INFO/WARN/ERROR
3
Solver algorithms — MaxRects, Skyline, GA
Modular
Architecture — plug in new solvers easily
JSON
Import/export scenarios and solutions

What I Learned

✓ WORKED WELL

Strengths

  • Skills + Sub-agents improved quality from the very first prompt
  • AI handled design decisions well when given proper reference material
  • Screenshot-based feedback loop was effective for desktop GUI
  • Restarting with better preparation after Composer 2 paid off significantly
✗ CHALLENGING

Pain Points

  • PyQt5 limited training data — more mistakes than with web tech
  • Agent loses project context after ~20 prompts without rules
  • No automatic visual feedback for desktop apps (yet)
  • Token management requires planning — first shot consumes the most
💡 TOKENS

Token Economy

  • Rules + Skills reduce waste with compact persistent context
  • Full spec PDF every prompt = token burn — extract key rules instead
  • Well-prepared first shot saves more than multiple correction rounds
→ RECOMMENDATION

For Teams

  • Configure Rules, Skills, Sub-agents before the first build
  • Use reference screenshots as design input — the agent understands visual language
  • Treat AI development as collaboration, not one-shot generation
  • Save a backup before every large agent task — if the result breaks things, you can restore in seconds instead of spending dozens of messages asking the agent to undo its own work
Half the work happened before the first prompt.

Built with Cursor · Presented with Claude