Skip to content

feat(dxf): score GEODATA in the value oracle (§20.4.78) - #403

Open
DrunkOnJava wants to merge 3 commits into
mainfrom
feat/dxf-oracle-geodata
Open

DrunkOnJava wants to merge 3 commits into
mainfrom
feat/dxf-oracle-geodata

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

The value oracle scores GEODATA (§20.4.78) against AutoCAD's DXF export under AcDbGeoData: the one record of the corpus (geoloc.dwg, R2018, object version 3).

Scored, with the groups the decoder's probe maps: the object version (90), design coordinate type (70), design and reference points (10, 11), unit scales and units (40, 91, 41, 92), up direction (210), north direction (12), scale estimation (95, 141), sea level (294, 142), projection radius (143), the coordinate system definition (the 303 chunks joined with the final 301), the GeoRSS and observation tags (302, 305 to 307), the mesh points (93 with 13 and 14) and the mesh faces (96 with 97, 98 and 99). Object version 1 records (the R2009 layout) do not occur in the corpus and are not scored.

Spec reference

Spec §20.4.78 GEODATA. Before and after, on the 49 drawing pairs:

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

No field comes out different; the 77 equal values are the 77 the decoder's probe reports. The not-decoded groups are the owner and reactor handles (330, twice) and the reactor bracket.

tools/oracle/baseline.tsv gains the 33 new rows; no existing row changes (the ratchet against main's baseline passes). The §20.4.78 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 AcDbGeoData 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, #150.

The GEODATA decoder (§20.4.78) is now compared with AutoCAD's export
field by field, under AcDbGeoData, with the groups the decoder's probe
maps: the object version (90), design coordinate type (70), design and
reference points (10, 11), unit scales and units (40, 91, 41, 92), up
direction (210), north direction (12), scale estimation (95, 141), sea
level (294, 142), projection radius (143), the coordinate system
definition (the 303 chunks joined with the final 301), the GeoRSS and
observation tags (302, 305 to 307), the mesh points (93 with 13 and 14)
and the mesh faces (96 with 97, 98 and 99). Object version 1 records (the
R2009 layout) do not occur in the corpus and are not scored.

On the 49 drawing pairs: 1 record (geoloc.dwg, R2018), 77 values equal the
export, the 77 the probe reports, and none differ. tools/oracle/baseline.tsv
gains the new rows, and the §20.4.78 row of docs/spec-coverage.md says what
the oracle measured. The oracle's section map files GEODATA under
§20.4.78.

Refs #99, #102, #150
@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-28T15:55:27.725689Z a7523fb 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:
#	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: 6c2579f67a

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

D::Leader(l) => score_leader(&mut c, l),
D::VPort(v) => score_vport(&mut c, v),
D::View(v) => score_view(&mut c, v),
D::GeoData(g) => score_geodata(&mut c, g),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Commit the GEODATA rows to the oracle baseline

The new scorer is enabled, but tools/oracle/baseline.tsv still contains no GEODATA rows. The oracle step in .github/workflows/ci.yml uses that file as its regression gate, and report::ratchet checks only keys already present in the baseline; disagreements printed by main.rs do not independently fail the command. Consequently, any of these newly scored values could regress—or the scorer could stop running entirely—without failing CI. Regenerate and commit the baseline with the GEODATA rows so the reported 77 agreeing values are protected.

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
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