Wr027 — Unit context emitted twice with different units (HEADER vs DATA mismatch)

§12.13 writer-pathology (sub-class: header / vendor metadata)

P1 — silent data loss

writer

Sources

Sender

Writers where the HEADER is composed by a templating subsystem and the DATA-section unit context is emitted by a separate geometry serialiser, with no cross-check

Description

`FILE_NAME` or `FILE_DESCRIPTION` lists `'mm'` as the unit (informally, in the description string), while the DATA-section `LENGTH_UNIT` resolves to `INCH` (or vice versa). The geometry is correct in DATA-section units; the HEADER claim is decorative but misleading. Bug-reporter language: "header says mm, geometry is inches", "STEP file has two different units", "unit declaration contradicts geometry".

Reproducer recipe

`FILE_DESCRIPTION(('part in mm'),'2;1')` paired with a `LENGTH_UNIT` resolving to `INCH` (`#20=(LENGTH_UNIT() NAMED_UNIT(*) CONVERSION_BASED_UNIT('INCH',#21))`).

Expected kernel behavior

Warn and accept: normalize by trusting the DATA-section unit context (the schema-meaningful one) and treat HEADER prose as informational. Emit a warning on mismatch.

Notes

§12.5 covers unit defects; Wr027 documents producer-side root cause. Provenance tier: writer-side (Q5 full-corpus 2026-07-01).

Expected validation

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

Provenance tier

writer-side — defect not fully embodied in fixture bytes.

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/* Wr027: unit context emitted twice with different units (HEADER vs DATA mismatch) */
3/* HEADER description prose claims 'part in mm'; DATA-section LENGTH_UNIT is INCH */
4/* Geometry is correct at DATA-section (INCH) scale; the HEADER string is decorative */
5/* Produced by writers with separate HEADER-templating and geometry-serialisation subsystems */
6HEADER;
7/* DEFECT: FILE_DESCRIPTION says 'part in mm' but DATA section uses INCH */
8FILE_DESCRIPTION(('part in mm'),'2;1');
9FILE_NAME('Wr027.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','','');
10FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
11ENDSEC;
12DATA;
13/* Geometry: a 1-inch unit cube edge expressed in INCH-scale coordinates */
14#1=CARTESIAN_POINT('origin',(0.,0.,0.));
15#2=CARTESIAN_POINT('corner',(1.,1.,0.));
16#3=DIRECTION('xdir',(1.,0.,0.));
17#4=DIRECTION('zdir',(0.,0.,1.));
18#5=GEOMETRIC_CURVE_SET('inch-geometry',());
19/* DEFECT: LENGTH_UNIT resolves to INCH, contradicting the HEADER 'part in mm' claim */
20#10=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(25.4),#20);
21#20=(LENGTH_UNIT()NAMED_UNIT(*)CONVERSION_BASED_UNIT('INCH',#21));
22#21=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
23#22=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
24#23=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
25ENDSEC;
26END-ISO-10303-21;