Skip to content

R2004 symbol-table field lists are unvalidated past the object header: LTYPE description and LAYER colour/lineweight decode silently wrong #34

Closed

Description

@DrunkOnJava

After #27 the AC1018 object header is right (R2004 samples decode with zero errors), but the pre-R2007 per-table field lists were never validated: LTYPE description decodes as garbage ('lid line\0…'), LAYER color_index/lineweight are junk (colour read as a plain BS where the spec has a CMC). These are silent-wrong decodes, the worst class. Do: (1) add obj_size self-validation to the pre-R2010 decode path (RawObject::obj_size_bits is the analogue of the string-stream start bit; a SplitStream::finish-style check) — this will turn the silent-wrong decodes into honest errors and raise the R2004 error count until (2) each table's field list is fixed against spec §20.4.x with BitWriter tests. Decide deliberately whether to land (1) before (2).

Activity

  1. added
    type:bug
    area:tables
    release:R2004
    priority:P1
    and removed on Oct 21, 2026
  2. DrunkOnJava commented on Oct 26, 2026

    @DrunkOnJava
    OwnerAuthor

    Measured by the DXF value oracle (#99; examples/dxf_oracle in #248) against AutoCAD's own DXF export of the same drawings, on the R2000 and R2004 saves of nextgis/dwg_samples (ff05d5a8) and ACadSharp samples/ (c30a97ce), records paired by handle:

    • LTYPE description (3): equal on every LTYPE of every release, R2000 to R2018 (156 records), pattern_length, alignment and the dash count too;
    • LAYER color_index (62) and lineweight (370): equal on every layer of every release (150 records), except the three true-colour layers whose 62 the export derives from the RGB (LAYER does not surface its true colour (R2004+) #245);
    • the pre-R2010 table path checks each record's field list against its RL object-data size (entities::dispatch, the inline data_end check), so item (1) is in place.

    The symptoms this issue describes are gone on the corpus; #248 closes it when it lands and moves §20.4.54 LAYER to closes in docs/spec-coverage.md. The one LTYPE value that still disagrees is a complex-linetype shape flag, tracked as #242.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:tablespriority:P1release:R2004type:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions