Dataset
CNC G-code and CAM toolpath datasets for AI training
A CNC G-code dataset is a set of the programs that cut real machined parts, each kept with the CAM project it was posted from: operations, tool library, feeds and speeds, stock and fixturing, plus the setup sheet for a named machine and control. SourceX sources these on request from established machine shops and manufacturing engineering groups that hold them per part number, and reviews whether the holder may license programs written for customers' parts. Each dataset is de-identified and licensed for an agreed permitted use.
Dataset manifest
Sourced to your spec- What it is
- CAM projects, the NC program posted for a named machine and control, and the setup sheet
- Typical systems
- Mastercam, Autodesk Fusion, Siemens NX CAM, hyperMILL, ESPRIT, DNC program servers
- Typical history
- Varies by shop; programs are kept per part number and revision
- Modality
- NC program text, native CAM project files, tool libraries, setup sheets as PDF or spreadsheet
- Delivery formats
- NC files as posted and as run, native CAM files, operations and tools as JSON, setup sheets as PDF
- Preparation
- Customer and programmer names replaced; part numbers, header comments and file paths masked as the scope requires
- Licensing
- Scoped per part family; permitted use agreed per license; programs for customers' parts need a rights basis
- Availability
- Sourced to your spec; supply is not guaranteed, and proven copies exist only where the shop saved them
What a delivery contains
Fields vary by source system and are fixed per order. A typical delivery includes:
| Field | Type | What it holds |
|---|---|---|
| program_id | string | Pseudonymous ID for one part revision in one setup on one machine. |
| part_profile | object | Material and condition, stock form and size and part family, with the customer's part number replaced. |
| machine_tool | object | Machine type, axis layout and control family, which fix the dialect and kinematics, plus the spindle speed range. |
| cam_project | object | The native CAM file with its application and version, and the model, fixture and library files it references. |
| setups | array | Each setup's work offset, origin description and workholding, with the setup sheet handed to the operator. |
| operations | array | Ordered operations with strategy, tool, stepover, stepdown, stock to leave and programmed feed and speed. |
| tool_list | array | Tool number, type, diameter, flute count, holder, stickout and the length and diameter offset registers called. |
| post_processor | object | Post name, the shop's revision of it and the options set when the program was posted. |
| posted_program | object | The NC file exactly as the CAM system posted it, with its timestamp. |
| proven_program | object | The NC file as last run at the machine, how and when it was captured, and whether the CAM project was updated. |
| control_edits | array | Line-level differences between posted and proven files, each with a category and any machinist's note. |
| run_outcome | object | First-article result, cycle time and quantity run, where the shop recorded them. |
Field names from the table above; values are masked placeholders.
Example record
{
"program_id": "prg_7c41e2",
"part_profile": { "part_ref": "PN_0193 rev C", "material": "6061-T6 aluminum",
"stock": "saw-cut bar 4.0 x 3.0 x 1.5 in" },
"machine_tool": { "type": "3-axis vertical mill", "control_family": "Fanuc-style", "max_rpm": 12000 },
"cam_project": { "application": "Mastercam", "file": "cam/PN_0193_C_op10 (native project)",
"references": ["PN_0193_C.step", "vise_softjaws.step"] },
"setups": [
{ "setup": "OP10", "work_offset": "G54", "origin": "X0 Y0 fixed jaw and left stop, Z0 top of stock",
"workholding": "6 in vise, machined soft jaws", "setup_sheet": "PN_0193_C_op10_setup.pdf" }
],
"operations": [
{ "n": 3, "strategy": "dynamic pocket rough", "tool": "T4", "rpm": 11000, "feed_ipm": 180,
"stepover_pct": 12, "stepdown_in": 0.75 },
{ "n": 4, "strategy": "contour finish, pocket walls", "tool": "T6", "rpm": 9000, "feed_ipm": 54 }
],
"tool_list": [
{ "t": 4, "type": "3-flute end mill", "dia_in": 0.5, "holder": "shrink fit", "stickout_in": 1.6, "h": 4, "d": 4 },
{ "t": 6, "type": "3-flute finisher", "dia_in": 0.375, "stickout_in": 1.9 }
],
"post_processor": { "name": "fanuc_3x_mill_shop", "revision": "r14" },
"posted_program": { "file": "O0193.nc", "posted_at": "2023-03-02T14:11:00Z" },
"proven_program": { "file": "O0193_proven.nc", "capture": "uploaded from control through DNC",
"captured_at": "2023-03-09T19:40:00Z", "cam_project_updated": false },
"control_edits": [
{ "op": 4, "change": "F54. to F38.", "category": "feed_reduced",
"note": "chatter on thin wall at full depth" },
{ "op": 4, "change": "finish contour repeated at the same offset", "category": "spring_pass_added",
"note": "wall measured heavy on first article" }
],
"run_outcome": { "first_article": "accepted on second piece", "cycle_time_min": 11.4, "qty_run": 240 }
}Synthetic record for illustration. Field names, structure and format are agreed per order.
What AI teams use it for
Train process planning from part to operations
With part, stock and machine as input and the recorded operation list as target, a model learns how programmers order roughing, finishing and hole work.
Recommend feeds and speeds
Programmed and proven values tied to a tool, holder, material and machine give examples handbook tables lack, including where the shop backed off.
Review programs before they run
Posted and proven pairs label the lines a machinist had to change, which supports models that flag likely problems in a new program.
Translate between controls
Where a shop moved a job between machines, the same operations posted for two controls are aligned examples for converting between dialects.
Evaluate machining agents
Held-out jobs with a proven program and first-article result make test items for an agent asked to plan or correct a program.
Use-case guides: Robotics and embodied AI, Private evaluation sets, Coding agents
What makes this data valuable
Project and program together
Each NC file can be traced to the CAM project and the operations that produced it.
Machine and control named
Machine type, axis layout and control family are recorded, so dialect and kinematics are known.
Proven copy on file
The program as last run exists beside the posted one, with capture method and date.
Tools fully defined
Every tool number called has geometry, holder and stickout, not only a diameter.
Setup sheet present
Work offsets, workholding and datum notes tie the coordinates to a physical setup.
Run evidence
First-article results, cycle times and quantities show the program made accepted parts.
Process
CNC G-code dataset
A posted program is only readable next to its CAM project
G-code is the output of a post-processor, a script that turns the CAM system's neutral toolpath into the words one control accepts on one machine. The base language is standardized as ISO 6983, known in the United States as RS-274, but control makers have extended it independently. Post the same pocketing operation for a Fanuc-style control, a Siemens control and a Heidenhain control and you get three different texts, with drilling cycles called differently in each. Some controls also offer a conversational format, such as Mazak's Mazatrol, that bypasses G-code entirely. On a five-axis machine without tool center point control, the posted positions also depend on the machine's pivot geometry and on where the fixture sat on the table. Shops edit their posts, so two shops with the same machine need not produce the same file.
The program also leaves out most of what a model needs to learn machining. T4 means whatever tool the shop had loaded as number 4 that day. The file does not say the tool was a half-inch end mill in a shrink-fit holder, what the material was, where the stock ended or which vise held it. G54 points at an origin that exists only as numbers in the control's offset table and a note on the setup sheet. A model trained on NC files alone learns one control's syntax and a list of coordinates with no part attached.
The CAM project holds the missing half: operation type and strategy, tool and holder definitions, stepover and stepdown, stock to leave, the stock model, the fixture and the work coordinate system of each setup. Ask for the native project, the post-processor name and revision, the NC file as posted and the setup sheet as one unit per job. Programs typed at the control or written in a conversational mode have no CAM project and should be labeled that way.
The program that ran is not the program that was posted
The first time a program runs, a machinist stands at the control with the feed override turned down and the part in view. A thin wall chatters at full depth, chips pack in a deep pocket, a finish pass leaves a bore undersize. The machinist fixes these at the control: lowers the feed on one move, adds a spring pass, shortens a peck, raises a clearance plane, changes a coolant code. Once the first article passes inspection, that edited program is the one production runs.
Shops differ in what happens next. In some, the proven program is sent back to a DNC server and the programmer updates the CAM project to match. In others, the edited file stays in the machine's memory, the CAM project keeps its original values, and a repost would bring the old problems back. Some corrections never enter the program at all. The position of a feed override knob is not written to the file, and a size correction entered as tool wear lives in the offset table.
For training, the difference between the two files is the most valuable part of the job. Each changed line is a correction made by a skilled person who could see and hear the cut, tied to a known tool, material and machine. Request the posted and the proven file for each job, how and when the proven copy was captured, and whether the CAM project was updated afterward. Keep any machinist's note attached to the lines it explains.
What to check before licensing
- For each sample job, compare the posted file with the file last run at the machine. If every pair is identical, the proven copies were probably never saved back.
- Confirm each NC file names its machine, its control and the post-processor revision that produced it.
- Open sample CAM projects in the stated application and version, and check that referenced models, fixtures and tool libraries resolve.
- Check that every T number an NC file calls has a defined tool with holder and stickout.
- Ask who owns programs written for customers' parts and what the shop's customer terms say, and have counsel confirm the holder may license them.
- Ask how jobs for export-controlled parts were identified and kept out and who classified them, and confirm the answer with the holder and your counsel.
- Read program header comments, file paths and setup sheets for customer names, part numbers and programmer names that preparation missed.
Delivery No files move before a signed license. A listing or a request grants no files by itself.
How licensing works through SourceX
- 1
Define
Send the domain, modality, volume, format, timeline and permitted use you need.
- 2
Source
SourceX identifies businesses that hold matching data and are open to licensing it.
- 3
Qualify
Fit, rights and quality are checked, and you review samples before committing.
- 4
License
Scope, permitted use, exclusivity, price and obligations are agreed in writing.
- 5
Deliver
Approved data is prepared, de-identified where required and transferred securely.
Questions Acquisition Partners ask
Why is G-code alone not enough for training?
Because an NC program records motion for one machine and leaves out the part, the tool and the material. Tool numbers, work offsets and cycle calls only mean something with the tool list, the setup sheet and the control named. The CAM project adds the operation types, tool geometry, stepovers and stock that produced each block of code.
Which CAM systems and machine controls can be covered?
It depends on the shops found for your request. CAM projects commonly come from Mastercam, Autodesk Fusion, Siemens NX CAM, hyperMILL and ESPRIT, and posted programs target Fanuc-style, Haas, Siemens, Heidenhain, Okuma and Mazak controls among others. State the control families you need and whether you want mills, lathes, mill-turn or five-axis work. Coverage is not guaranteed.
How are edits made at the machine captured?
By comparing the file the programmer posted with the file last run at the control. Where a shop uploads proven programs to a DNC server or saves them back to the job folder, both versions exist and a line-level comparison shows every change. Where the edited program stayed only in the machine's memory and was later overwritten, the proven version is gone. Ask for a manifest stating, per job, which versions exist.
Can a machine shop license programs it wrote for customers' parts?
Not always, and it is the first thing to check. A job shop writes the program, but the part design often belongs to the customer, and purchase terms or nondisclosure agreements may restrict use of anything derived from it. Rights review looks at whether the holder owns or may share each program. Programs for the holder's own products are the simplest case. Ask for the basis for each customer's work and confirm it with counsel.
Is the 3D part model included?
Only where the holder may share it. A CAM project references the part model, and a native project file can carry a copy of that geometry inside it, so the customer's design may travel with the file. Decide whether you need the solid, a simplified description of stock and features, or operations and toolpaths alone, and ask how embedded geometry is handled when the model cannot be licensed.
What should a request specify?
State the machine types, control families, materials and part families you want, and the number of jobs you need. Say whether the CAM project, the setup sheet and a proven copy of each program are required or only preferred, and the oldest CAM software versions you can open. Add whether hand-written and conversational programs are in scope.
Related datasets
- CAD and PCB engineering files with revision history
Native CAD and ECAD design files with revisions, change orders and BOMs
- Manufacturing quality and inspection records
Inspection results, nonconformances, dispositions and corrective actions from production plants
- Sheet metal flat patterns and nesting files
Folded parts with the shop's flat patterns, bend tables, press brake programs and production nest layouts
- 3D printing build files and print outcomes
Print jobs with mesh, orientation, supports, settings, machine, material and recorded outcome
- CAD models with matching drawings
Released design packages: part and assembly STEP files, each paired with the drawing issued at the same revision
Evaluating this data for procurement?
Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.
Request dataset diligenceTell us what your models need
Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.
Updated 25 November 2026.