Skip to content

feat(dxf): score VISUALSTYLE, MLEADERSTYLE and VIEW in the value oracle - #279

Merged
DrunkOnJava merged 1 commit into
mainfrom
feat/dxf-oracle-more-scorers
Oct 26, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
feat/dxf-oracle-more-scorers

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

The value oracle scores three more types: 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.

One commit on main, after #248 and #277.

Measured (49 drawing pairs, R2000-R2018)

Type Records Equal Default Different DWG only Not decoded Filed
MLEADERSTYLE §20.4.87 49 1914 36 0 108 251
VIEW §20.4.60 6 120 0 0 12 86
VISUALSTYLE 1008 58104 0 264 816 6936 #250

The ratchet baseline tools/oracle/baseline.tsv gains the 789 new rows, regenerated on current main (it passes against main's: no count fell). release-1.0-criteria.md R4: 46 sections compared, still 19 disagreeing values (#241-#244). docs/spec-coverage.md: VIEW and MLEADERSTYLE say what was measured, and VIEW no longer lists the pre-R2007 errors #263 fixed. release-1.0-criteria.md R4/R5 updated; CLEANROOM entry for the scorers' sources.

Test plan

  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features, python3 tools/ci/spec_coverage.py --check
  • Oracle over the 102 pinned files with --baseline (the previous baseline, then the regenerated one): exit 0, and the regenerated TSV reproduces byte for byte
  • The Corpus job's oracle step green (CI)

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 ODA spec v5.4.1 (§20.4.60 and §20.4.87 DXF columns), Autodesk's public DXF Reference (recalled) for VISUALSTYLE, and AutoCAD's DXF exports in nextgis/dwg_samples and ACadSharp's samples/ read as data; recorded in CLEANROOM.md.

Developer Certificate of Origin

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

Refs #99, #102, #250, #256.

@DrunkOnJava
DrunkOnJava force-pushed the feat/dxf-oracle-more-scorers branch 2 times, most recently from f39b786 to ca1aa14 Compare October 26, 2026 11:42
@DrunkOnJava
DrunkOnJava force-pushed the feat/dxf-oracle-more-scorers branch from ca1aa14 to 592e446 Compare October 26, 2026 11:52
@DrunkOnJava
DrunkOnJava force-pushed the feat/dxf-oracle-more-scorers branch 7 times, most recently from 08a9824 to c7d9d5c Compare October 26, 2026 12:37
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
DrunkOnJava force-pushed the feat/dxf-oracle-more-scorers branch from c7d9d5c to abeb20a Compare October 26, 2026 17:54
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review October 26, 2026 17:54
@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 ✅ Completed 2026-10-26T17:56:40.231897Z abeb20a Draft marked ready
ℹ️ 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 18:01
@DrunkOnJava
DrunkOnJava merged commit da116c8 into main Oct 26, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/dxf-oracle-more-scorers branch October 26, 2026 18:05
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
§20.4.60 stores VIEW's view mode as four bits, "0: 71's bit 0 (1), 1:
71's bit 1 (2), 2: 71's bit 2 (4), 3: OPPOSITE of 71's bit 4 (16)", and
notes that bit 3 (8) of group 71 "can not be specified". Both VIEW paths
surfaced the raw bits; they now surface the group-71 value through the
conversion VPORT uses (§20.4.64, #238), with no UCSFOLLOW bit.

The DXF value oracle compares ViewEntry::view_mode with group 71
directly now, instead of converting the stored bits in its scorer: equal
on all 6 VIEW records, R2000 to R2018. Its baseline row is renamed from
"view_mode (stored bits, as group 71)" to "view_mode". The two VIEW
round-trip tests write the bits 0001, whose group-71 value is 0.

Closes #256 (with #263, #279 and #293, every decoded VIEW value now equals the export).
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
§20.4.60 stores VIEW's view mode as four bits, "0: 71's bit 0 (1), 1:
71's bit 1 (2), 2: 71's bit 2 (4), 3: OPPOSITE of 71's bit 4 (16)", and
notes that bit 3 (8) of group 71 "can not be specified". Both VIEW paths
surfaced the raw bits; they now surface the group-71 value through the
conversion VPORT uses (§20.4.64, #238), with no UCSFOLLOW bit.

The DXF value oracle compares ViewEntry::view_mode with group 71
directly now, instead of converting the stored bits in its scorer: equal
on all 6 VIEW records, R2000 to R2018. Its baseline row is renamed from
"view_mode (stored bits, as group 71)" to "view_mode". The two VIEW
round-trip tests write the bits 0001, whose group-71 value is 0.

Closes #256 (with #263, #279 and #293, every decoded VIEW value now equals the export).
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