step-examples/12-6-assembly/A118.stp
Sources
- occt-coverage GAP audit, `exchange/problems.json` `stp-srr-nauo-reversed`
- `STEPControl_ActorRead::TransferEntity(StepRepr_NextAssemblyUsageOccurrence)`, STEPControl_ActorRead.cxx:701-730 @ bd2a789f15235755ce4d1a3b07379a2e062fdc2e
- `STEPConstruct_Assembly::CheckSRRReversesNAUO`, STEPConstruct_Assembly.cxx:171-217
- `STEPConstruct_Assembly::MakeRelationship`, STEPConstruct_Assembly.cxx:76-122 (OCCT's own writer convention for the non-reversed case).
Sender
deduced — OCCT uncovered-class sweep
Description
A `NEXT_ASSEMBLY_USAGE_OCCURRENCE` declares Parent as relating (assembly) and Child as related (component). A `CONTEXT_DEPENDENT_SHAPE_REPRESENTATION` wraps a `SHAPE_REPRESENTATION_RELATIONSHIP` whose `rep_1`/`rep_2` are wired OPPOSITE to OCCT's own writer convention for that NAUO direction (`rep_1`=Parent's representation, `rep_2`=Child's — `STEPConstruct_Assembly::MakeRelationship` always emits `rep_1`=child, `rep_2`=parent). Both Parent and Child carry real, distinguishable geometry via their own independent `PRODUCT_DEFINITION`→...→`SHAPE_DEFINITION_REPRESENTATION` chains (Parent: 1×1 marker face at the origin; Child: 5×5 marker face at x∈[100,105]) — unlike M062, whose NAUO/SRR pair sits inside a `GEOMETRIC_CURVE_SET` with EMPTY `SHAPE_REPRESENTATION` items, so the reversal there is bytes-present but shape-unobservable (empty either way). `TransferEntity(NAUO)` walks `graph.Sharings(NAUO)`→PDS→`graph.Sharings(PDS)`→CDSR and calls `CheckSRRReversesNAUO`, which detects the swap and returns True; the reader emits `AddWarning(SRR, "SRR reverses relation defined by NAUO; NAUO definition is taken")` and silently resolves using NAUO's direction rather than rejecting the conflicting file.
Reproducer recipe
`NEXT_ASSEMBLY_USAGE_OCCURRENCE('1','','uses',#parent_pd,#child_pd,$)`; `CONTEXT_DEPENDENT_SHAPE_REPRESENTATION(#srr,#pds)` where `#pds=PRODUCT_DEFINITION_SHAPE('Placement','Placement of an item',#nauo)` and `#srr=SHAPE_REPRESENTATION_RELATIONSHIP('rel','',#parent_rep,#child_rep)` (opposite of the writer's own `#child_rep,#parent_rep` convention).
Expected kernel behavior
reject the conflict with a diagnostic (the SRR and NAUO disagree on parent/child direction — one of the two is authored wrong); or trust NAUO by convention and make the choice explicit in a loud warning. Must not silently resolve without surfacing the conflict to the caller.
Notes
**See also**: M062 (byte-only precedent — this fixture is the live-shape-observable upgrade). Root-reachability finding: a bare, unreferenced CDSR does not independently transfer via `TransferRoots()` in this OCCT build (see U051's Notes) — the CDSR here is instead discovered via the standard NAUO-root walk (`TransferEntity(NAUO)`'s internal `graph.Sharings` traversal), which requires both Parent and Child to carry their own real, independently-reachable representations. Live-verified (2026-07-12, OCP 7.8.1, direct `STEPControl_Reader` probing — not mirrored/guessed): `shape_null=False`; the transferred compound carries geometry from BOTH the Parent's own SDR chain and the Child's own SDR chain PLUS an additional CDSR-driven contribution (`n_faces_total=4`, `n_edges_total=16`, `n_vertices_total=32` — twice the 2-face/8-edge/16-vertex baseline of either SDR alone, confirming the CDSR's own `TransferEntity` call independently produced a live shape rather than being skipped or erroring). Provenance tier: bytes-sufficient. Synonyms: "assembly direction conflict", "SRR vs NAUO direction mismatch", "parent/child conflict in STEP", "assembly relation reversed", "CDSR silently resolved reversal", "NAUO definition is taken".
Expected validation
occt=shape(1)/shape(1) gmsh=shape(18) ifc=schema_n/a
Byte assertions
contains(b'NEXT_ASSEMBLY_USAGE_OCCURRENCE')contains(b'CONTEXT_DEPENDENT_SHAPE_REPRESENTATION')contains(b"SHAPE_REPRESENTATION_RELATIONSHIP('rel','',#39,#82)")
Tier-3 assertions
shape_null == Falsen_faces_total == 4
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* A118: NAUO + SRR wired through a real CDSR, SRR direction OPPOSITE to NAUO */ 3/* DEFECT: CheckSRRReversesNAUO detects the reversal; TransferEntity(NAUO) warns */ 4/* 'SRR reverses relation defined by NAUO; NAUO definition is taken' and silently */ 5/* resolves via NAUO's direction instead of rejecting the file -- both Parent/Child */ 6/* carry real, distinguishable geometry (unlike M062's empty-items curve-set orphan) */ 7HEADER; 8FILE_DESCRIPTION(('A118: SRR reverses NAUO direction, wired through a real CDSR'),'2;1'); 9FILE_NAME('A118.stp','2026-07-12T00:00:00',(''),(''),'cad-research-suite','',''); 10FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 11ENDSEC; 12DATA; 13#100=APPLICATION_CONTEXT('mechanical design'); 14#101=(GEOMETRIC_REPRESENTATION_CONTEXT(3)REPRESENTATION_CONTEXT('','3D')); 15/* ---- Parent product: small 1x1 marker face at the origin ---- */ 16#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 17#2=DIRECTION('',(0.0,0.0,1.0)); 18#3=DIRECTION('',(1.0,0.0,0.0)); 19#4=AXIS2_PLACEMENT_3D('',#1,#2,#3); 20#5=PLANE('',#4); 21#6=CARTESIAN_POINT('',(0.0,0.0,0.0)); 22#7=CARTESIAN_POINT('',(1.0,0.0,0.0)); 23#8=CARTESIAN_POINT('',(1.0,1.0,0.0)); 24#9=CARTESIAN_POINT('',(0.0,1.0,0.0)); 25#10=VERTEX_POINT('',#6); 26#11=VERTEX_POINT('',#7); 27#12=VERTEX_POINT('',#8); 28#13=VERTEX_POINT('',#9); 29#14=DIRECTION('',(1.0,0.0,0.0)); 30#15=VECTOR('',#14,1.0); 31#16=LINE('',#6,#15); 32#17=EDGE_CURVE('',#10,#11,#16,.T.); 33#18=DIRECTION('',(0.0,1.0,0.0)); 34#19=VECTOR('',#18,1.0); 35#20=LINE('',#7,#19); 36#21=EDGE_CURVE('',#11,#12,#20,.T.); 37#22=DIRECTION('',(-1.0,0.0,0.0)); 38#23=VECTOR('',#22,1.0); 39#24=LINE('',#8,#23); 40#25=EDGE_CURVE('',#12,#13,#24,.T.); 41#26=DIRECTION('',(0.0,-1.0,0.0)); 42#27=VECTOR('',#26,1.0); 43#28=LINE('',#9,#27); 44#29=EDGE_CURVE('',#13,#10,#28,.T.); 45#30=ORIENTED_EDGE('',$,$,#17,.T.); 46#31=ORIENTED_EDGE('',$,$,#21,.T.); 47#32=ORIENTED_EDGE('',$,$,#25,.T.); 48#33=ORIENTED_EDGE('',$,$,#29,.T.); 49#34=EDGE_LOOP('',(#30,#31,#32,#33)); 50#35=FACE_OUTER_BOUND('',#34,.T.); 51#36=ADVANCED_FACE('',(#35),#5,.T.); 52#37=OPEN_SHELL('',(#36)); 53#38=SHELL_BASED_SURFACE_MODEL('',(#37)); 54#39=SHAPE_REPRESENTATION('parent_rep',(#38),#101); 55#40=PRODUCT_CONTEXT('',#100,'mechanical'); 56#41=PRODUCT('Parent','Parent','',(#40)); 57#42=PRODUCT_DEFINITION_FORMATION('','',#41); 58#43=PRODUCT_DEFINITION_CONTEXT('part definition',#100,'design'); 59#44=PRODUCT_DEFINITION('','',#42,#43); 60#45=PRODUCT_DEFINITION_SHAPE('','',#44); 61#46=SHAPE_DEFINITION_REPRESENTATION(#45,#39); 62/* ---- Child product: bigger 5x5 marker face at (100,0,0) ---- */ 63#50=CARTESIAN_POINT('',(100.0,0.0,0.0)); 64#51=AXIS2_PLACEMENT_3D('',#50,#2,#3); 65#52=PLANE('',#51); 66#53=CARTESIAN_POINT('',(100.0,0.0,0.0)); 67#54=CARTESIAN_POINT('',(105.0,0.0,0.0)); 68#55=CARTESIAN_POINT('',(105.0,5.0,0.0)); 69#56=CARTESIAN_POINT('',(100.0,5.0,0.0)); 70#57=VERTEX_POINT('',#53); 71#58=VERTEX_POINT('',#54); 72#59=VERTEX_POINT('',#55); 73#60=VERTEX_POINT('',#56); 74#61=VECTOR('',#14,5.0); 75#62=LINE('',#53,#61); 76#63=EDGE_CURVE('',#57,#58,#62,.T.); 77#64=VECTOR('',#18,5.0); 78#65=LINE('',#54,#64); 79#66=EDGE_CURVE('',#58,#59,#65,.T.); 80#67=VECTOR('',#22,5.0); 81#68=LINE('',#55,#67); 82#69=EDGE_CURVE('',#59,#60,#68,.T.); 83#70=VECTOR('',#26,5.0); 84#71=LINE('',#56,#70); 85#72=EDGE_CURVE('',#60,#57,#71,.T.); 86#73=ORIENTED_EDGE('',$,$,#63,.T.); 87#74=ORIENTED_EDGE('',$,$,#66,.T.); 88#75=ORIENTED_EDGE('',$,$,#69,.T.); 89#76=ORIENTED_EDGE('',$,$,#72,.T.); 90#77=EDGE_LOOP('',(#73,#74,#75,#76)); 91#78=FACE_OUTER_BOUND('',#77,.T.); 92#79=ADVANCED_FACE('',(#78),#52,.T.); 93#80=OPEN_SHELL('',(#79)); 94#81=SHELL_BASED_SURFACE_MODEL('',(#80)); 95#82=SHAPE_REPRESENTATION('child_rep',(#81),#101); 96#83=PRODUCT_CONTEXT('',#100,'mechanical'); 97#84=PRODUCT('Child','Child','',(#83)); 98#85=PRODUCT_DEFINITION_FORMATION('','',#84); 99#86=PRODUCT_DEFINITION('','',#85,#43); 100#87=PRODUCT_DEFINITION_SHAPE('','',#86); 101#88=SHAPE_DEFINITION_REPRESENTATION(#87,#82); 102/* ---- NAUO: Parent(#44) relating (parent), Child(#86) related (child) ---- */ 103#90=NEXT_ASSEMBLY_USAGE_OCCURRENCE('1','','uses',#44,#86,$); 104#91=PRODUCT_DEFINITION_SHAPE('Placement','Placement of an item',#90); 105/* DEFECT: SRR wired OPPOSITE the NAUO direction -- Rep1=parent_rep(#39), Rep2=child_rep(#82); */ 106/* OCCT's own writer convention (STEPConstruct_Assembly::MakeRelationship) always emits */ 107/* Rep1=child,Rep2=parent for this NAUO direction -- this file swaps them. */ 108#92=SHAPE_REPRESENTATION_RELATIONSHIP('rel','',#39,#82); 109#93=CONTEXT_DEPENDENT_SHAPE_REPRESENTATION(#92,#91); 110ENDSEC; 111END-ISO-10303-21;