step-examples/12-8-mixed/M092.stp
Sources
- deduced from ISO 10303-238 §6.4 workplan execution semantics
Sender
deduced — STEP-NC publisher emitting workingsteps in authoring order rather than dependency order
Description
A `WORKPLAN` lists its `its_elements` in an order that violates feature dependencies: a finishing pass appears before the roughing pass, or a drilling step on a hole appears before the spot-drilling step that locates it. Per AP238 §6.4 a workplan's element list is the *executable* sequence; order is semantic, not editorial. A controller running the file as written produces a part with a broken/missing locator. Bug-reporter language: "STEP-NC workingsteps run in wrong order", "AP238 finishing before roughing", "workplan order doesn't make sense".
Reproducer recipe
`WORKPLAN('main',(#finish_step, #rough_step),$,$,$)` where `#finish_step` is a finishing `MACHINING_OPERATION` referencing the same feature as `#rough_step` (a roughing operation), with the finishing step listed first.
Expected kernel behavior
validate workingstep ordering against feature dependency graph; warn on suspicious orderings (finishing before roughing on the same feature) or reject as malformed.
Notes
Synonyms: "STEP-NC bad workingstep sequence", "workplan order semantically wrong", "finishing before roughing".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b'AP238_STEP_NC_MIM')contains(b'WORKPLAN(')contains(b'MACHINING_OPERATION')
Tier-3 assertions
shape_null == True
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* M092: AP238 workplan workingsteps in non-executable order */ 3/* DEFECT: WORKPLAN lists finish_step before rough_step on same feature */ 4/* Per AP238 §6.4, its_elements list is the executable sequence */ 5/* Controller runs finish pass before roughing creates clearance â tool breakage */ 6/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */ 7/* Byte assertion: contains(b'WORKPLAN(') */ 8/* Byte assertion: contains(b'MACHINING_OPERATION') */ 9HEADER; 10FILE_DESCRIPTION(('M092: AP238 WORKPLAN with finishing before roughing'),'2;1'); 11FILE_NAME('M092.stp','2026-06-21T00:00:00',(''),(''),'cad-research-suite','',''); 12/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */ 13FILE_SCHEMA(('AP238_STEP_NC_MIM { 1 0 10303 238 1 0 0 }')); 14ENDSEC; 15DATA; 16#1=APPLICATION_CONTEXT('step_nc_mim'); 17#2=APPLICATION_PROTOCOL_DEFINITION('international standard', 18 'ap238_step_nc_mim',2007,#1); 19/* Standard unit context â mm */ 20#10=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 21#11=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 22#12=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 23#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.001),#10, 24 'distance_accuracy_value','maximum model space distance between geometric entities'); 25#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3) 26 GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13)) 27 GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12)) 28 REPRESENTATION_CONTEXT('nc','3D')); 29/* Shared MACHINED_FEATURE that both workingsteps operate on */ 30/* Both roughing and finishing target the same pocket */ 31#50=MACHINED_FEATURE('pocket_a',$,$,$,$,$); 32/* Byte assertion: contains(b'MACHINING_OPERATION') */ 33/* Roughing pass: removes bulk material from pocket_a */ 34#60=MACHINING_TOOL('roughing_endmill',$,$,$); 35#70=MACHINING_OPERATION('rough_pocket_a',#60,$,$,$,$,$,$,#50,$,$); 36/* Finishing pass: light cuts to achieve final tolerance on pocket_a */ 37#61=MACHINING_TOOL('finishing_endmill',$,$,$); 38#71=MACHINING_OPERATION('finish_pocket_a',#61,$,$,$,$,$,$,#50,$,$); 39/* Workingsteps wrapping each operation */ 40#80=MACHINING_WORKINGSTEP('rough_step',#50,#70,$); 41#81=MACHINING_WORKINGSTEP('finish_step',#50,#71,$); 42/* Byte assertion: contains(b'WORKPLAN(') */ 43/* DEFECT: WORKPLAN lists (#81 finish, #80 rough) â finishing before roughing */ 44/* Executable order is: finish_step THEN rough_step â physically wrong */ 45/* Correct order would be: (#80 rough, #81 finish) */ 46#90=WORKPLAN('main',(#81,#80),$,$,$); 47/* GEOMETRIC_CURVE_SET IS the model entity â OCC yields empty */ 48#300=GEOMETRIC_CURVE_SET('ap238-workplan-finishing-before-roughing-wrong-order', 49 (#50,#60,#61,#70,#71,#80,#81,#90)); 50/* Product chain */ 51#400=APPLICATION_CONTEXT('mechanical design'); 52#401=PRODUCT_CONTEXT('',#400,'mechanical'); 53#402=PRODUCT('M092','M092','M092',(#401)); 54#403=PRODUCT_DEFINITION_FORMATION('','',#402); 55#404=PRODUCT_DEFINITION_CONTEXT(#400,'design'); 56#405=PRODUCT_DEFINITION('','',#403,#404); 57#406=PRODUCT_DEFINITION_SHAPE('','',#405); 58#407=SHAPE_REPRESENTATION('',(#300),#14); 59#408=SHAPE_DEFINITION_REPRESENTATION(#406,#407); 60ENDSEC; 61END-ISO-10303-21;