Skip to content

feat(entities): decode SHAPE from §20.4.37 (#140) - #310

Merged
DrunkOnJava merged 7 commits into
mainfrom
obj/shape
Oct 28, 2026
Merged

DrunkOnJava merged 7 commits into
mainfrom
obj/shape

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Decode SHAPE (type 0x21, §20.4.37): 3BD insertion point, five BD (scale, rotation, width factor, oblique, thickness), BS shape number and 3BD extrusion. The dispatcher had kept it unhandled on the note that a 160-bit budget had nothing to spend it on; the spec's field list spends it exactly.

Spec reference

§20.4.37 SHAPE (tracking #140). The list closes as printed, with no release-dependent branch. The spec's own R14 example (§20.4.37.1) now closes on its boundary too: spec_examples --update moved that row from unhandled to closes (tests/fixtures/spec-examples/r14-objects.tsv, docs/data/spec-coverage.tsv, docs/spec-coverage.md).

Test plan

  • cargo fmt --all -- --check and cargo clippy --all-targets --all-features -- -D warnings pass on this branch. cargo test, cargo doc and the 1.85 MSRV check run once on a merge of this lane's open branches instead of per branch (the machine is at memory pressure red); the result goes in a comment.

  • Shown on real files, no new unit tests: cargo run --release --example probe_shape -- <corpus> over the 52 pinned drawings. It closes on the boundary and compares the decoded values with AutoCAD's DXF export by handle.

    Release Records Close Values compared with the DXF Differ
    R14 1 1 no twin (boundary only)
    R2000 to R2018 (6 releases) 6 6 24 (insertion point, scale) 0

    AutoCAD omits a group at its default, so the rotation, width factor, oblique angle, thickness and extrusion are absent from all 6 twins (42 values counted as omitted, not compared): for those the evidence is the boundary alone. The shape number has no DXF group (the DXF writes the shape's name).

  • Corpus baseline regenerated: decoded +7, skipped -7, errored unchanged (7 rows).

  • Tests touched: one existing test adapted. entities::dispatch::tests::fixed_entity_label_covers_every_body_arm asserted fixed_entity_label(OBJECT_TYPE_SHAPE).is_none() ("SHAPE has a code but no field list"); that is disproven, so SHAPE moves into the list of codes the test requires a label for. No test added. examples/probe_shape.rs and the shared harness examples/support/twin.rs are new examples.

  • The DXF oracle does not score SHAPE yet.

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 (v5.4.1, sha256 973628f3…f504b) is explicitly allowed (see CLEANROOM.md).
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported.

My contribution is based on:

  • The ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1);
  • The corpus bytes and AutoCAD's own DXF exports of the pinned drawings (the oracle);
  • No reading of comments or code in any other project.

Developer Certificate of Origin

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

The dispatcher kept SHAPE unhandled because a 160-bit budget seemed to have
nothing to spend it on. §20.4.37 spends it: a 3BD insertion point, five BD,
a BS shape number and a 3BD extrusion, with no release-dependent branch.
All 7 SHAPE records of the corpus close on their data-stream boundary from
R14 to R2018, and so does the spec's own R14 example (§20.4.37.1).

Against AutoCAD's DXF export (R2000 to R2018) the insertion point and scale
of the 6 records with a twin equal it; the groups AutoCAD omits at their
defaults are not compared. The label test that asserted SHAPE has no field
list now lists it.
@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-28T17:33:31.084133Z 369a726 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: 508b7c78af

ℹ️ 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/probe_shape.rs Resolved
Resolved by keeping both sides: the SHAPE section joins ARCHITECTURE.md after
main's sections as 7au; examples/support/twin.rs is main's (this branch's copy
differed only in a private Twin::parse); the spec-coverage SHAPE row is this
branch's and VIEWPORT ENTITY's is main's newer closes row, with the page
regenerated. tools/corpus/baseline.tsv is main's; the Corpus job measures the
count change and the baseline is regenerated from its artifact.

@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: 9c649351c1

ℹ️ 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 added type:feature New capability, including a spec section not yet implemented area:entities Entity prescriptions in spec §20.4 labels Oct 28, 2026
DrunkOnJava added a commit that referenced this pull request Oct 28, 2026
…till skipped (#424)

CHANGELOG gains the table objects (#313, #316, #317, #319), the nineteen classes derived from
AutoCAD's output (#326 to #341), the DIMENSION scorer (#387), the BLOCK fixtures (#407), the
maintainer tools (#406, #383) and the merge train's stack handling (#421 to #423). README said every
skipped type had a decoder in review; only SHAPE (#310) and the VIEWPORT entity header (#311) do,
and the rest are twelve custom classes in the BookViewerApp3 drawings with no DXF export yet, now
named. STATUS's pending section says its counts are the 2026-08-30 snapshot.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 28, 2026 17:38
@DrunkOnJava
DrunkOnJava merged commit 7bf9078 into main Oct 28, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the obj/shape branch October 28, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:entities Entity prescriptions in spec §20.4 type:feature New capability, including a spec section not yet implemented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant