Skip to content

feat(dxf): score TOLERANCE in the value oracle (§20.4.49) - #392

Merged
DrunkOnJava merged 4 commits into
mainfrom
feat/dxf-oracle-tolerance
Oct 28, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
feat/dxf-oracle-tolerance

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

The value oracle scores TOLERANCE (§20.4.49, decoded by #226) against AutoCAD's DXF export under AcDbFcf: 18 records, R2000 to R2018 (3 per release).

Scored: the insertion point (10), the x direction (11), the extrusion (210) and the text (1, with the export's caret escapes such as ^J undone before comparing). The R13-R14 unknown short, height and dimgap are not in an R2000+ record, and the dimension style is a handle.

Spec reference

Spec §20.4.49 TOLERANCE. Before and after, on the 49 drawing pairs:

Records Equal Default Different DWG only Not decoded
before (main) 18 paired, listed under "Paired records no scorer covers: no scorer yet" - - - - -
after 18 72 54 0 54 54

No field comes out different. The 54 default values are the extrusion, which the export omits when it is (0, 0, 1) (the DXF Reference's default). The 54 DWG-only values are the x direction: the export omits group 11 on every record, and the DXF Reference gives it no default, so the oracle does not assume one. The not-decoded groups are the dimension style name (3), the owner (330) and the layer (8).

tools/oracle/baseline.tsv gains the 60 new rows; no existing row changes (the ratchet against main's baseline passes). The §20.4.49 row of docs/spec-coverage.md says what the oracle measured; its state stays closes.

Test plan

  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test --release --all-features, RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features, python3 tools/ci/spec_coverage.py --check
  • Real files, no new unit tests. The oracle over the pinned corpus reproduces the committed TSV and passes its ratchet against main's baseline:
cargo run --release --features dxf-reader --example dxf_oracle -- <corpus-dir> \
    --baseline tools/oracle/baseline.tsv --tsv oracle.tsv --details
cmp oracle.tsv tools/oracle/baseline.tsv

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. This matters because dwg-rs is Apache-2.0 and must remain compatible.

My contribution is based on:

  • The ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1);
  • Public reverse-engineering notes, research papers, or blog posts cited inline;
  • Reading algorithm-description comments (not executable code) in permissively-licensed projects (MIT / Apache / BSD) to resolve spec ambiguities — disclose any such reading in this PR body so it can be recorded in CLEANROOM.md.

No such reading was needed: the mapping is the spec's DXF column and the DXF Reference's AcDbFcf groups, read from AutoCAD's own exports as data.

See CLEANROOM.md for the full allowed/forbidden source list and the honest scope of what "clean-room" means for this project.

Developer Certificate of Origin

By submitting this PR, I certify that the contribution complies with the
Developer Certificate of Origin 1.1.
Specifically, I affirm that the contribution is my own work (or rightfully
licensed to me) and that it can be distributed under the project's Apache-2.0
license.

I will sign off commits with git commit -s when asked, which adds a
Signed-off-by trailer to the commit message asserting the DCO.

Refs #99, #102, #140.

The TOLERANCE decoder (#226) is now compared with AutoCAD's export field
by field, under AcDbFcf: the insertion point (10), the x direction (11),
the extrusion (210) and the text (1, with the export's caret escapes
undone). The R13-R14 unknown short, height and dimgap are not in an
R2000+ record, and the dimension style is a handle.

On the 49 drawing pairs: 18 records, R2000 to R2018 (3 per release), 72
values equal the export and 54 by its default (the extrusion, which it
omits when it is (0, 0, 1)); none differ. The export omits the x direction
on every record, so its 54 decoded values have no DXF group to compare.
tools/oracle/baseline.tsv gains the 60 new rows, and the §20.4.49 row of
docs/spec-coverage.md says what the oracle measured. The oracle's section
map files TOLERANCE under §20.4.49.

Refs #99, #102, #140
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-28T10:44:57.845461Z 28a4781 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.

# Conflicts:
#	docs/data/spec-coverage.tsv
#	docs/spec-coverage.md
#	tools/oracle/baseline.tsv

@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: ff9eb8aae7

ℹ️ 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 examples/dxf_oracle/scorers.rs Resolved
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 28, 2026 10:50
@DrunkOnJava
DrunkOnJava merged commit c522790 into main Oct 28, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/dxf-oracle-tolerance branch October 28, 2026 10:59
DrunkOnJava added a commit that referenced this pull request Oct 28, 2026
…, and record them (#437)

README named LIGHT, ACSH_CYLINDER_CLASS, ACSH_REVOLVE_CLASS and RAPIDRTRENDERENVIRONMENT as skipped; they decode since #425, #426 and #427, and main's baseline now skips 32 records. CHANGELOG records those and the HATCH and TOLERANCE scorers (#389, #392).
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