Why CNC Process Intelligence is One of the Hardest Problems in CS
Analyst note
Autonomous CNC programming requires solving six sub-problems simultaneously, each independently NP-hard, coupled through physics so that changing one decision invalidates three others. No public dataset, academic benchmark, or training corpus exists for the underlying physics. LLMs score 0% on autonomous machining tasks — they cannot compute cutting forces, detect collisions, or solve the mixed-integer optimisation. What LLMs can do is orchestrate purpose-built solvers that handle each sub-problem. CloudNC spent ten years and $70 million building those solvers through thousands of physical cutting experiments. The agentic layer is new. The decade of physics underneath it is the moat.
The six problems
To generate a complete CNC machining program, a system must solve all of the following. Each is a well-studied computational problem with proven NP-hardness.
1. Operation sequencing NP-HARD
Given a part with hundreds of features (holes, pockets, faces, chamfers), determine the order in which to machine them. Each feature has precedence constraints (you can't machine a pocket floor before removing the material above it), tool compatibility requirements, and setup dependencies. A 200-feature part has more valid sequences than atoms in the universe.
Reduces to: Precedence-constrained scheduling. Proven NP-hard (Li, Gao & Wen, 2013; Dolgui et al., 2006).
2. Tool selection NP-HARD
A typical shop has 50-200 cutting tools. Each feature can be machined by multiple tools, but tool choice affects cycle time, surface finish, tool wear, and whether the tool can physically reach the geometry. Minimising tool changes while meeting quality constraints across all features is a set-cover problem over a multi-dimensional constraint space.
Reduces to: Weighted set cover / bin packing. NP-hard (Garey & Johnson, 1979).
3. Setup planning NP-HARD
The part must be physically held in the machine (fixtured) in one or more orientations. Each setup requires clamping surfaces that don't collide with the tool, and every feature must be accessible in at least one setup. Minimising the number of setups while ensuring full coverage is a geometric set-cover problem in 3D, complicated by the fact that clamping forces affect part deflection and accuracy.
Reduces to: Geometric set cover. NP-hard (Rong & Bai, 1996; ScienceDirect 0278-6125).
4. Toolpath generation NP-HARD
For each operation, compute the path the cutting tool follows through 3D space. The tool must remove all required material while avoiding collisions with the part, fixture, and machine. For multi-segment toolpaths, minimising rapid (non-cutting) travel between segments is a Travelling Salesman Problem. For 5-axis simultaneous machining, the tool orientation varies continuously, adding dimensions to an already intractable search.
Reduces to: TSP / GTSP for segment sequencing (Park & Kim, 2019; Journal of Mechanical Science and Technology). Proven NP-hard.
5. Cutting parameter optimisation NP-HARD
For every tool-material-geometry combination, determine optimal feed rate, spindle speed, depth of cut, and width of cut. These parameters interact nonlinearly: increasing feed rate reduces cycle time but increases cutting forces, which cause tool deflection, which degrades surface finish. The objective function depends on empirical cutting force models that vary with tool wear, material batch, and machine rigidity. When optimised jointly across an entire program, this becomes a large-scale mixed-integer nonlinear program.
MILP/MINLP optimisation. NP-hard (general MILP is NP-hard; Schrijver, 1986). Multi-objective variant with nonlinear physics models is strictly harder.
6. Collision avoidance & accessibility analysis NP-HARD
For every tool, at every point along every toolpath, verify that the tool assembly (holder + tool + spindle) does not collide with the part, fixture, or machine structure. For 5-axis machines, this means checking collision across a continuous space of tool orientations. The number of configurations to check scales combinatorially: 100 tools × 1,000 faces × 6 approach directions × 2 setups = millions of geometric intersection tests. Finding the optimal set of accessible orientations is a geometric coverage problem.
Reduces to: Art gallery / geometric coverage problems. NP-hard in general (O'Rourke, 1987). 5-axis accessibility adds continuous orientation dimensions.
Why solving them independently fails
Every decision changes every other decision
Change the tool → cutting parameters change (different tool geometry, different forces) → toolpath changes (different tool diameter means different step-over) → accessibility changes (different holder length means different reach) → setup plan may change (features that were accessible aren't anymore) → operation sequence changes (different setup order).
Change the setup → available approach directions change → tool selection changes (some tools can't reach in the new orientation) → cutting parameters change (gravity direction relative to cutting forces changes) → toolpath changes → operation sequence changes.
This coupling is what makes CNC process planning fundamentally different from other combinatorial optimisation problems. You cannot decompose it into independent sub-problems and combine the solutions. The sub-problems share state through physics.
The missing data problem
Modern AI relies on large training datasets. For CNC machining, the critical data doesn't exist:
| Data needed | Why it doesn't exist publicly |
|---|---|
| Cutting force models per tool-material combination | Must be measured with dynamometers on physical machines. Each combination requires a separate experiment. No vendor publishes this. |
| Tool deflection under load | Depends on tool geometry, overhang, holder stiffness, spindle bearing condition. Varies per machine. |
| Surface finish as a function of parameters | Requires laser measurement of machined surfaces under controlled conditions. No standard dataset. |
| Tool wear progression | Must be measured over time during real cutting. Varies with coolant, material batch, and coating. Destructive testing. |
| Machine-specific dynamics | Every CNC machine has different rigidity, backlash, and thermal characteristics. Transfer learning between machines is an open research problem. |
Scale of the combinatorial explosion
For a moderately complex part (a typical CNC component with 200 features machined in 2 setups):
| Decision space | Approximate scale |
|---|---|
| Feature sequencing permutations | 200! ≈ 10375 (constrained, but still astronomical) |
| Tool assignments (100 tools, 200 features) | 100200 ≈ 10400 |
| Cutting parameter combinations per operation | ~106 (discretised 4D continuous space) |
| Setup orientations (26 canonical + continuous) | 262 × coverage |
| Toolpath segment orderings per operation | TSP on ~50 segments |
| Accessibility checks (tool × face × direction) | 100 × 1,000 × 6 = 600,000 per setup |
The joint decision space is the product of all of these. No brute-force search can explore it. No gradient descent can navigate it (the space is discrete and discontinuous). The only viable approach is to build domain-specific solvers that exploit the structure of the physics.
What CloudNC built
CloudNC's approach treats the full CNC process planning problem as a single coupled optimisation:
| Component | Approach | Years of R&D |
|---|---|---|
| Physics primitives | Custom experimental rigs measuring cutting forces, tool deflection, surface finish, and wear. Thousands of physical experiments. These generate the objective function and constraints that no external dataset provides. | 2015-present |
| Computational geometry engine | Accessibility analysis, feature recognition, collision detection. Processes millions of geometric configurations in seconds. | 2017-present |
| MILP solver | The full process plan (tool selection, operation sequence, setup assignment) is formulated as a single Mixed-Integer Linear Program with millions of variables and constraints. The solver finds a near-optimal solution in minutes. | 2019-present |
| Cutting parameter models | Empirical models built from physical experiments, not ML training. Each tool-material combination has a physics-based model validated against measured cutting forces. | 2016-present |
| Agentic layer (2025-26) | LLM agents orchestrate the above primitives, enabling natural-language interaction and adaptive planning. The agents use the physics tools; they don't replace them. | 2025-present |
The graveyard
Companies that attempted automated CNC process planning
| Company | Approach | Raised | Outcome |
|---|---|---|---|
| Plethora | Automated quoting + CAM for simple 3-axis parts. Rule-based. | $12.6M | Acquired by Proto Labs (2021) for technology, not revenue. Product discontinued. |
| Fast Radius | Cloud manufacturing platform with automated process planning. | $192M (incl. SPAC) | Bankrupt (2022). Assets sold. AI component never reached production reliability. |
| Formlogic | Autonomous CNC machining with robotic loading. | $10M+ | Ceased operations (2023). Could not solve the process planning problem at scale. |
| Toolpath (2024) | AI-generated CAM toolpaths. Rule-bound approach. | $10M (seed) | Active. Limited to 2.5D/3-axis. No physics models. |
| LimitlessCNC (2024) | AI CAM programming. | $4.1M (seed) | Active. Seed stage. No published technical approach. |
The pattern: teams that approached this as a software problem (rules, ML on synthetic data, LLM prompting) failed or stalled at simple geometries. The physics cannot be approximated away.
Structural implications
The computational complexity of CNC process planning has three implications for CloudNC's competitive position:
1. The moat is structural, not circumstantial. Competitors cannot shortcut the physics experiments or solver development. LLMs accelerate the interface layer but do not replace the computational core. A new entrant starting today faces the same 10-year problem CloudNC has already solved.
2. The barrier is increasing, not decreasing. As CloudNC extends from 3-axis to 5-axis simultaneous machining, the dimensionality of the optimisation problem grows superlinearly. The physics primitives compound: each new capability (turning, mill-turn, multi-axis) reuses the existing solver infrastructure and experimental data. Competitors must build all of it from scratch.
3. The CAM vendors cannot build this internally. Existing CAM packages (Mastercam, Fusion 360, NX) are geometry-editing tools. They provide manual controls for a human programmer to make these decisions. Their architecture assumes a human in the loop. Automating the decisions requires a fundamentally different technical stack: physics models, combinatorial solvers, and accessibility engines that don't exist in any current CAM codebase.