step-examples/12-8-mixed/M182.stp
Sources
- 16-iso-spec ISO 10303-238 §5.4 setup_instruction chronology rule
- ISO 8601 ordering
- bug-reporter language: "AP238 setup steps out of order", "STEP-NC setup timestamps wrong", "operator instructions go backward in time".
Description
A sequence of `SETUP_INSTRUCTION` entities (mount fixture, locate workpiece, tighten clamps) carries time_stamps in non-monotonic order: instruction A at 09:00, B at 08:30, C at 09:15. Either the publisher copied stamps from a different job or the operator instructions were re-ordered without updating times. Bug-reporter language: "AP238 setup-instruction order wrong", "STEP-NC setup timestamps backwards", "operator step time goes back".
Reproducer recipe
three `SETUP_INSTRUCTION` entities with timestamps `2026-05-02T09:00:00`, `2026-05-02T08:30:00`, `2026-05-02T09:15:00` (non-monotonic).
Expected kernel behavior
warn-and-accept; validate timestamp monotonicity along setup-instruction sequence and emit a diagnostic on inversions.
Notes
Synonyms: "AP238 setup-instruction time inversion", "STEP-NC operator steps non-monotonic", "setup chronology wrong", "instruction timestamps decreasing".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b'AP238_STEP_NC_MIM')contains(b'SETUP_INSTRUCTION')contains(b'2026-05-02T09:00:00')contains(b'2026-05-02T08:30:00')
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/* M182: AP238 setup_instruction sequence with non-monotonic time stamps */ 3/* DEFECT: timestamps 09:00 -> 08:30 -> 09:15 are non-monotonic */ 4/* Instruction 'locate_workpiece' at 08:30 goes backward from 'mount_fixture' 09:00 */ 5/* Publisher copied stamps from different job or steps re-ordered without update */ 6/* Per ISO 10303-238 §5.4 and ISO 8601: setup-instruction timestamps must be monotonic */ 7/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */ 8/* Byte assertion: contains(b'SETUP_INSTRUCTION') */ 9/* Byte assertion: contains(b'2026-05-02T09:00:00') */ 10/* Byte assertion: contains(b'2026-05-02T08:30:00') */ 11HEADER; 12FILE_DESCRIPTION(('M182: AP238 setup_instruction non-monotonic timestamps'),'2;1'); 13FILE_NAME('M182.stp','2026-06-21T00:00:00',(''),(''),'cad-research-suite','',''); 14/* Byte assertion: contains(b'AP238_STEP_NC_MIM') */ 15FILE_SCHEMA(('AP238_STEP_NC_MIM { 1 0 10303 238 3 1 1 1 }')); 16ENDSEC; 17DATA; 18/* Standard unit context (mm) */ 19#10=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 20#11=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 21#12=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 22#13=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.001),#10, 23 'distance_accuracy_value','maximum model space distance between geometric entities'); 24#14=(GEOMETRIC_REPRESENTATION_CONTEXT(3) 25 GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#13)) 26 GLOBAL_UNIT_ASSIGNED_CONTEXT((#10,#11,#12)) 27 REPRESENTATION_CONTEXT('ctx','3D')); 28/* mm length unit reference for MEASURE_WITH_UNIT */ 29#15=SI_UNIT(.MILLI.,.METRE.); 30/* GEOMETRIC_CURVE_SET IS the model entity â OCC yields empty */ 31#20=GEOMETRIC_CURVE_SET('ap238-setup-instruction-non-monotonic-timestamps', 32 (#51,#60)); 33/* Byte assertion: contains(b'SETUP_INSTRUCTION') */ 34/* Step 1: mount_fixture at 09:00 â first step, valid starting time */ 35/* Byte assertion: contains(b'2026-05-02T09:00:00') */ 36#40=SETUP_INSTRUCTION('mount_fixture','Mount fixture on machine table','2026-05-02T09:00:00',$); 37/* DEFECT: locate_workpiece at 08:30 â goes BACKWARD from mount_fixture at 09:00 */ 38/* Byte assertion: contains(b'2026-05-02T08:30:00') */ 39#41=SETUP_INSTRUCTION('locate_workpiece','Locate workpiece in fixture','2026-05-02T08:30:00',$); 40/* Step 3: tighten_clamps at 09:15 â forward from step 1 but after backward step 2 */ 41#42=SETUP_INSTRUCTION('tighten_clamps','Tighten workpiece clamps','2026-05-02T09:15:00',$); 42/* WORKPIECE 'setup_workpiece' */ 43#60=WORKPIECE('setup_workpiece','Workpiece for non-monotonic setup test',$,$,$,$,$); 44/* SETUP 'machine_setup' references all three setup instructions in declared order */ 45/* Declared sequence: #40 (09:00), #41 (08:30), #42 (09:15) â DEFECT: non-monotonic */ 46#51=SETUP('machine_setup',$,$,(#40,#41,#42),#60); 47/* WORKPLAN: non-monotonic setup followed by no operations */ 48#50=WORKPLAN('non_monotonic_setup_program','Non-monotonic setup instruction workplan',(),$,()); 49/* Product chain */ 50#100=APPLICATION_CONTEXT('mechanical design'); 51#101=PRODUCT_CONTEXT('',#100,'mechanical'); 52#102=PRODUCT('M182','M182','M182',(#101)); 53#103=PRODUCT_DEFINITION_FORMATION('','',#102); 54#104=PRODUCT_DEFINITION_CONTEXT(#100,'design'); 55#105=PRODUCT_DEFINITION('','',#103,#104); 56#106=PRODUCT_DEFINITION_SHAPE('','',#105); 57#107=SHAPE_REPRESENTATION('',(#20),#14); 58#108=SHAPE_DEFINITION_REPRESENTATION(#106,#107); 59ENDSEC; 60END-ISO-10303-21;