Skip to content

feat(objects): decode MATERIAL from AutoCAD's own DWG and DXF output (#49, #152) - #325

Merged
DrunkOnJava merged 8 commits into
mainfrom
feat/unp-material
Oct 27, 2026
Merged

DrunkOnJava merged 8 commits into
mainfrom
feat/unp-material

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Decodes MATERIAL (AcDbMaterial) on every release from R14 to R2018. ODA spec v5.4.1 prints no layout for it; the field list is derived by the CLEANROOM.md method of 2026-10-26 from the data bits of AutoCAD-written drawings and AutoCAD's own DXF export of the same handles.

Spec reference

None: §20.3 lists MATERIAL and §20.4 has no entry, so there is no docs/data/spec-coverage.tsv row; the class row in docs/spec-coverage.md ("Classes the spec does not prescribe") moves partial to closes. Layout and evidence table: ARCHITECTURE.md §7s (provisional letter). Method and per-class record: CLEANROOM.md (2026-10-26, two entries).

Evidence (cargo run --release --example probe_material -- ../dwg-corpus, exit 0):

Release Records Close Values compared Differ
R14 32 32 no DXF twin
R2000 32 32 2,509 0
R2004 32 32 2,509 0
R2007 32 32 2,528 0
R2010 32 32 2,528 0
R2013 32 32 2,528 0
R2018 20 20 456 0
Total 212 212 13,058 0

Corpus baseline: decoded +212, skipped -212, errored 0 (measure.py check passes against the committed tools/corpus/baseline.tsv). From R2007 the boundary cannot see the map-source conditional, so the decoder also requires the string stream to be exhausted. Fields no DXF group shows are named unknown_* or documented as unverified by value in ARCHITECTURE.md §7s; a colour method or map source other than 0 or 1, a non-zero tail slot and a wider group 93 or 94 are refused as Error::Unsupported.

Test plan

  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features, cargo test --release --all-features pass locally
  • Shown working on real files: probe_material over the 52 pinned drawings (212 MATERIAL records, 13,058 values against the DXF twins, 0 differ)
  • python3 tools/ci/spec_coverage.py --check passes
  • No new unit tests. Tests touched: none. read_strings and the two tests of it in acad_material.rs are kept as they were; examples/probe_material.rs (a budget probe) is replaced by the twin probe, over examples/support/twin.rs (byte-identical to the objects lane's copy, md5 f4c195ca).

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.
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported.

My contribution is based on AutoCAD's own output, by the method recorded in CLEANROOM.md (2026-10-26): AutoCAD-written DWG files compared with AutoCAD-written DXF exports of the same drawings, from the pinned public corpus (nextgis/dwg_samples, ACadSharp samples/; data files only). No third-party DWG or DXF implementation was consulted, ACadSharp's and ezdxf's reading code, comments, tests and derived data included. Field names follow the AcDbMaterial vocabulary of Autodesk's public DXF Reference as recalled (names only), disclosed in the CLEANROOM.md entry.

Developer Certificate of Origin

I affirm that the contribution is my own work and can be distributed under the project's Apache-2.0 license.

…49, #152)

ODA spec v5.4.1 prints no MATERIAL layout. The field list is derived by the
CLEANROOM.md method of 2026-10-26: the data bits of all 212 corpus records
(R14 to R2018) against the AcDbMaterial AutoCAD exported to DXF for the same
handle. Every record closes on its data-stream boundary on every release, from
R2007 on a string stream the list consumes entirely, and 13,058 values equal
the DXF twin by handle with 0 differences. Fields no DXF group shows are named
unknown_* and listed in ARCHITECTURE.md section 7s.

probe_material becomes the twin probe over the shared harness
(examples/support/twin.rs, identical to the objects lane's copy). The strings-only
read_strings and its tests are kept untouched. Baseline: decoded +212,
skipped -212, errored 0.
@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-27T23:26:45.777303Z aeee75d 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 398d5602dd

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/entities/dispatch.rs Resolved
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 27, 2026 23:31
@DrunkOnJava
DrunkOnJava merged commit a561dbb into main Oct 27, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/unp-material branch October 27, 2026 23:37
DrunkOnJava added a commit that referenced this pull request Oct 27, 2026
…ce the Corpus job passes (#418)

* fix(ci): settle a Codex thread that asks for the measured baseline once the Corpus job passes

The train's merge of main carries main's baselines until the PR's own CI run
measures the merge, and Codex reviews that intermediate commit and asks for
the regenerated baseline (#325 and #388 on 2026-10-27). The train then commits
the measured baseline, but the open thread kept the PR from landing until a
person answered it. With the Corpus job green on the current head, whose
ratchet is exactly that check, land.sh replies and resolves such threads; it
touches only the Codex bot's threads that name tools/corpus or
tools/oracle/baseline.tsv.

* fix(ci): settle only a Codex thread whose title asks to regenerate the corpus baseline

Codex on #418: naming a baseline file is not enough; a finding about weakened
or retired oracle comparisons passes a green Corpus job (oracle_base.py lets
the PR's retired rows go) and must keep stopping the train. The thread's title
must now ask to regenerate or re-measure the corpus baseline, its text must
name tools/corpus/baseline.tsv, and it must not mention the oracle.
DrunkOnJava added a commit that referenced this pull request Oct 28, 2026
DrunkOnJava added a commit that referenced this pull request Oct 28, 2026
…10-27 (#416)

* docs: bring README, ROADMAP and CHANGELOG up to the landings of 2026-10-27

README's code-page and DXF writer text named work in review that has landed
(#371, #380, #382, #384); jev_review.py prose ranked those sentences 0.72 to
0.96. ROADMAP's "where it stands" table was a 2026-10-21 snapshot whose
numbers, CI row and release row were all out of date; it now points to the
rendered numbers instead of repeating them. CHANGELOG gains #371, #380, #382,
#384, #385 and #404.

* docs(changelog): record the CI-only merge train (#408)

* docs: OBJECTS landed (#372): README, ROADMAP and CHANGELOG

* docs: LAYOUT, GROUP and MLINESTYLE (#373), the class map writer (#405) and the double-byte round trip (#414) landed

* docs: VISUALSTYLE landed (#413)

* docs(readme): name the skipped types still in review without per-type counts; MATERIAL landed (#325)

* docs(readme): point to the open decoder PRs instead of a list that each landing makes stale
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