Wr012 — Random `#N` numbering with no monotonic structure

§12.13 writer-pathology (sub-class: instance numbering)

P3 — cosmetic / metadata-only

writer

Sources

Sender

Writers that allocate instance numbers from a hashed pool keyed on entity-identity rather than emit-order; observed in some Java-based exporters

Description

Instance numbers in the DATA section follow no monotonic pattern: `#1`, then `#1000`, then `#5`, then `#1003`, then `#7`. The spec does not mandate monotonic numbering, so the file is well-formed; but human reviewers, line-based diff tools, and forward-reference-detecting linters all stumble. Bug-reporter language: "STEP instance numbers are random", "file numbering jumps", "can't follow refs visually".

Reproducer recipe

a Part-21 file in which the order of `#NNN` in the DATA section is `#1, #1000, #5, #1003, #7, #1006`.

Expected kernel behavior

Heal and accept: parse normally; numbering is content-addressable, not order-bearing; a re-emit policy may normalize / renumber sequentially.

Notes

Discoverability is the main cost; correctness is unaffected.

Expected validation

occt=empty/empty gmsh=empty ifc=schema_n/a

Byte assertions

Tier-3 assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* Wr012: non-monotonic instance numbering in DATA section */
3HEADER;
4FILE_DESCRIPTION(('Wr012 - random instance numbering with no monotonic structure'),'2;1');
5FILE_NAME('Wr012.stp','2026-06-20T00:00:00',('auto-generated'),(''),
6  'auto-generated','','');
7FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
8ENDSEC;
9DATA;
10/* Defect: instance numbers jump: #1, #1000, #5, #1003, #7, #1006 — not monotonic */
11/* The spec permits any positive integer; a conforming kernel must accept these */
12#1=DIRECTION('zdir',(0.,0.,1.));
13#1000=DIRECTION('xdir',(1.,0.,0.));
14#5=CARTESIAN_POINT('origin',(0.,0.,0.));
15#1003=CARTESIAN_POINT('p1',(1.,0.,0.));
16#7=CARTESIAN_POINT('p2',(1.,1.,0.));
17#1006=GEOMETRIC_CURVE_SET('random-ids',(#5,#1003,#7));
18ENDSEC;
19END-ISO-10303-21;