G-code authoring & verification
Write or fix G-code and verify it in an NC simulator.
20 project-authored proposals · taxonomy v1.1 · 0 new benchmark runs. Verifiers and partial-credit rules below are designs, not executed results.
- Typical applications
- CAMotics · LinuxCNC · text editor
- Class GUI-need label
CL· CLI-sufficient
Task proposals · 20
Expand to inspect the complete original wording and proposed checks. Original proposal text remains English in both interfaces.
R07.07.01.02-T01 Hand-write G-code for a rectangular pocket with step-downs and stepover
Original instruction
Write out/pocket.ngc (Fanuc/LinuxCNC-compatible, metric, G54) that mills a 50×30×5 mm pocket centred at X0 Y0 in 6061 stock (top Z0) with a Ø6 flat endmill: 1.0 mm step-downs, 40% stepover, helical or ramp entry (no plunge), climb finish pass 0.2 mm on walls, S9000 F900. Retract to Z10 at end, M30.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- text editor · CAMotics
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 3 / 5
Proposed verifier
CAMotics headless sim: machined volume vs target pocket Hausdorff ≤0.1 mm, no material removed outside pocket; parser checks: max Z step 1.0, no vertical plunge (G1 Z-only below Z0), stepover ≤2.4 mm, climb direction on finish, spindle/feed set before cutting.
Proposed partial credit
40% pocket geometry; 20% step-down/stepover; 30% entry & finish pass; 10% safe start/end
R07.07.01.02-T02 Convert an absolute G90 program to incremental G91 with an identical path
Original instruction
Convert fixtures/bracket_abs.ngc (G90, 214 lines incl. arcs with I/J) to out/bracket_inc.ngc using G91 for all motion while preserving the toolpath exactly. Keep arc centres incremental (as they already are), the same feeds and the same start point.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- text editor · LinuxCNC
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 2 / 5
Proposed verifier
LinuxCNC rs274 interpreter traces both programs: canonical motion endpoints equal within 0.0005 mm; output contains G91 and no G90 motion; feeds equal.
Proposed partial credit
70% identical canonical path; 15% G91 throughout; 15% feeds preserved
R07.07.01.02-T03 Find and fix three errors in a lathe program
Original instruction
fixtures/lathe_pin.nc (Fanuc lathe, diameter mode) has three defects: a feed move without F before the first cut, a G17 plane select where G18 is required for G02/G03, and a rapid move that crosses the stock. Fix them with minimal edits and list the line numbers and fixes in out/fixes.txt.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- text editor · CAMotics
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 2 / 5
Proposed verifier
Diff limited to ≤6 lines; grader's turning sim: no rapid inside stock envelope; all arcs interpreted in G18; feed defined before first G01; final profile equals reference ±0.01 mm; fixes.txt names 3 line numbers.
Proposed partial credit
75% defects fixed (25 pts each); 15% profile unchanged; 10% fixes.txt
R07.07.01.02-T04 Write a parametric bolt-circle drilling subroutine with O-words
Original instruction
Write out/boltcircle.ngc for LinuxCNC: an O-word subroutine o100 taking PCD, hole count, start angle, depth and peck as parameters, calling G83 peck drilling at each hole; main program drills 8× holes on PCD 80 mm at 22.5° start, depth 12 mm, peck 2 mm, and 6× holes on PCD 40 at 0°, depth 8 mm.
- Platforms
lin· Linux- Applications
- LinuxCNC · text editor
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 3 / 5
Proposed verifier
LinuxCNC sim (axis-less interpreter) trace: 14 holes at correct XY ±0.001 mm; G83 with R/Q/Z correct; subroutine used (o100 sub/call present) not unrolled; grader also calls o100 with hidden params via a test harness.
Proposed partial credit
40% hole positions; 20% peck cycles; 25% real subroutine reusable; 15% hidden-param call
R07.07.01.02-T05 Program an outside contour with cutter compensation and lead-in/lead-out
Original instruction
Write out/cam_plate.ngc that profiles the outside of the plate in fixtures/cam_plate.dxf (lines and arcs) with a Ø10 endmill using G41/G42 cutter radius compensation from the part geometry, a tangent arc lead-in and lead-out longer than the tool radius, climb milling, depth 6 mm in 2 passes.
- Platforms
lin· Linux- Applications
- LinuxCNC · text editor
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 3 / 5
Proposed verifier
LinuxCNC interpreter with tool table Ø10: no comp errors; compensated path offset 5 mm from part ±0.01; part profile cut within 0.02 mm (sim); climb direction; lead arcs radius >5 mm.
Proposed partial credit
40% compensated geometry; 20% leads valid; 20% climb & depths; 20% runs without interpreter errors
R07.07.01.02-T06 Thread-mill an internal M30×2 thread with helical interpolation
Original instruction
Write out/threadmill.ngc for LinuxCNC that thread-mills an internal M30×2 right-hand thread, 20 mm deep, in a Ø28 pre-drilled hole at X0 Y0, using a single-point thread mill (cutting Ø16, tool 7), bottom-up climb milling, helical arc-in and arc-out, two radial passes (70%/30%).
- Platforms
lin· Linux- Applications
- LinuxCNC · text editor
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 4 / 5
Proposed verifier
Interpreter trace: helical G02/G03 with pitch 2 mm per revolution; direction gives RH thread bottom-up climb; final major diameter of swept path 30.0±0.02 accounting tool radius; depth 20; two radial passes; arc-in tangent.
Proposed partial credit
35% pitch/handedness; 30% major diameter; 15% passes; 20% entry/exit and depth
R07.07.01.02-T07 Write a G71/G70 roughing and finishing cycle for a turned profile
Original instruction
From fixtures/turned_part.pdf (profile with tapers, a radius R4 and a shoulder) write out/turn.nc (Fanuc 0i-T style): G71 roughing (DOC 1.5 mm, retract 0.5, U0.4 W0.1 allowances) and G70 finishing with the profile in P/Q blocks, G96 constant surface speed 200 m/min, G50 max 2500 rpm.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- text editor · CAMotics
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 4 / 5
Proposed verifier
Grader Fanuc-lathe interpreter expands G71/G70: final profile within 0.01 mm of drawing; G71 params correct; P/Q blocks monotonic for Type I; G96/G50 present.
Proposed partial credit
45% final profile; 25% cycle parameters; 15% Type-I validity; 15% CSS settings
R07.07.01.02-T08 Generate G-code to engrave text along an arc with a single-line font
Original instruction
Write a script that converts the string 'FRONTIER-2026' in the Hershey 'futural' single-stroke font to G-code engraving it along an arc of radius 60 mm centred at X0 Y0, text centred at 90°, cap height 6 mm, depth 0.3 mm, V-bit tool 3, and write out/engrave.ngc.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- Python · CAMotics
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 4 / 5
Proposed verifier
Interpreter trace: strokes match reference rendering after arc-mapping (Chamfer distance ≤0.05 mm); depth 0.3; retracts between strokes ≥1 mm; baseline radius 60±0.05; centred at 90°±0.5°.
Proposed partial credit
40% glyph geometry; 25% arc mapping; 20% depth/retracts; 15% centring
R07.07.01.02-T09 Reorder a drilling program to cut air-move time by a quarter
Original instruction
fixtures/panel_drill.ngc drills 160 holes in file order with full Z50 retracts between all holes. Rewrite it as out/panel_drill_opt.ngc that drills the same holes with the same cycles but reorders them (nearest-neighbour + 2-opt or better) and uses R-plane retracts (G99, R2) within each tool group, cutting total rapid time by ≥25% at 15 m/min rapids.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- text editor · Python
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 3 / 5
Proposed verifier
Interpreter trace: same multiset of holes/depths/cycles; rapid time ≤75% of original; no rapid at Z<2 across clamp zones defined in fixtures/clamps.json.
Proposed partial credit
30% same holes & cycles; 50% rapid-time reduction (scaled); 20% clamp-safe retracts
R07.07.01.02-T10 Write a LinuxCNC probing routine that finds a corner and sets G54
Original instruction
Write out/probe_corner.ngc for LinuxCNC that, starting above the stock near its front-left corner, uses G38.2 probing moves to touch the left face and front face (with backoff and slow re-probe), computes the corner accounting for a Ø2 stylus, and sets G54 X/Y with G10 L20. It must abort with an error message if a probe fails to trip.
- Platforms
lin· Linux- Applications
- LinuxCNC
- Interfaces
term· Terminaldesk· Desktop GUI- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 5 / 5
Proposed verifier
Run in LinuxCNC sim config with simulated probe (HAL comp tripping at hidden stock faces, 3 random offsets): G54 X/Y equals true corner ±0.01 mm; failure case (missing face) triggers abort; re-probe at slower feed present.
Proposed partial credit
25% probing moves; 40% correct G54 for hidden offsets; 15% stylus comp; 20% failure handling
R07.07.01.02-T11 Port a Grbl router program to LinuxCNC dialect
Original instruction
fixtures/sign_grbl.gcode was written for Grbl 1.1 (laser-mode M4, $-commands, no tool table, G64 absent). Convert it to out/sign_linuxcnc.ngc for a LinuxCNC router: remove $ lines, map spindle to M3 with S scaling 0-1000→0-18000 rpm, add G64 P0.02, T1 M6 with G43, %-delimiters as required, preserving all motion.
- Platforms
lin· Linux- Applications
- LinuxCNC · text editor
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 3 / 5
Proposed verifier
LinuxCNC interpreter runs without error; motion trace equals Grbl reference parse ±0.001 mm; S values scaled; G64 P0.02 and tool change present; no $-lines.
Proposed partial credit
40% motion preserved; 20% spindle mapping; 20% tool/G64; 20% runs clean
R07.07.01.02-T12 Generate trochoidal slotting G-code within an engagement limit
Original instruction
Write a generator that outputs out/troch_slot.ngc to cut a 10 mm wide, 60 mm long, 12 mm deep straight slot with a Ø6 endmill using trochoidal (circular) passes at full depth, keeping radial engagement ≤20% of tool diameter, F 1500, with smooth arc transitions. Report the max engagement computed by your script.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- Python · CAMotics
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 4 / 5
Proposed verifier
Grader voxel engagement analysis on the path: max radial engagement ≤1.2 mm (+5%); slot geometry within 0.05 mm; no full-width slotting moves; path continuous (G2/G3 only in cut).
Proposed partial credit
40% engagement limit; 35% slot geometry; 25% continuity/smoothness
R07.07.01.02-T13 Generate a 3D raster finishing path from a heightmap with a scallop limit
Original instruction
From fixtures/relief.png (512×512, 0-255 → 0-8 mm depth over 100×100 mm) generate out/relief.ngc finishing raster with a Ø3 ball-nose, stepover chosen so scallop height ≤0.02 mm on flat regions, accounting for ball-tool offset (no gouging of steep regions), 0.05 mm tolerance.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- Python · CAMotics
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 4 / 5
Proposed verifier
CAMotics sim: resulting surface vs heightmap: no gouges deeper than 0.02 mm anywhere; mean abs error ≤0.05 mm; stepover ≤ 2√(2·R·h) for h=0.02.
Proposed partial credit
40% no gouging; 35% accuracy; 25% stepover/scallop
R07.07.01.02-T14 Configure a simulated LinuxCNC mill and prove a program within soft limits
Original instruction
Create a LinuxCNC sim config out/mymill/ (INI + HAL, 3 axes, mm, X 0-400 Y 0-300 Z -120-0 soft limits, max vel 250 mm/s, tool table with T1-T4 from docs/tools.csv). Run fixtures/job_17.ngc in it headless and fix the one program line that violates a soft limit by changing the work offset only.
- Platforms
lin· Linux- Applications
- LinuxCNC
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP08· App/system state- Conditions
- None declared
- Proposed difficulty
- 3 / 5
Proposed verifier
Grader launches config with linuxcncrsh: loads, homes, runs job without limit errors; INI values as specified; tool table entries exact; program diff only G54 offset (G10) lines.
Proposed partial credit
35% config valid; 20% tool table; 30% program runs within limits; 15% minimal fix
R07.07.01.02-T15 Fix a toolpath that collides with a fixture clamp in CAMotics
Original instruction
fixtures/vise_job.ngc collides with the clamp modelled in fixtures/vise_job.camotics (clamp at X40-60 Y-5-5 Z0-15). Edit the program so all moves clear the clamp by ≥3 mm (raise linking moves or re-route) without changing the cutting moves on the part. Save out/vise_job_fixed.ngc.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- CAMotics · text editor
- Interfaces
term· Terminaldesk· Desktop GUI- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commandsvis· Visual judgment- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 3 / 5
Proposed verifier
Swept tool+holder volume clearance to clamp ≥3 mm; cutting segments (G1/G2/G3 with Z<0.5) unchanged; final part identical in sim.
Proposed partial credit
50% clearance; 35% cutting moves unchanged; 15% part identical
R07.07.01.02-T16 Write a G-code linter that checks feeds, spindle and travel limits
Original instruction
Write out/nclint.py that parses RS274 programs and reports: cutting moves without spindle on, F missing/zero, S above tool max (from docs/tools.csv), moves beyond machine envelope, arcs with radius mismatch >0.01 mm, and G41/G42 without matching G40. Run it on the 10 programs in fixtures/nc_batch/ and write out/lint_report.json.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- Python
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 3 / 5
Proposed verifier
lint_report.json findings vs seeded defects (37 across 10 files): recall ≥0.9, precision ≥0.9 by (file, line, rule); linter also run on 5 hidden programs.
Proposed partial credit
50% recall/precision on given set; 35% hidden set; 15% report schema
R07.07.01.02-T17 Write a Fanuc Macro B parametric rectangular-pocket routine
Original instruction
Write out/O9010.nc, a Fanuc Macro B custom macro called as G65 P9010 with arguments A (length), B (width), C (depth), D (tool dia from #13xxx offset), E (step-down), F (feed), that clears a rectangular pocket centred at the current position with spiral-out stepover 50% D and alarms (#3000) on invalid inputs (D ≥ min(A,B)).
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- text editor · Fanuc NCGuide
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 5 / 5
Proposed verifier
Grader Macro-B interpreter runs 6 calls with hidden arguments: pocket volume within 0.05 mm of target each; step-down ≤E; stepover ≤0.5D; invalid-input call raises #3000 alarm.
Proposed partial credit
50% hidden calls correct; 20% parameters respected; 15% alarm; 15% spiral pattern
R07.07.01.02-T18 Wrap a 2D engraving onto a cylinder using a rotary A axis
Original instruction
Convert fixtures/pattern.dxf (closed curves on a 94.25×40 mm canvas) into out/wrap.ngc for a 4-axis LinuxCNC mill with A rotating about X: wrap the Y dimension around a Ø30 cylinder (Y→A degrees), engrave 0.4 mm deep with Z referenced to cylinder top, and keep feed in inverse-time mode (G93) for combined moves.
- Platforms
lin· Linux- Applications
- LinuxCNC · Python
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 5 / 5
Proposed verifier
Interpreter trace unwrapped (A→arc length) matches DXF within 0.05 mm (Chamfer); depth 0.4 relative to radius 15; G93 with valid F on all A moves; full 360° maps to 94.25 mm.
Proposed partial credit
40% unwrapped geometry; 25% depth; 25% inverse-time feeds; 10% scale
R07.07.01.02-T19 Identify which of five programs produces the target part by simulating them
Original instruction
fixtures/candidates/ holds five NC programs and target_part.stl. Use CAMotics (GUI or CLI) with stock 60×60×20 and tool table fixtures/tools.json to simulate each, compare with the target and write the matching program name and a one-line reason for each rejected one in out/answer.json.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- CAMotics
- Interfaces
desk· Desktop GUIterm· Terminal- GUI need · task setting
HY· Hybrid- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
vis· Visual judgmentcode· Code & commands- Work product
WP12· Answer/decision- Conditions
- None declared
- Proposed difficulty
- 2 / 5
Proposed verifier
answer.json correct program; rejection reasons match key categories (wrong depth, mirrored, missing hole, wrong tool) for ≥3/4.
Proposed partial credit
70% correct program; 30% rejection reasons
R07.07.01.02-T20 Correct feeds and speeds to a chip-load spec for each operation
Original instruction
fixtures/housing_ops.ngc uses six tools on 304 stainless. Using the vendor cutting data in docs/feeds_304.pdf (SFM and chip load per tooth by diameter) and tool data in docs/tools.csv, recompute S and F for every cutting block (respect 12,000 rpm max) and write out/housing_ops_fixed.ngc plus out/calc.csv.
- Platforms
lin· Linuxmac· macOSwin· Windows- Applications
- text editor · Python
- Interfaces
term· Terminal- GUI need · task setting
CL· CLI-sufficient- GUI need · ordinary access
CL· CLI-sufficient- Interaction primitives
code· Code & commands- Work product
WP06· Code/engineering- Conditions
- None declared
- Proposed difficulty
- 3 / 5
Proposed verifier
Each tool's S within 1% of SFM-derived rpm (clamped at max); F = rpm × z × chipload ±1%; motion unchanged; calc.csv values consistent.
Proposed partial credit
40% spindle speeds; 40% feeds; 20% motion unchanged & calc table
Mapped research references
No benchmark reference is assigned to this class in the current mapping.