Skip to content

fix(examples): the corpus tools match the .dwg extension in any case (#345) - #353

Merged
DrunkOnJava merged 2 commits into
mainfrom
fix/corpus-tools-dwg-extension-case
Oct 27, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
fix/corpus-tools-dwg-extension-case

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

coverage_report, probe_data_page_header, probe_acis_records, dwg-corpus and probe_material tested the file extension against the lower-case string dwg, so a drawing named X.DWG was skipped without a word. They now compare with eq_ignore_ascii_case, as dxf_oracle, probe_header_vars, probe_r2007_rs, probe_dxf_header and support/twin.rs already do. Found while pinning AutoCAD-written R13 drawings (#345), 26 of whose 122 files end in .DWG: coverage_report measured 222,143 of their records instead of 345,000.

Spec reference

None: corpus tooling, no decoder changes.

Evidence

A directory holding arc_2000.dwg and a .DWG copy of line_2000.dwg (both from the pinned nextgis set), run with a build of this PR's parent and of this PR:

Tool Before After
coverage_report DIR lists 1 file, TOTAL 207 decoded, exit 0 lists 2 files, TOTAL 414 decoded, exit 0
dwg-corpus DIR 1 row 2 rows
probe_acis_records DIR 0 ACIS record(s) across 1 file(s) ... across 2 file(s)

probe_data_page_header --strict DIR, with DIR holding only ARC_2004.DWG (a copy of nextgis arc_2004.dwg): before, it found no file and fell back to ../../samples, printing 10 drawings, 186 data pages (ten other drawings, exit 0); after, 1 drawings, 16 data pages, the drawing it was given.

Every drawing in the pinned corpus today ends in lower-case .dwg, so tools/corpus/measure.py check is unaffected by this PR; it matters for the next pins.

Reproduce:

mkdir /tmp/case && cp nextgis/arc_2000.dwg /tmp/case/arc_2000.dwg && cp nextgis/line_2000.dwg /tmp/case/LINE_2000.DWG
cargo build --release --features cli --bin dwg-corpus --example coverage_report --example probe_acis_records --example probe_data_page_header
target/release/examples/coverage_report /tmp/case
target/release/dwg-corpus /tmp/case
target/release/examples/probe_acis_records /tmp/case
mkdir /tmp/case2 && cp nextgis/arc_2004.dwg /tmp/case2/ARC_2004.DWG
target/release/examples/probe_data_page_header --strict /tmp/case2

Test plan

  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
  • No test added or changed; the before/after above is the evidence, on real drawings through the real entry points.

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 (sha256 973628f3...504b) is explicitly allowed (see CLEANROOM.md).
  • No GPL-licensed DWG implementation source (LibreDWG, or any copy of its example files) was consulted or imported.

My contribution is a one-line change to five filters in the crate's own tools; no outside source was consulted.

Developer Certificate of Origin

I affirm that the contribution complies with the Developer Certificate of Origin 1.1.

…345)

coverage_report, probe_data_page_header, probe_acis_records, dwg-corpus and
probe_material tested the extension as the lower-case string "dwg". A
drawing named X.DWG, which is how AutoCAD-era files are often named, was
skipped without a word: coverage_report listed one file of two and exited 0,
and probe_data_page_header, finding no file, read ../../samples instead and
reported on ten other drawings. The other corpus tools already compare with
eq_ignore_ascii_case.
@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-26T23:58:39.978050Z 437fd1b 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 27, 2026 00:04
@DrunkOnJava
DrunkOnJava merged commit c7216aa into main Oct 27, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/corpus-tools-dwg-extension-case branch October 27, 2026 00:06
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