Skip to content

write_class_map is not a byte-exact AutoCAD emitter (size_in_bits field lacks +32; string-stream trailer omitted) #45

Closed

Description

@DrunkOnJava

#41 documents that write_class_map writes the size-in-bits field as the raw bit length where real files carry that + 32, and omits the §19.4.1 string-stream trailer. Nothing reads these back so the round trip is exact, but if the writer is ever aimed at real-CAD acceptance both must be emitted. Low priority; tracked so it is not forgotten.

Activity

  1. added
    type:bug
    area:writer
    priority:P2
    and removed on Oct 21, 2026
  2. DrunkOnJava commented on Oct 25, 2026

    @DrunkOnJava
    OwnerAuthor

    Two more departures from real files, measured October 25, 2026 while building the R13–R2000 streaming walk (#205):

    1. CRC coverage. write_class_map computes its CRC over the sentinel, size and data. In every real file checked it covers the size and data only, starting after the sentinel (seed 0xC0C1): all 14 R14/R2000 files at nextgis/dwg_samples@ff05d5a (§10.1, matching §9's "starting after the sentinel" wording) and line_2004.dwg (R2004). R2010 and R2013 classes matched none of the simple coverages tried (size+data, sentinel+size+data, with and without the 8 extra bytes), so their rule is still unmeasured.
    2. R13–R15 preamble. For every release the writer opens the class data with BL max class number and a B. §10.1 has no such preamble for R13–R15: class records start right after the RL size. It also writes no end sentinel for R13–R15, where §10.1 requires one.

    The reader never checks the class CRC, so the round trip still passes. The canonical R2000 fixture therefore does not use this writer; build_fixtures frames its (empty) class section directly with the CRC rule above, and the streaming walk verifies it.

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:writerpriority:P2type:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions