Skip to content

fix(objects): VISUALSTYLE's R2013+ tail property types, as AutoCAD's DXF export lists them - #251

Merged
DrunkOnJava merged 2 commits into
mainfrom
fix/visualstyle-tail
Oct 26, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
fix/visualstyle-tail

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

VISUALSTYLE's 30 R2013+ tail properties now have the types AutoCAD's DXF export lists for them: slot 10 is a real, 24 a real, 25 an integer and 26 a string (strokes_ogs.tif, which the decoder kept as an unplaced trailing string). Every tail value and flag then equals the export on all 240 R2013 and R2018 records.

Spec reference

VISUALSTYLE has no prescription in v5.4.1 (§20.3 lists it; §20.4 does not; beyond-spec classes are #152). The tail's types were measured as the one BS/BD/B/CMC token sequence that closes every record on its string-stream start. That sequence is not unique: a BS 0 and a BD 0.0 are the same two bits (10), and the run read as B, B, BS at slots 24-26 takes the same bits as the BD, BS, TV it is (a TV's text is in the string stream and costs no data bits). AutoCAD's export writes the 58 properties as a counted list of typed groups (70 = 58, then each value group and its 176 flag), which decides it.

VisualStyleValue gains a Text variant (read from the string stream at its slot); trailing_strings is empty on every corpus record. The synthetic R2013 test's one assertion on the string moves to the slot; no test added.

Test plan

cargo run --release --features dxf-reader --example dxf_oracle -- <corpus-dir>

Before (main), the tail slots that disagree:

  field                                    group            R14   R2000   R2004   R2007   R2010   R2013   R2018   total
  extended[10]                             40                                                   ≠192/192  ≠48/48   0/0/240/0
  extended[10] flag                        176                                                        =       =   240/0/0/0
  extended[24]                             40                                                   ≠192/192  ≠48/48   0/0/240/0
  extended[24] flag                        176                                                  ≠192/192  ≠48/48   0/0/240/0
  extended[25]                             90                                                   ≠192/192  ≠48/48   0/0/240/0
  extended[25] flag                        176                                                  ≠192/192  ≠48/48   0/0/240/0
  extended[26]                             1                                                    ≠192/192  ≠48/48   0/0/240/0
  extended[26] flag                        176                                                        =       =   240/0/0/0

After (this branch):

  field                                    group            R14   R2000   R2004   R2007   R2010   R2013   R2018   total
  extended[10]                             40                                                         =       =   240/0/0/0
  extended[10] flag                        176                                                        =       =   240/0/0/0
  extended[24]                             40                                                         =       =   240/0/0/0
  extended[24] flag                        176                                                        =       =   240/0/0/0
  extended[25]                             90                                                         =       =   240/0/0/0
  extended[25] flag                        176                                                        =       =   240/0/0/0
  extended[26]                             1                                                          =       =   240/0/0/0
  extended[26] flag                        176                                                        =       =   240/0/0/0

1,440 disagreeing values become 0; the other 26 tail slots and all 28 named properties already agreed and still do. Every named VISUALSTYLE property also equals the export on R2000-R2010 under its own DXF group, which corroborates the decoder's positional names (its docs said only the face group was). Two VISUALSTYLE values still differ and are filed separately (#250): format_version (DWG 2, export 177 = 3 on R2013+) and Realistic's face lighting quality on R2000-R2007 (DWG 2, export 3).

Source-provenance declaration

By submitting this PR I certify that my contribution does not incorporate executable code from any source whose license is incompatible with Apache-2.0. Specifically:

  • No Autodesk DWG SDK source (RealDWG, ObjectARX, ObjectDBX) or NDA-protected Autodesk documentation was consulted or imported.
  • No Open Design Alliance Teigha / Drawings SDK source was consulted or imported. The ODA's public Open Design Specification for .dwg files PDF is explicitly allowed (see CLEANROOM.md).
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported.

Based on the corpus bytes and AutoCAD's own DXF exports in nextgis/dwg_samples and the ACadSharp samples/ directory, read as data; the DXF group codes are the public DXF Reference's (recorded in CLEANROOM.md). No permissively-licensed project's code or comments were read.

Developer Certificate of Origin

By submitting this PR, I certify that the contribution complies with the Developer Certificate of Origin 1.1.

Refs #99, #152

…DXF export lists them

The 30 R2013+ tail properties were measured as the token sequence over
BS/BD/B/CMC that lands every record on its string-stream start. That
sequence was not unique: a BS and a BD of 0 are the same two bits, and
the run read as B, B, BS at slots 24-26 takes the same bits as the BD,
BS, TV it is. AutoCAD's DXF export writes the 58 properties as a
counted list of typed groups, and the DXF value oracle found slot 10 a
real (40, 0.0), 24 a real (1.0), 25 an integer (2) and 26 a string,
strokes_ogs.tif, the TV the decoder kept as an unplaced trailing string.
With those types every tail value and flag equals the export on all 240
R2013 and R2018 records of the nextgis and ACadSharp corpora, where
1,440 disagreed before (slots 10 and 24-26 and their flags). Coverage
is unchanged: the two readings consume the same bits.

VisualStyleValue gains a Text variant; the synthetic R2013 test's
string moves from trailing_strings to its slot.

Refs #99
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-26T10:31:28.393652Z d531065 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 26, 2026 10:31
@DrunkOnJava
DrunkOnJava merged commit c0f1c12 into main Oct 26, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/visualstyle-tail branch October 26, 2026 11:04
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
Three more types are compared field by field with AutoCAD's export:
MLEADERSTYLE (§20.4.87) and VIEW (§20.4.60) against their spec's DXF
column, and VISUALSTYLE, which v5.4.1 does not prescribe, against the
DXF Reference's group for each named property.

On the 49 drawing pairs: MLEADERSTYLE's 49 records R2000-R2018 agree on
every decoded value (1914 equal, 36 by the DXF default). VISUALSTYLE's
1,008 records agree on 58,104 values and disagree on 264, all filed on
#250: format_version on R2013 and R2018 (DWG 2, export 3) and Realistic's
face lighting quality on R2000-R2007 (DWG 2, export 3). VIEW's 6 records
agree on 118 values; the R2013 and R2018 Xdep bit disagrees (#256).
Before #251 and #253 these scorers found 1,440 VISUALSTYLE values and
MLEADERSTYLE's two swapped flags wrong.

tools/oracle/baseline.tsv gains the 789 new rows; VIEW and MLEADERSTYLE
in docs/spec-coverage.md say what was measured, and VIEW no longer lists
the pre-R2007 errors #263 fixed. CLEANROOM records the scorers' sources.

Refs #99, #102, #250, #256
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
Three more types are compared field by field with AutoCAD's export:
MLEADERSTYLE (§20.4.87) and VIEW (§20.4.60) against their spec's DXF
column, and VISUALSTYLE, which v5.4.1 does not prescribe, against the
DXF Reference's group for each named property.

On the 49 drawing pairs: MLEADERSTYLE's 49 records R2000-R2018 agree on
every decoded value (1914 equal, 36 by the DXF default). VISUALSTYLE's
1,008 records agree on 58,104 values and disagree on 264, all filed on
#250: format_version on R2013 and R2018 (DWG 2, export 3) and Realistic's
face lighting quality on R2000-R2007 (DWG 2, export 3). VIEW's 6 records
agree on 118 values; the R2013 and R2018 Xdep bit disagrees (#256).
Before #251 and #253 these scorers found 1,440 VISUALSTYLE values and
MLEADERSTYLE's two swapped flags wrong.

tools/oracle/baseline.tsv gains the 789 new rows; VIEW and MLEADERSTYLE
in docs/spec-coverage.md say what was measured, and VIEW no longer lists
the pre-R2007 errors #263 fixed. CLEANROOM records the scorers' sources.

Refs #99, #102, #250, #256
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
Three more types are compared field by field with AutoCAD's export:
MLEADERSTYLE (§20.4.87) and VIEW (§20.4.60) against their spec's DXF
column, and VISUALSTYLE, which v5.4.1 does not prescribe, against the
DXF Reference's group for each named property.

On the 49 drawing pairs: MLEADERSTYLE's 49 records R2000-R2018 agree on
every decoded value (1914 equal, 36 by the DXF default). VISUALSTYLE's
1,008 records agree on 58,104 values and disagree on 264, all filed on
#250: format_version on R2013 and R2018 (DWG 2, export 3) and Realistic's
face lighting quality on R2000-R2007 (DWG 2, export 3). VIEW's 6 records
agree on 118 values; the R2013 and R2018 Xdep bit disagrees (#256).
Before #251 and #253 these scorers found 1,440 VISUALSTYLE values and
MLEADERSTYLE's two swapped flags wrong.

tools/oracle/baseline.tsv gains the 789 new rows; VIEW and MLEADERSTYLE
in docs/spec-coverage.md say what was measured, and VIEW no longer lists
the pre-R2007 errors #263 fixed. CLEANROOM records the scorers' sources.

Refs #99, #102, #250, #256
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
Three more types are compared field by field with AutoCAD's export:
MLEADERSTYLE (§20.4.87) and VIEW (§20.4.60) against their spec's DXF
column, and VISUALSTYLE, which v5.4.1 does not prescribe, against the
DXF Reference's group for each named property.

On the 49 drawing pairs: MLEADERSTYLE's 49 records R2000-R2018 agree on
every decoded value (1914 equal, 36 by the DXF default). VISUALSTYLE's
1,008 records agree on 58,104 values and disagree on 264, all filed on
issue 250: format_version on R2013 and R2018 (DWG 2, export 3) and
Realistic's face lighting quality on R2000-R2007 (DWG 2, export 3).
VIEW's 6 records agree on every decoded value (120 equal), the R2013 and
R2018 Xdep bit included since #293. Before #251 and #253 these scorers
found 1,440 VISUALSTYLE values and MLEADERSTYLE's two swapped flags
wrong.

tools/oracle/baseline.tsv gains the 789 new rows; VIEW and MLEADERSTYLE
in docs/spec-coverage.md say what was measured, and VIEW no longer lists
the pre-R2007 errors #263 fixed. CLEANROOM records the scorers' sources.

Refs #99, #102, #250, #256
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
…le (#279)

Three more types are compared field by field with AutoCAD's export:
MLEADERSTYLE (§20.4.87) and VIEW (§20.4.60) against their spec's DXF
column, and VISUALSTYLE, which v5.4.1 does not prescribe, against the
DXF Reference's group for each named property.

On the 49 drawing pairs: MLEADERSTYLE's 49 records R2000-R2018 agree on
every decoded value (1914 equal, 36 by the DXF default). VISUALSTYLE's
1,008 records agree on 58,104 values and disagree on 264, all filed on
issue 250: format_version on R2013 and R2018 (DWG 2, export 3) and
Realistic's face lighting quality on R2000-R2007 (DWG 2, export 3).
VIEW's 6 records agree on every decoded value (120 equal), the R2013 and
R2018 Xdep bit included since #293. Before #251 and #253 these scorers
found 1,440 VISUALSTYLE values and MLEADERSTYLE's two swapped flags
wrong.

tools/oracle/baseline.tsv gains the 789 new rows; VIEW and MLEADERSTYLE
in docs/spec-coverage.md say what was measured, and VIEW no longer lists
the pre-R2007 errors #263 fixed. CLEANROOM records the scorers' sources.

Refs #99, #102, #250, #256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant